AI模型交互客户端

MCP客户端是一个用于与AI模型和服务进行高级交互的工具,支持工具调用和服务器管理。

  • by vurtnec
  • JavaScript
  • 本地部署
  • 6 星标
  • 更新于
在 GitHub 查看 vurtnec/mcp-client

使用说明

MCP客户端

概述

这是一个模型上下文协议(MCP)客户端项目,旨在促进与AI模型和服务的高级交互。

先决条件

  • Node.js(版本16或更高)
  • pnpm(包管理器)

安装

  1. 克隆存储库
git clone https://github.com/your-username/mcp-client.git
cd mcp-client
  1. 安装依赖项
pnpm install

配置

  1. 复制 mcp_config.json.example 向 mcp_config.json
  2. 使用您的特定服务器和工具设置修改配置文件

用法

  1. 要运行客户端,请执行以下操作:
pnpm start
  1. 运行客户端时,您自己的所有服务器都将被注册。

  2. 您可以使用 list-tools API列出特定服务器可用的所有工具。

curl --location 'http://localhost:3000/list-tools/{serverName}'
  1. 您可以使用 call-tool API调用特定工具。
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。

贡献

  1. 分叉存储库
  2. 创建功能分支(git checkout -b feature/AmazingFeature)
  3. 提交您的更改(git commit -m 'Add some AmazingFeature')
  4. 推到分支(git push origin feature/AmazingFeature)
  5. 打开拉取请求

许可证

根据MIT许可证分发。看 LICENSE 了解更多信息。

联系

你的名字your.email@example.com

项目链接: https://github.com/your-username/mcp-client