使用说明
MCP客户端和服务器示例
src
├── chat.ts # command line chat interface to Claude completion
├── client.ts # MCP client that starts MCP server with stdio transport
├── index.ts # Node run script to start MCP server or Chat CLI
├── llm.ts # Uses Anthropic SDK to talk to Claude API
└── server.ts # MCP server that exposes tools and executes them
取决于
NPM # install with your package manager of choice (Recommend nix)
# nix shell nixpkgs#nodejs
ANTHROPIC_API_KEY='' # Put your key here in .env.local file
构建
npm run build
运行MCP stdio客户端/服务器演示
npm run mcp
使用MCP与Anthropic运行CLI聊天
npm run chat
全部
注: 使用Claude和Gemini网络聊天界面生成一些 锅炉板代码。
