MantisBT REST API服务器

一个独立的MantisBT REST API端点服务器,用于通过MCP协议与开发工具集成。

  • by AnsCodeLab
  • JavaScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 annguyen209/MantisMcpServer

使用说明

@anscodelab/mantis-mcp服务器(npm包)

MantisBT REST API端点的独立MCP服务器。

安装

npm install -g @anscodelab/mantis-mcp-server

或直接通过运行 npx (推荐):

npx -y @anscodelab/mantis-mcp-server

配置

设置以下env变量以指向您的Mantis实例:

  • MANTIS_BASE_URL (例如。 https://mantis.example.com/api/rest)
  • MANTIS_USE_INDEX_PHP (true 当Mantis在不重写URL的情况下提供服务时)
  • MANTIS_API_TOKEN (创建于 我的账户→ API令牌 曼蒂斯)

例子:

export MANTIS_BASE_URL=https://mantis.example.com/api/rest
export MANTIS_USE_INDEX_PHP=true
export MANTIS_API_TOKEN=YOUR_REAL_TOKEN_HERE

克劳德代码CLI

首先全局安装软件包:

npm install -g @anscodelab/mantis-mcp-server

然后将服务器添加到 ~/.claude.json (创建 mcpServers 如果不存在,则使用key):

{
  "mcpServers": {
    "mantis-mcp-server": {
      "type": "stdio",
      "command": "/path/to/node",
      "args": ["/path/to/node_modules/@anscodelab/mantis-mcp-server/bin/mantis-mcp-server.js"],
      "env": {
        "MANTIS_BASE_URL": "https://mantis.example.com/api/rest",
        "MANTIS_USE_INDEX_PHP": "true",
        "MANTIS_API_TOKEN": "YOUR_REAL_TOKEN_HERE"
      }
    }
  }
}

使用以下内容查找路径:

where node          # Windows
which node          # macOS/Linux

# Global package path (Windows)
npm root -g
# e.g. C:\Users\you\AppData\Roaming\npm\node_modules

# Global package path (macOS/Linux)
npm root -g
# e.g. /usr/local/lib/node_modules

编辑后重新启动Claude代码 ~/.claude.json.

VS代码MCP配置

{
  "mcpServers": {
    "mantis-rest": {
      "command": "npx",
      "args": ["-y", "@anscodelab/mantis-mcp-server@latest"],
      "env": {
        "MANTIS_BASE_URL": "https://mantis.example.com/api/rest",
        "MANTIS_USE_INDEX_PHP": "true",
        "MANTIS_API_TOKEN": "YOUR_REAL_TOKEN_HERE"
      }
    }
  }
}

跑步

mantis-mcp-server

服务器通过stdio与MCP通信,并通过工具公开Mantis REST端点。

有关完整的开发人员文档和本地开发设置,请参阅存储库README(README.dev.md).