🛰️航天仿真算法库 SpaceAST 0.4.0
载入中...
搜索中...
未找到
MCP

详细描述

Model Context Protocol 服务器接口

枚举

enum class  ast::EMcpErrorCode : int {
  ast::EMcpErrorCode::eParseError = -32700 , ast::EMcpErrorCode::eInvalidRequest = -32600 , ast::EMcpErrorCode::eMethodNotFound = -32601 , ast::EMcpErrorCode::eInvalidParams = -32602 ,
  ast::EMcpErrorCode::eInternalError = -32603
}
 

函数

void ast::aAddAgentToolsToMcpServer (McpServer &server)
 
bool ast::aMcpIsSupportedProtocolVersion (StringView version)
 

变量

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

enum class ast::EMcpErrorCode : int
strong

JSON-RPC错误码

枚举值
eParseError 

解析错误

eInvalidRequest 

无效请求

eMethodNotFound 

方法不存在

eInvalidParams 

参数无效

eInternalError 

内部错误

函数说明

◆ aAddAgentToolsToMcpServer()

AST_AGENT_API void ast::aAddAgentToolsToMcpServer ( McpServer & server)

将AstAgent的默认智能体工具注册到MCP服务器

参数
serverMCP服务器

工具的增删由AstAgent维护;本函数只做格式转换和转发,不包含具体业务逻辑。

◆ aMcpIsSupportedProtocolVersion()

bool ast::aMcpIsSupportedProtocolVersion ( StringView version)
inline

判断协议版本是否受支持

参数
version客户端请求的协议版本
返回
是否受支持