mcp独立模块
This commit is contained in:
18
src/mcp_module/__init__.py
Normal file
18
src/mcp_module/__init__.py
Normal file
@@ -0,0 +1,18 @@
|
||||
"""
|
||||
MCP (Model Context Protocol) 客户端包。
|
||||
|
||||
提供 MCPManager 用于管理 MCP 服务器连接、发现工具、调用工具。
|
||||
|
||||
用法:
|
||||
from .manager import MCPManager
|
||||
|
||||
manager = await MCPManager.from_config("config/mcp_config.json")
|
||||
if manager:
|
||||
tools = manager.get_openai_tools() # 获取 OpenAI 格式工具列表
|
||||
result = await manager.call_tool(name, args) # 调用工具
|
||||
await manager.close() # 关闭连接
|
||||
"""
|
||||
|
||||
from .manager import MCPManager
|
||||
|
||||
__all__ = ["MCPManager"]
|
||||
Reference in New Issue
Block a user