这是一个关于MCP服务器的玩笑项目,为大家带来别样的体验。
此MCP服务器是 100% 手动操作,充满了趣味性和独特性。
// 示例:VSCode 设置
"mcp": {
"inputs": [],
"servers": {
"human-mcp": {
"command": "path/to/humanmcp/executable",
"args": [
],
"env": {}
}
}
}
这个MCP服务器是 100% 手动操作。祝你好运。
in.txt 中读取请求。out.txt 中。# 监控客户端的请求
$ tail -f in.txt
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"roots":{"listChanged":true}},"clientInfo":{"name":"Visual Studio Code","version":"1.99.2"}}}
{"method":"notifications/initialized","jsonrpc":"2.0"}
{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get-japan-forecast","arguments":{"location":"Tokyo"}}}
# 将响应发送回客户端
$ echo '{"result":{"protocolVersion":"2024-11-05","capabilities":{"tools":{}},"serverInfo":{"name":"humanmcp","version":"1.0.0","capabilities":{"resources":{},"tools":{}}}},"jsonrpc":"2.0","id":1}' > out.txt
$ echo '{"result":{"tools":[{"name":"get-japan-forecast","description":"Get weather forecast","inputSchema":{"type":"object","properties":{"location":{"type":"string","description":"location name"}},"required":["location"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}]},"jsonrpc":"2.0","id":2}' > out.txt
$ echo '{"result":{"content":[{"type":"text","text":"sunny"}]},"jsonrpc":"2.0","id":3}' > out.txt
(当然,这是一个玩笑项目 😅 )