MCP服务器检查API

一个简单的Node.js Express端点,用于通过查询`https://registry.smithery.ai/servers/{installationCode}`端点来检查MCP服务器的可用性。

  • by Sk-Mahammad-Irfan
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 sk-mahammad-irfan/mcp-server-tester

使用说明

项目设置指南

本指南将引导您完成为项目设置后端和前端的过程。

步骤1:设置后端

  1. 导航到 backend 目录。

    cd backend
    
  2. 通过运行以下命令安装所需的依赖项:

    npm install
    
  3. 创建一个 .env 文件在 backend 文件夹并添加以下环境变量:

    PORT=5000
    FRONTEND_URL=http://localhost:5173
    
  4. 要运行服务器,请使用以下命令:

    npm run dev
    

    服务器现在将运行在 http://localhost:5000.


步骤2:设置前端

  1. 导航到 frontend 目录。

    cd frontend
    
  2. 通过运行以下命令安装所需的依赖项:

    npm install
    
  3. 创建一个 .env 文件在 frontend 文件夹并添加以下环境变量:

    VITE_BACKEND_URL=http://localhost:5000
    
  4. 要运行客户端,请使用以下命令:

    npm run dev
    

    客户端现在将运行在 http://localhost:5173.


附加信息

  • 确保后端和前端同时运行。
  • 您可以通过访问来测试完整的应用程序 http://localhost:5173 在后端和前端服务器都启动并运行后,在浏览器中。

MCP服务器检查API

这是一个简单的Node.js Express端点,通过查询来检查MCP服务器的可用性 https://registry.smithery.ai/servers/{installationCode} 端点使用 installationCode 在请求正文中提供。如果连接失败,服务器将返回成功消息和服务器数据,或者返回错误消息。

端点

发布 /test-server

请求正文

{
  "installationCode": "your-installation-code"
}

响应

{
  "success": true,
  "message": "MCP Server is reachable",
  "data": {
    "qualifiedName": "server-qualified-name",
    "displayName": "Server Display Name",
    "deploymentUrl": "https://deployment-url.com",
    "connections": [
      {
        "type": "http",
        "url": "https://connection-url.com",
        "configSchema": {}
      }
    ]
  }
}

更多信息

有关更多详细信息,请访问 Smithery注册处文件.