此存储库已移动到 https://git.navicore.tech/navicore/gamecode-mcp2. GitHub副本已存档,不再维护。
 
游戏代码MCP2
模型上下文协议(MCP)的干净(可能是幼稚)实现 用于工具集成。
动机-尽可能少的依赖,尽可能简单和可审计 配置尽可能。
⚠️ 安全通知
MCP是早期技术。允许LLM执行系统命令本身就有风险。 此实现将可审计性置于功能之上——您可以阅读每一行 处理LLM请求。即便如此,请谨慎行事。只有时间会证明 MCP的方法是合理的。
主要特点
- 直接接触工具 -中定义的工具
tools.yaml直接通过MCP公开,而不是通过元工具公开 - 清洁协议实施 -基于stdio的纯JSON-RPC 2.0,无需外部依赖
- 动态刀具加载 -通过YAML配置工具,无需重新编译
- 内置和外部工具 -支持内部处理程序和外部命令
建筑
此工作区包含两个板条箱:
mcp-server-从加载工具的MCP服务器tools.yaml并通过协议公开它们mcp-client-用于测试和集成的客户端库
用法
运行服务器
# Build the server
cargo build --release --bin gamecode-mcp2
# Create a tools.yaml file (see examples/tools.yaml)
cp examples/tools.yaml .
# Run the server (it communicates via stdio)
./target/release/gamecode-mcp2与Claude Desktop一起使用
添加到您的Claude Desktop配置中:
{
"mcpServers": {
"gamecode": {
"command": "/path/to/gamecode-mcp2"
}
}
}与gamecode cli一起使用
这 mcp-client crate可以用作gamecode-cli中MCP集成的依赖项。
工具配置
工具定义见 tools.yaml:
tools:
- name: my_tool
description: Description for the LLM
command: /path/to/command # or "internal" for built-in
args:
- name: param1
description: Parameter description
required: true
type: string
cli_flag: --param # null for positional
internal_handler: handler_name # for internal tools协议
此实现遵循MCP规范:
initialize-与客户握手tools/list-返回所有可用工具tools/call-执行特定工具
工具是直接公开的,而不是通过“run”等元工具。

