Content
# @anscodelab/mantis-mcp-server (npm package)
Standalone MCP server for MantisBT REST API endpoints.
## Install
```bash
npm install -g @anscodelab/mantis-mcp-server
```
or run directly via `npx` (recommended):
```bash
npx -y @anscodelab/mantis-mcp-server
```
## Configuration
Set the following env variables to point at your Mantis instance:
- `MANTIS_BASE_URL` (e.g. `https://mantis.example.com/api/rest`)
- `MANTIS_USE_INDEX_PHP` (`true` when Mantis is served without URL rewrite)
- `MANTIS_API_TOKEN` (create under **My Account → API Tokens** in Mantis)
Example:
```bash
export MANTIS_BASE_URL=https://mantis.example.com/api/rest
export MANTIS_USE_INDEX_PHP=true
export MANTIS_API_TOKEN=YOUR_REAL_TOKEN_HERE
```
### Claude Code CLI
Install the package globally first:
```bash
npm install -g @anscodelab/mantis-mcp-server
```
Then add the server to `~/.claude.json` (create the `mcpServers` key if it doesn't exist):
```json
{
"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"
}
}
}
}
```
Find the paths with:
```bash
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
```
Restart Claude Code after editing `~/.claude.json`.
### VS Code MCP configuration
```json
{
"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"
}
}
}
}
```
## Running
```bash
mantis-mcp-server
```
The server speaks MCP over stdio and exposes Mantis REST endpoints via tools.
For full developer documentation and local development setup, see the repository README (`README.dev.md`).