Claude命令行聊天工具

一个基于Claude API的命令行聊天工具,支持MCP客户端/服务器模式,适用于开发者进行AI对话测试和集成。

  • by oneness
  • TypeScript
  • 本地部署
  • 5 星标
  • 更新于
在 GitHub 查看 oneness/ts-mcp-client-server

使用说明

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网络聊天界面生成一些 锅炉板代码。