返回市场
roc-mcp-测试床

roc-mcp-测试床

作者:imclerran2 星标更新:2025-07-22

项目介绍

Roc Model-Context-Protocol 服务器

这是一个简单的Roc MCP服务器概念验证,在几个小时内拼凑而成。请根据其价值来使用它。

在Claude桌面中配置:

前往Claude->设置->开发者->编辑配置,并像这样添加MCP服务器:

{
  "mcpServers": {
    "current_datetime": {
      "command": "/绝对路径到你的roc/",
      "args": [
        "/绝对路径到roc-mcp-testbed/src/main.roc"
      ]
    }
  }
}

手动测试消息

MCP服务器通过标准输入/标准输出进行通信,并将附加信息记录到标准错误输出。

你可以通过从命令行运行二进制文件并通过标准输入发送消息来手动测试服务器的行为。模型上下文协议使用JSON-RPC,并且在服务器处理工具调用之前需要一个初始化握手。

以下是一些开始使用的消息:

1) 初始化

{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "手动测试", "version": "1.0.0"}}}

2) 确认握手

{"jsonrpc": "2.0", "method": "notifications/initialized"}

3) 获取工具列表

{"jsonrpc": "2.0", "id": 2, "method": "tools/list"}

4) 调用一个工具

{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "local_datetime", "arguments": {}}}