Model Context Protocol 服务器接口
|
|
constexpr const char * | ast::kMcpJsonRpcVersion = "2.0" |
| |
|
constexpr const char * | ast::kMcpProtocolVersion20251125 = "2025-11-25" |
| |
|
constexpr const char * | ast::kMcpProtocolVersion20250618 = "2025-06-18" |
| |
|
constexpr const char * | ast::kMcpProtocolVersion20250326 = "2025-03-26" |
| |
|
constexpr const char * | ast::kMcpProtocolVersion20241105 = "2024-11-05" |
| |
|
constexpr const char * | ast::kMcpDefaultProtocolVersion = kMcpProtocolVersion20251125 |
| |
|
constexpr const char * | ast::kMcpMethodInitialize = "initialize" |
| |
|
constexpr const char * | ast::kMcpMethodInitialized = "notifications/initialized" |
| |
|
constexpr const char * | ast::kMcpMethodCancelled = "notifications/cancelled" |
| |
|
constexpr const char * | ast::kMcpMethodPing = "ping" |
| |
|
constexpr const char * | ast::kMcpMethodToolsList = "tools/list" |
| |
|
constexpr const char * | ast::kMcpMethodToolsCall = "tools/call" |
| |
◆ EMcpErrorCode
JSON-RPC错误码
| 枚举值 |
|---|
| eParseError | 解析错误
|
| eInvalidRequest | 无效请求
|
| eMethodNotFound | 方法不存在
|
| eInvalidParams | 参数无效
|
| eInternalError | 内部错误
|
◆ aAddAgentToolsToMcpServer()
| AST_AGENT_API void ast::aAddAgentToolsToMcpServer |
( |
McpServer & | server | ) |
|
将AstAgent的默认智能体工具注册到MCP服务器
- 参数
-
工具的增删由AstAgent维护;本函数只做格式转换和转发,不包含具体业务逻辑。
◆ aMcpIsSupportedProtocolVersion()
| bool ast::aMcpIsSupportedProtocolVersion |
( |
StringView | version | ) |
|
|
inline |