@dpesch/mantisbt-mcp-server

中文文档
1.15.0发布于 2026/11/01MITES Module

MCP server for MantisBT REST API – read and manage bug tracker issues

原始使用文档
文档目录23 节
  1. Requirements
  2. Installation
  3. Configuration
  4. Environment variables
  5. Limit the offered tools
  6. Available tools
  7. Issues
  8. Notes
  9. Attachments
  10. Relationships
  11. Monitors
  12. Tags
  13. Projects
  14. Semantic search (optional)
  15. Metadata & system
  16. Token usage
  17. Available resources
  18. Available prompts
  19. HTTP mode
  20. Documentation
  21. Development
  22. License
  23. Contributing

MantisBT MCP Server

npm version license MCP compatible MCP Badge MantisBT MCP Server

English · Deutsch

A Model Context Protocol (MCP) server that integrates the MantisBT REST API into Claude Code and other MCP-capable clients. Read, create, and update issues directly from your editor.

Requirements

  • Node.js ≥ 22
  • MantisBT installation with REST API enabled (version 2.23+)
  • MantisBT API token (create under My Account → API Tokens)

Installation

Via npx (recommended):

Add to ~/.claude/claude_desktop_config.json (Claude Desktop) or your local claude_desktop_config.json (Claude Code):

{
  "mcpServers": {
    "mantisbt": {
      "command": "npx",
      "args": ["-y", "@dpesch/mantisbt-mcp-server"],
      "env": {
        "MANTIS_BASE_URL": "https://your-mantis.example.com/api/rest",
        "MANTIS_API_KEY": "your-api-token"
      }
    }
  }
}

Local build:

git clone https://codeberg.org/dpesch/mantisbt-mcp-server
cd mantisbt-mcp-server
npm run init
npm run build
{
  "mcpServers": {
    "mantisbt": {
      "command": "node",
      "args": ["/path/to/mantisbt-mcp-server/dist/index.js"],
      "env": {
        "MANTIS_BASE_URL": "https://your-mantis.example.com/api/rest",
        "MANTIS_API_KEY": "your-api-token"
      }
    }
  }
}

Configuration

Environment variables

VariableRequiredDefaultDescription
MANTIS_BASE_URL✅–Base URL of your MantisBT installation. Both https://your-mantis.example.com and https://your-mantis.example.com/api/rest are accepted — the /api/rest suffix is normalized automatically.
MANTIS_API_KEY✅–API token for authentication
MANTIS_USE_INDEX_PHP–autoSet to true when URL rewriting is unavailable — REST requests then use /api/rest/index.php/ instead of /api/rest/. Detected automatically when MANTIS_BASE_URL ends with /api/rest/index.php; an explicit value always wins. See the cookbook.
MANTIS_CACHE_DIR–~/.cache/mantisbt-mcpDirectory for the metadata cache
MANTIS_CACHE_TTL–3600Cache lifetime in seconds
TRANSPORT–stdioTransport mode: stdio or http
PORT–3000Port for HTTP mode
MCP_HTTP_HOST–127.0.0.1Bind address for HTTP mode. Changed from 0.0.0.0 to 127.0.0.1 — the server now listens on localhost only by default. Set to 0.0.0.0 for Docker or remote access.
MCP_HTTP_TOKEN✅ (HTTP mode)–Bearer token for the /mcp endpoint (Authorization: Bearer <token>). Required when TRANSPORT=http — the server refuses to start in HTTP mode without it, so tools are never exposed unauthenticated. Ignored in stdio mode. The /health endpoint is always public.
MANTIS_SEARCH_ENABLED–falseSet to true to enable semantic search
MANTIS_SEARCH_BACKEND–vectraVector store backend: vectra (pure JS) or sqlite-vec (requires manual install)
MANTIS_SEARCH_DIR–{MANTIS_CACHE_DIR}/searchDirectory for the search index
MANTIS_SEARCH_MODEL–Xenova/paraphrase-multilingual-MiniLM-L12-v2Embedding model name (downloaded once on first use, ~80 MB)
MANTIS_SEARCH_THREADS–1Number of ONNX intra-op threads for the embedding model. Default is 1 to prevent CPU saturation on multi-core machines and WSL. Increase only if index rebuild speed matters and the host is dedicated to this workload.
MANTIS_UPLOAD_DIR––Restrict upload_file's file_path to files within this directory (path traversal via ../ is blocked). In stdio mode file_path is unrestricted unless this is set. In HTTP mode file_path reads from the server's filesystem, so it is disabled unless this variable is set — HTTP clients should upload via the content (Base64) parameter instead.
MANTIS_TOOLSETS–– (all)Comma-separated list of tool groups to offer: issues, notes, links, files, projects, versions, meta, search (case-insensitive). Unset or empty means all groups. The search group additionally requires MANTIS_SEARCH_ENABLED=true; without the group the search module is not started at all. An unknown group name stops the server at startup with a message listing the valid names. See Limit the offered tools and the cookbook.
MANTIS_DISABLE_DESTRUCTIVE–falseSet to true to hide every destructive tool — delete_issue, delete_note, delete_version, remove_relationship, remove_monitor — regardless of the active groups. Hidden tools are not listed and return "Tool … not found" when called.

Limit the offered tools

Two env vars reduce the tool surface offered to the model — useful to keep the model's context shorter and to prevent accidental destructive operations:

  • MANTIS_TOOLSETS — include only the listed groups (comma-separated, case-insensitive)
  • MANTIS_DISABLE_DESTRUCTIVE=true — additionally hide delete_issue, delete_note, delete_version, remove_relationship, and remove_monitor regardless of the active groups

Hidden tools are not listed and return "Tool … not found" when called.

GroupTools
issuesget_issue, list_issues, create_issue, update_issue, delete_issue¹, get_issues†, list_notes†, list_issue_files†, add_monitor†, remove_monitor†¹
notesadd_note, delete_note¹
linksadd_relationship, remove_relationship¹, attach_tags, detach_tag, list_tags
filesupload_file
projectslist_projects, get_project, list_filters, get_project_categories†, get_project_users†, get_project_versions†, find_project_member†
versionscreate_version, update_version, delete_version¹, release_version†
metaget_metadata, get_issue_schema, get_config, get_version, get_current_user, get_metadata_full†, sync_metadata†, get_search_index_status†, get_issue_fields†, get_issue_enums†, get_mcp_version†, get_mantis_version†, list_languages†
searchsearch_issues, rebuild_search_index ²

¹ hidden by MANTIS_DISABLE_DESTRUCTIVE=true · † deprecated, removed in 2.0.0 · ² additionally requires MANTIS_SEARCH_ENABLED=true; without the search group the search module is not started at all

Deprecated tools always belong to the same group as their replacement — disabling a group hides old and new name together.

Example A — triage setup (issues, notes, and metadata; no destructive operations):

{
  "mcpServers": {
    "mantisbt": {
      "command": "npx",
      "args": ["-y", "@dpesch/mantisbt-mcp-server"],
      "env": {
        "MANTIS_BASE_URL": "https://your-mantis.example.com/api/rest",
        "MANTIS_API_KEY": "your-api-token",
        "MANTIS_TOOLSETS": "issues,notes,meta",
        "MANTIS_DISABLE_DESTRUCTIVE": "true"
      }
    }
  }
}

Example B — all groups, delete-protection only (36 of the 41 default tools):

{
  "mcpServers": {
    "mantisbt": {
      "command": "npx",
      "args": ["-y", "@dpesch/mantisbt-mcp-server"],
      "env": {
        "MANTIS_BASE_URL": "https://your-mantis.example.com/api/rest",
        "MANTIS_API_KEY": "your-api-token",
        "MANTIS_DISABLE_DESTRUCTIVE": "true"
      }
    }
  }
}

Available tools

Issues

ToolDescription
get_issueRetrieve an issue by id, or several by ids (1–50) in one call — pass exactly one; with ids returns { issues, requested, found, failed }, missing or inaccessible IDs give null at their position; optional select for field projection
get_issuesDeprecated: use get_issue with ids instead — will be removed in 2.0.0
list_issuesFilter issues by project, status, author, and more; optional select for field projection and status for client-side status filtering — canonical English status names (e.g. "new", "resolved") are matched by ID, making the filter language-independent on localized installations; group_by ("status", "handler", "priority", "category") returns counts per group instead of an issue list — all filters still apply, page, page_size, and select are ignored
create_issueCreate a new issue; severity and priority must be canonical English names (e.g. minor, major, normal, high) — call get_issue_schema to see all valid values and their localized labels; optional handler parameter accepts a username as alternative to handler_id (resolved against project members); optional custom_fields to set custom field values
update_issueUpdate an existing issue; enum fields (status, priority, severity, resolution, reproducibility) accept canonical English names, localized names, or numeric IDs — the server resolves names to IDs automatically; supports custom_fields and an optional note parameter that appends a note in the same call; fields may be omitted when only add_monitors, remove_monitors, or note are given; use add_monitors / remove_monitors (arrays of login names) to add or remove watchers — the response includes a monitors key with the current and changed monitor lists; use fields.notes to edit existing notes by ID (note ID from get_issue)
delete_issueDelete an issue

Notes

ToolDescription
list_notesDeprecated: use get_issue with select: "notes" instead — will be removed in 2.0.0
add_noteAdd a note to an issue
delete_noteDelete a note

Attachments

ToolDescription
list_issue_filesDeprecated: use get_issue with select: "attachments" instead — will be removed in 2.0.0
upload_fileUpload a file to an issue — preferred: local file_path (server reads and encodes automatically); fallback: Base64-encoded content + filename (use only when file_path is not available)

Relationships

ToolDescription
add_relationshipCreate a relationship between two issues; optional type_name parameter accepts a string name (e.g. "related_to", "duplicate_of") as alternative to numeric type_id
remove_relationshipRemove a relationship from an issue (use the id from the relationship object, not the type)

Monitors

ToolDescription
add_monitorDeprecated: use update_issue with add_monitors instead — will be removed in 2.0.0
remove_monitorDeprecated: use update_issue with remove_monitors instead — will be removed in 2.0.0

Tags

ToolDescription
list_tagsList all available tags; falls back to the metadata cache when GET /tags returns 404 (run get_metadata with refresh: true first to populate)
attach_tagsAttach tags to an issue
detach_tagRemove a tag from an issue

Projects

ToolDescription
list_projectsList all accessible projects; returns normalized project data (consistent with the metadata cache)
get_projectGet one project's master data (id, name, status, enabled, subprojects) plus, on request, its categories, users and/or versions in one call; access_level and member_query imply users; obsolete/inherit imply versions
get_project_versionsDeprecated: use get_project with include: ["versions"] instead — will be removed in 2.0.0
create_versionCreate a new version in a project; returns the created version object (id, name, description, released, obsolete, timestamp); requires manage_project_threshold (default: manager)
update_versionUpdate an existing version; only the fields you pass are changed (at least one required); renaming rewrites version/target_version/fixed_in_version on all referencing issues; optional next_version (only with released: true) creates a follow-up version in the same call; requires manage_project_threshold (default: manager)
release_versionDeprecated: use update_version with released: true, timestamp, and optionally next_version instead — will be removed in 2.0.0
delete_versionPermanently delete a version — irreversible, MantisBT clears version/target_version/fixed_in_version on all referencing issues; prefer update_version with obsolete=true as the non-destructive alternative; requires manage_project_threshold (default: manager)
get_project_categoriesDeprecated: use get_project with include: ["categories"] instead — will be removed in 2.0.0
get_project_usersDeprecated: use get_project with include: ["users"] instead — will be removed in 2.0.0
find_project_memberDeprecated: use get_project with member_query instead (no limit, returns all matches) — will be removed in 2.0.0

Semantic search (optional)

Instead of exact keyword matching, semantic search understands the meaning behind a query. Ask in plain language — the search engine finds conceptually related issues even when the wording doesn't match:

  • "login fails after password reset" — finds issues about authentication edge cases
  • "performance problems on the checkout page" — surfaces related reports regardless of the exact terminology used
  • "duplicate entries in the invoice list" — catches issues described as "shown twice", "double records", etc.

The embedding model (~80 MB) runs entirely offline — no OpenAI key, no external API. It is downloaded once on first start and cached locally. Issues are indexed incrementally on every server start (only new and updated issues are re-indexed). When several client sessions start a server at the same time, only one of them syncs the shared index. The model is loaded on first use and unloaded again after 10 minutes without embedding, so idle sessions do not hold on to its memory (~0.9 GB per server process).

Activate with MANTIS_SEARCH_ENABLED=true.

ToolDescription
search_issuesNatural language search over all indexed issues — returns top-N results with cosine similarity score; optional select (comma-separated field names) enriches each result with the requested issue fields; optional highlight (boolean, default false) adds a highlights field per result with keyword-matched excerpts from summary and description (matched terms shown in **bold**)
rebuild_search_indexBuild or update the search index; full: true clears and rebuilds from scratch
get_search_index_statusDeprecated: use get_metadata (field search_index) instead — will be removed in 2.0.0

Which backend to choose?

vectra (default)sqlite-vec
DependenciesNone (pure JS)Requires native build tools
InstallIncludednpm install sqlite-vec better-sqlite3
Best forUp to ~10,000 issues10,000+ issues
PerformanceFast enough for most setupsFaster for large corpora

Start with vectra. Switch to sqlite-vec if indexing or query times become noticeably slow.

npm install sqlite-vec better-sqlite3
# then set MANTIS_SEARCH_BACKEND=sqlite-vec

Metadata & system

ToolDescription
get_metadataRetrieve cached metadata: detail: "summary" (default) returns project/tag counts and per-project user/version/category counts; detail: "full" returns the complete raw cache; refresh: true re-fetches from MantisBT first; with semantic search enabled the response also contains a search_index block
get_versionVersion of this MCP server and of the connected MantisBT installation in one response; check_latest (default true) compares MantisBT with the latest GitHub release; mantis holds error when MantisBT cannot be reached
get_issue_schemaValid select fields (fields, fields_source) and enum values (enums: severity, status, priority, resolution, reproducibility) for this MantisBT server in one response; optional project_id scopes the field discovery — use before create_issue / update_issue or when building a select string
get_issue_fieldsDeprecated: use get_issue_schema instead — will be removed in 2.0.0
get_issue_enumsDeprecated: use get_issue_schema instead; the resource mantis://enums stays — will be removed in 2.0.0
get_metadata_fullDeprecated: use get_metadata with detail: "full" instead — will be removed in 2.0.0
sync_metadataDeprecated: use get_metadata with refresh: true instead — will be removed in 2.0.0
list_filtersList saved filters
get_current_userRetrieve your own user profile — includes language (the user's MantisBT language, a hint for which language to use in issue texts and notes)
list_languagesDeprecated: use get_current_user (field language) instead — will be removed in 2.0.0
get_configShow server configuration (base URL, cache TTL)
get_mantis_versionDeprecated: use get_version instead — will be removed in 2.0.0
get_mcp_versionDeprecated: use get_version instead — will be removed in 2.0.0

Token usage

The server handles counting and field projection itself — the model receives a compact summary instead of reading raw issue lists. Measured on 2026-10-31 against a MantisBT 2.28 installation (604 issues, five issues with long descriptions/notes):

TaskBeforeTokensAfterTokensSaved
Status overview of a project (604 issues)list_issues, all pages1,274,398list_issues + group_by: "status"16599.9 %
Open issues per handlerlist_issues status "open" + select, all pages ¹2,686list_issues + group_by: "handler"10895.9 %
5 issues with selected fieldsget_issue ids, no select16,272get_issue ids + select62396.1 %

¹ list_issues scans at most 500 issues when client-side filters are active, so this "before" value is understated.

Tokens estimated as characters / 4. To reproduce against your own instance (requires a git checkout, not available via npx):

MANTIS_BASE_URL=… MANTIS_API_KEY=… \
  BENCHMARK_PROJECT_ID=12 BENCHMARK_ISSUE_IDS=101,102,103,104,105 \
  npm run benchmark

Credentials may also come from .env.local.

Available resources

MCP Resources are URI-addressable, read-only data that clients can fetch directly without calling a tool. They are the third MCP primitive alongside Tools and Prompts. Note that Resource support is less widely implemented in MCP clients than Tools — check your client's documentation.

Resource URIDescription
mantis://meProfile of the authenticated API user (live fetch)
mantis://projectsAll accessible MantisBT projects as a compact list (cache-backed, refreshed via get_metadata with refresh: true)
mantis://projects/{id}Combined project view: project fields + users + versions + categories in one call; cache-first, list-support for enumerating all available project URIs
mantis://enumsValid values for all issue enum fields: severity, priority, status, resolution, reproducibility (live fetch)

Available prompts

MCP prompt templates are conversation starters that instruct the LLM to collect structured input and then call the appropriate tool. They are not tools themselves — they initiate a guided workflow.

PromptRequired argsOptional argsDescription
create-bug-reportproject_id, category, summary, descriptionsteps_to_reproduce, expected, actual, environmentGuides through a structured bug report and calls create_issue
create-feature-requestproject_id, category, summary, descriptionuse_caseGuides through a feature request and calls create_issue
summarize-issueissue_id–Fetches an issue via get_issue and returns a concise summary
project-statusproject_id–Lists issues via list_issues and generates a status report grouped by severity

HTTP mode

For use as a standalone server (e.g. in remote setups). MCP_HTTP_TOKEN is required in HTTP mode — the server refuses to start without it:

MCP_HTTP_TOKEN=secret MANTIS_BASE_URL=... MANTIS_API_KEY=... \
  TRANSPORT=http PORT=3456 node dist/index.js

# With explicit bind address (required for Docker/remote):
# MCP_HTTP_TOKEN=secret MANTIS_BASE_URL=... MANTIS_API_KEY=... \
#   TRANSPORT=http PORT=3456 MCP_HTTP_HOST=0.0.0.0 node dist/index.js

Every /mcp request must send Authorization: Bearer <token>. Over HTTP, upload_file's file_path is disabled unless MANTIS_UPLOAD_DIR is set — use the content (Base64) parameter instead.

Health check: GET http://localhost:3456/health (always public, no token required)

Documentation

  • Cookbook — tool-oriented recipes with copy-paste-ready parameter examples for all registered tools
  • Usage Examples — natural language prompt examples for everyday use cases (no tool names required)

Development

npm run init         # First-time setup: install deps, git hooks, typecheck
npm run build        # Compile TypeScript → dist/
npm run typecheck    # Type check without output
npm run dev          # Watch mode for development
npm test             # Run tests (vitest)
npm run test:watch   # Run tests in watch mode
npm run test:coverage # Coverage report
npm run benchmark    # Token benchmark against a live MantisBT (see Token usage above)

License

MIT – see LICENSE

Contributing

Contributions welcome! Please read CONTRIBUTING.md. Repository: codeberg.org/dpesch/mantisbt-mcp-server

版本与发布记录

@dpesch/mantisbt-mcp-server 共发布 40 个版本,首次发布于 2026/03/15;过去 12 个月发布了 40 个版本。

版本发布日期距今
1.15.0latest2026/11/012 天前
1.14.12026/10/2410 天前
1.14.02026/09/281 个月前
1.13.02026/09/271 个月前
1.12.02026/08/292 个月前
1.11.02026/07/034 个月前

关于 @dpesch/mantisbt-mcp-server 的常见问题

@dpesch/mantisbt-mcp-server 是什么?

用于MantisBT REST API的MCP服务器-读取和管理错误跟踪器问题

如何安装 @dpesch/mantisbt-mcp-server?

在项目目录运行 npm install @dpesch/mantisbt-mcp-server,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 mantisbt-mcp-server,可以用 npx mantisbt-mcp-server 直接运行。

@dpesch/mantisbt-mcp-server 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/dpesch__mantisbt-mcp-server 是否存在。

@dpesch/mantisbt-mcp-server 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@dpesch/mantisbt-mcp-server 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@dpesch/mantisbt-mcp-server 可以商用吗?

@dpesch/mantisbt-mcp-server 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dpesch/mantisbt-mcp-server 还在维护吗?

最新版本 1.15.0 发布于 2026/11/01(2 天前);至今共发布 40 个版本,其中过去 12 个月发布了 40 个;首次发布于 2026/03/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。