MCP测试服务器

轻量级MCP测试服务器,用于验证客户端连接性,提供集成工具和提示。

  • by kukapay
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 kukapay/mcp-test-server

使用说明

MCP测试服务器

轻量级MCP测试服务器,用于验证客户端连接,带有集成工具和提示。试试看 kukayay.com 或在本地安装。

特性

  • 工具:
    • calculate_sum:对一组数字求和。
  • 资源:
    • 静态: test://data -返回静态测试数据。
    • 动态: user://{userId} -返回给定用户的配置文件数据 userId.
  • 鼓励:
    • greeting:根据姓名参数生成个性化问候语。
  • 运输:
    • 流式HTTP(推荐用于现代MCP客户端)。
    • 体育场 (via mcp-remote 对于需要stdio传输的客户)。
    • HTTP SSE(传统,从MCP标准中删除)。

在线服务器

在线测试服务器 https://test.kukapay.com 使用以下配置:

  • 可流式HTTP传输

对于支持流式HTTP传输的客户端:

{
  "McpServers": {
    "Test Server": {
      "url": "https://test.kukapay.com/api/mcp"
    }
  }
}
  • 标准运输

对于需要stdio传输的客户端,请使用 mcp-remote:

{
  "McpServers": {
    "Test Server": {
      "command": "npx",
      "args": ["mcp-remote", "-y", "https://test.kukapay.com/api/mcp"]
    }
  }
}
  • HTTP SSE传输(传统)

对于支持HTTP SSE的客户端(注意:在MCP标准中已弃用):

{
  "McpServers": {
    "Test Server": {
      "url": "https://test.kukapay.com/api/sse"
    }
  }
}

本地安装

先决条件

  • Node.js>=18.x
  • npm>=9.x

安装

  1. 克隆存储库:

    git clone https://github.com/kukapay/mcp-test-server.git
    cd mcp-test-server
    
  2. 安装依赖项:

    npm install
    
  3. 启动开发服务器:

    npm run dev
    

    服务器将在以下时间可用 http://localhost:3000.

配置

将MCP客户端配置为使用以下传输方法之一连接到本地服务器:

  • 可流式HTTP传输
{
  "McpServers": {
    "Test Server": {
      "url": "http://localhost:3000/api/mcp"
    }
  }
}
  • 标准运输
{
  "McpServers": {
    "Test Server": {
      "command": "npx",
      "args": ["mcp-remote", "-y", "http://localhost:3000/api/mcp"]
    }
  }
}
  • HTTP SSE传输(传统)
{
  "McpServers": {
    "Test Server": {
      "url": "http://localhost:3000/api/sse"
    }
  }
}

客户端特定配置

  • 克劳德桌面:将上述配置添加到 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)或 %APPDATA%\Claude\claude_desktop_config.json (Windows)。
  • 光标:添加到 ~/.cursor/mcp.json.
  • 帆板运动:添加到 ~/.codeium/windsurf/mcp_config.json.

许可证

MIT许可证。看 许可证 了解详情。