使用说明
MCP客户端
概述
这是一个模型上下文协议(MCP)客户端项目,旨在促进与AI模型和服务的高级交互。
先决条件
- Node.js(版本16或更高)
- pnpm(包管理器)
安装
- 克隆存储库
git clone https://github.com/your-username/mcp-client.git
cd mcp-client
- 安装依赖项
pnpm install
配置
- 复制
mcp_config.json.example向mcp_config.json - 使用您的特定服务器和工具设置修改配置文件
用法
- 要运行客户端,请执行以下操作:
pnpm start
-
运行客户端时,您自己的所有服务器都将被注册。
-
您可以使用
list-toolsAPI列出特定服务器可用的所有工具。
curl --location 'http://localhost:3000/list-tools/{serverName}'
- 您可以使用
call-toolAPI调用特定工具。
curl --location 'http://localhost:3000/call-tool' \
--header 'Content-Type: application/json' \
--data '{
"serverName": "server_name",
"toolName": "tool_name",
"args": {
// Arguments must match the inputSchema from the list-tools response
// Required fields must be included
// Optional fields can be omitted
// Example based on above schema:
// "issue_key": "PROJ-123" // Required
// "expand": "..." // Optional
}
}'
光标
所有工具调用都将记录在 .cursorrules 文件。
重要:
- 您必须将cursorules复制到自己的仓库中,并根据自己的需要进行编辑。
- 您必须将“mcp_config.json”复制到自己的REPO中,并根据自己的需要进行编辑。
- 你必须使用COMPOSER和AGENT。
贡献
- 分叉存储库
- 创建功能分支(
git checkout -b feature/AmazingFeature) - 提交您的更改(
git commit -m 'Add some AmazingFeature') - 推到分支(
git push origin feature/AmazingFeature) - 打开拉取请求
许可证
根据MIT许可证分发。看 LICENSE 了解更多信息。
联系
你的名字your.email@example.com
