Labsco
nulab logo

Backlog MCP Server

โ˜… 211

from nulab

Interact with the Backlog API to manage projects, issues, wikis, git repositories, and more.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

Backlog MCP Server

MIT License Build Last Commit

๐Ÿ“˜ ๆ—ฅๆœฌ่ชžใงใฎใ”ๅˆฉ็”จใ‚ฌใ‚คใƒ‰

A Model Context Protocol (MCP) server for interacting with the Backlog API. This server provides tools for managing projects, issues, wiki pages, and more in Backlog through AI agents like Claude Desktop / Cline / Cursor etc.

Features

  • Project tools (create, read, update, delete)
  • Issue tracking and comments (create, update, delete, list)
  • Version/Milestone management (create, read, update, delete)
  • Wiki page support
  • Git repository and pull request tools
  • Notification tools
  • GraphQL-style field selection for optimized responses
  • Token limiting for large responses

Available Tools

Toolset: space

Tools for managing Backlog space settings and general information.

  • get_space: Returns information about the Backlog space.
  • get_users: Returns list of users in the Backlog space.
  • get_myself: Returns information about the authenticated user.

Toolset: project

Tools for managing projects, categories, custom fields, and issue types.

  • get_project_list: Returns list of projects.
  • add_project: Creates a new project.
  • get_project: Returns information about a specific project.
  • update_project: Updates an existing project.
  • delete_project: Deletes a project.

Toolset: issue

Tools for managing issues, their comments, and related items like priorities, categories, custom fields, issue types, resolutions, and watching lists.

  • get_issue: Returns information about a specific issue.
  • get_issues: Returns list of issues.
  • count_issues: Returns count of issues.
  • add_issue: Creates a new issue in the specified project.
  • update_issue: Updates an existing issue.
  • delete_issue: Deletes an issue.
  • get_issue_comments: Returns list of comments for an issue.
  • add_issue_comment: Adds a comment to an issue.
  • get_priorities: Returns list of priorities.
  • get_categories: Returns list of categories for a project.
  • get_custom_fields: Returns list of custom fields for a project.
  • get_issue_types: Returns list of issue types for a project.
  • get_resolutions: Returns list of issue resolutions.
  • get_watching_list_items: Returns list of watching items for a user.
  • get_watching_list_count: Returns count of watching items for a user.
  • add_watching: Adds a new watch to an issue.
  • update_watching: Updates an existing watch note.
  • delete_watching: Deletes a watch from an issue.
  • mark_watching_as_read: Marks a watch as read.
  • get_version_milestone_list: Returns list of version milestones for a project.
  • add_version_milestone: Creates a new version milestone for a project.
  • update_version_milestone: Updates an existing version milestone.
  • delete_version_milestone: Deletes a version milestone.

Toolset: wiki

Tools for managing wiki pages.

  • get_wiki_pages: Returns list of Wiki pages.
  • get_wikis_count: Returns count of wiki pages in a project.
  • get_wiki: Returns information about a specific wiki page.
  • add_wiki: Creates a new wiki page.

Toolset: git

Tools for managing Git repositories and pull requests.

  • get_git_repositories: Returns list of Git repositories for a project.
  • get_git_repository: Returns information about a specific Git repository.
  • get_pull_requests: Returns list of pull requests for a repository.
  • get_pull_requests_count: Returns count of pull requests for a repository.
  • get_pull_request: Returns information about a specific pull request.
  • add_pull_request: Creates a new pull request.
  • update_pull_request: Updates an existing pull request.
  • get_pull_request_comments: Returns list of comments for a pull request.
  • add_pull_request_comment: Adds a comment to a pull request.
  • update_pull_request_comment: Updates a comment on a pull request.

Toolset: notifications

Tools for managing user notifications.

  • get_notifications: Returns list of notifications.
  • get_notifications_count: Returns count of notifications.
  • reset_unread_notification_count: Resets unread notification count.
  • mark_notification_as_read: Marks a notification as read.

Toolset: document

Tools for managing documents and document trees in Backlog projects.

  • get_document_tree: Returns the hierarchical tree of documents for a project, including folders and ne
  • get_documents: Returns a flat list of documents in a project or folder.
  • get_document: Returns detailed information about a specific document, including metadata, content, an

Advanced Features

Tool Name Prefixing

Add prefix to tool names with:

Copy & paste โ€” that's it
--prefix backlog_

or via environment variable:

Copy & paste โ€” that's it
PREFIX="backlog_"

This is especially useful if you're using multiple MCP servers or tools in the same environment and want to avoid name collisions. For example, get_project can become backlog_get_project to distinguish it from similarly named tools provided by other services.

Response Optimization & Token Limits

Field Selection (GraphQL-style)

Copy & paste โ€” that's it
--optimize-response

Or environment variable:

Copy & paste โ€” that's it
OPTIMIZE_RESPONSE=1

Then, request only specific fields:

Copy & paste โ€” that's it
get_project(projectIdOrKey: "PROJECT-KEY", fields: "{ name key description }")

The AI will use field selection to optimize the response:

Copy & paste โ€” that's it
get_project(projectIdOrKey: "PROJECT-KEY", fields: "{ name key description }")

Benefits:

  • Reduce response size by requesting only needed fields
  • Focus on specific data points
  • Improve performance for large responses

Token Limiting

Large responses are automatically limited to prevent exceeding token limits:

  • Default limit: 50,000 tokens
  • Configurable via MAX_TOKENS environment variable
  • Responses exceeding the limit are truncated with a message

You can change this using:

Copy & paste โ€” that's it
MAX_TOKENS=10000

If a response exceeds the limit, it will be truncated with a warning.

Note: This is a best-effort mitigation, not a guaranteed enforcement.

Full Custom Configuration Example

This section demonstrates advanced configuration using multiple environment variables. These are experimental features and may not be supported across all MCP clients. This is not part of the MCP standard specification and should be used with caution.

Copy & paste โ€” that's it
{
  "mcpServers": {
    "backlog": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "BACKLOG_DOMAIN",
        "-e",
        "BACKLOG_API_KEY",
        "-e",
        "MAX_TOKENS",
        "-e",
        "OPTIMIZE_RESPONSE",
        "-e",
        "PREFIX",
        "-e",
        "ENABLE_TOOLSETS",
        "ghcr.io/nulab/backlog-mcp-server"
      ],
      "env": {
        "BACKLOG_DOMAIN": "your-domain.backlog.com",
        "BACKLOG_API_KEY": "your-api-key",
        "MAX_TOKENS": "10000",
        "OPTIMIZE_RESPONSE": "1",
        "PREFIX": "backlog_",
        "ENABLE_TOOLSETS": "space,project,issue",
        "ENABLE_DYNAMIC_TOOLSETS": "1"
      }
    }
  }
}

Development

Running Tests

Copy & paste โ€” that's it
pnpm test

Adding New Tools

  1. Create a new file in src/tools/ following the pattern of existing tools
  2. Create a corresponding test file
  3. Add the new tool to src/tools/tools.ts
  4. Build and test your changes

Command Line Options

The server supports several command line options:

  • --transport stdio|http: MCP transport (default: stdio). Use http for Streamable HTTP.
  • --http-host, --http-port, --http-path: HTTP bind address, port, and path (defaults: 127.0.0.1, 3333, /mcp).
  • --http-json-response: Prefer JSON responses over SSE when the transport supports it.
  • --http-allowed-hosts: Comma-separated allowed Host headers when binding to all interfaces.
  • --export-translations: Export all translation keys and values
  • --optimize-response: Enable GraphQL-style field selection
  • --max-tokens=NUMBER: Set maximum token limit for responses
  • --prefix=STRING: Optional string prefix to prepend to all tool names (default: "")
  • --enable-toolsets <toolsets...>: Specify which toolsets to enable (comma-separated or multiple arguments). Defaults to "all". Example: --enable-toolsets space,project or --enable-toolsets issue --enable-toolsets git Available toolsets: space, project, issue, wiki, git, notifications.

Example:

Copy & paste โ€” that's it
node build/index.js --optimize-response --max-tokens=100000 --prefix="backlog_" --enable-toolsets space,issue

HTTP example:

Copy & paste โ€” that's it
node build/index.js --transport http --http-port 3333 --http-path /mcp

Multi-Organization Support

This server can be configured to access multiple Backlog organizations from a single MCP server instance.

Configuration

Configure one env pair per organization and set a default organization:

Copy & paste โ€” that's it
BACKLOG_DEFAULT_ORG=COMPANY_A
BACKLOG_ORG_COMPANY_A_DOMAIN=company-a.backlog.com
BACKLOG_ORG_COMPANY_A_API_KEY=your-company-a-api-key
BACKLOG_ORG_COMPANY_B_DOMAIN=company-b.backlog.com
BACKLOG_ORG_COMPANY_B_API_KEY=your-company-b-api-key

This works whether the variables come from a local .env, your shell environment, or an MCP client config env block.

Example MCP config:

Copy & paste โ€” that's it
{
  "env": {
    "BACKLOG_DEFAULT_ORG": "COMPANY_A",
    "BACKLOG_ORG_COMPANY_A_DOMAIN": "company-a.backlog.com",
    "BACKLOG_ORG_COMPANY_A_API_KEY": "your-company-a-api-key",
    "BACKLOG_ORG_COMPANY_B_DOMAIN": "company-b.backlog.com",
    "BACKLOG_ORG_COMPANY_B_API_KEY": "your-company-b-api-key"
  }
}

If no multi-organization env vars are set, the server falls back to the existing single-organization configuration:

Copy & paste โ€” that's it
BACKLOG_DOMAIN=your-domain.backlog.com
BACKLOG_API_KEY=your-api-key

Tool Usage

All normal tools accept an optional organization input field. When provided, the tool call is routed to that Backlog organization.

Examples:

Copy & paste โ€” that's it
{
  "organization": "COMPANY_B",
  "projectKey": "PROJECT"
}

If organization is omitted:

  • the organization named by BACKLOG_DEFAULT_ORG is used
  • if multi-organization env vars are present and BACKLOG_DEFAULT_ORG is missing, the server fails at startup

Organization Discovery

The server provides a list_organizations tool that returns the configured organization names, their domains, and which one is the default.

Example response:

Copy & paste โ€” that's it
[
  {
    "name": "COMPANY_A",
    "domain": "company-a.backlog.com",
    "isDefault": true
  },
  {
    "name": "COMPANY_B",
    "domain": "company-b.backlog.com",
    "isDefault": false
  }
]

Notes

  • For multi-org mode, every organization must define both BACKLOG_ORG_<NAME>_DOMAIN and BACKLOG_ORG_<NAME>_API_KEY.
  • The <NAME> part is the organization name exposed through the organization tool input and list_organizations.

License

This project is licensed under the MIT License.

Please note: This tool is provided under the MIT License without any warranty or official support.
Use it at your own risk after reviewing the contents and determining its suitability for your needs.
If you encounter any issues, please report them via GitHub Issues.