SuperAPI AI Directory

teamcity-mcp

JetBrains TeamCity: builds, tests, build agents and CI/CD pipeline management, with dev and full modes switchable at runtime.

Open website

About this tool

TeamCity MCP Server is a Model Context Protocol (MCP) server used to connect AI coding assistants with JetBrains TeamCity CI/CD servers, exposing TeamCity operations as MCP tools. Developers can operate TeamCity directly within AI coding assistants such as Claude Code, Cursor, and Windsurf.

Project status (June 2026): stable, low maintenance. The project has achieved its established goals and is no longer under active development. It still works and remains installable; issues and PRs may receive slow responses or no response, and security fixes are best-effort.

JetBrains officially now provides AI integration for TeamCity—built-in MCP and a TeamCity CLI with an installable agent skill, which is a better default for most workflows. Before adopting this project, please first understand how it compares with JetBrains' official tools.

Key capabilities

  1. Two operating modes

Dev mode (default): safe CI/CD operations, 31 tools, approximately 14k context tokens. Includes triggering builds and monitoring status, retrieving build logs and inspecting test failures, listing projects/configurations/queues, reading parameters, and troubleshooting issues.

Full mode: complete infrastructure management, 87 tools, approximately 26k context tokens. Includes all Dev mode features, plus creating and cloning build configurations, managing build steps/triggers/dependencies, configuring VCS roots and agents, full CRUD for parameters (build configurations, projects, output parameters), queue management, and server management.

Runtime mode switching (v2.1.0+): use the get_mcp_mode and set_mcp_mode tools to switch modes at runtime without restarting. MCP clients that support notifications will automatically see tool list updates. For the complete list of 87 tools and their availability in each mode, see Tools Mode Matrix.

  1. Key features
  • Trigger and monitor builds, retrieve logs, inspect test failures
  • Token-based TeamCity authentication; sensitive values are redacted from logs
  • Modern architecture: straightforward implementation using a singleton client
  • Performance-focused: fast startup, minimal overhead
  • Clean codebase with clear module boundaries

Comparison with JetBrains official tools

As of June 2026, JetBrains provides first-party AI integration for TeamCity: a built-in MCP endpoint and the TeamCity CLI (including an installable agent skill). This is the path recommended by JetBrains, covering common AI workflows—reading logs, diagnosing failures, rerunning builds—with no installation required and official support.

teamcity-mcp predates and overlaps with that tooling. Overall, the official tools are the better default today; teamcity-mcp's remaining advantage is exposing broader write and management operations as an MCP server. That gap is real but narrowing, and JetBrains' tooling is evolving rapidly. It is recommended to review the current documentation and choose the appropriate option: the TeamCity 2026.1 announcement (official AI integration overview), the AI agent integration documentation (built-in MCP), and the TeamCity CLI (terminal + agent-skill path).

How to use

Requirements: Node.js >= 20.10.0 (LTS 20, 22, 24 tested in CI); TeamCity Server 2020.1+ with accessible REST API; TeamCity authentication token.

Run the MCP server via npx (requires Node 20.x). You can set TeamCity environment variables inline, or use a .env in the working directory.

Add MCP (depends on .env configuration): claude mcp add teamcity -- npx -y @daghis/teamcity-mcp

With environment variables (if not using .env): claude mcp add teamcity -e TEAMCITY_URL="https://teamcity.example.com" -e TEAMCITY_TOKEN="tc_<your_token>" -- npx -y @daghis/teamcity-mcp

With CLI arguments (recommended for Windows): claude mcp add teamcity -- npx -y @daghis/teamcity-mcp --url "https://teamcity.example.com" --token "tc_<your_token>" --mode dev

Add -s user to install at the user level instead of the project level (default).

Context usage (Opus 4.1 estimate): Dev (default): MCP tools about 14k tokens; Full (MCP_MODE=full): MCP tools about 26k tokens.

On Windows, Claude Code's MCP configuration may not merge environment variables correctly. Use CLI arguments as a workaround, or use a configuration file for better security (the token will not appear in the process list). Environment variables are centrally validated via Zod, the supported variables and default values are normalized in src/config/index.ts, and are consumed by src/teamcity/config.ts through helper getters.

Tool responses and pagination: Tools now return consistent MCP content. For list/get operations, content[0].text contains a JSON string. Example shapes: { "items": [...], "pagination": { "page": 1, "pageSize": 100 } } or { "items": [...], "pagination": { "mode": "all", "pageSize": 100, "fetched": 250 } }. Most list_* tools accept pageSize, maxPages, and all: pageSize controls the number of entries per page; all: true fetches multiple pages up to maxPages. The legacy count parameter on list_builds is retained for compatibility, but pageSize is recommended.

Validation and errors: Tool inputs are validated using Zod schemas; invalid input returns a structured error payload in the response content (JSON string), with success: false and error.code = VALIDATION_ERROR. Errors are consistently formatted by a global handler. In production, messages may be sanitized; sensitive values (such as tokens) are redacted in logs. Note: legacy helper functions exported from src/teamcity/index.ts are retained only for compatibility and include placeholder implementations. Sinceautomating workflows, prefer using the MCP tools or the TeamCityAPI shown here.

API Documentation and Tools

The server exposes MCP tools for TeamCity operations, each corresponding to a specific TeamCity REST API endpoint.

Build management related tools: TriggerBuild (queue a new build), GetBuildStatus (check build progress), FetchBuildLog (get the build log), ListBuilds (search builds by criteria), ListTestFailures (get failed tests), GetTestDetails (test details), AnalyzeBuildProblems (identify failure causes).

Configuration management (Full mode only):

  • create_build_config: create a new TeamCity build configuration, with full support for VCS roots (Git, SVN, Perforce, with authentication), build steps (script, Maven, Gradle, npm, Docker, PowerShell), triggers (VCS, schedule, finish-build, maven-snapshot), parameters, and template-based configurations.
  • clone_build_config: copy an existing configuration to any project, preserving steps, triggers, and parameters.
  • update_build_config: adjust a configuration's name, description, artifact rules, and paused status.
  • manage_build_steps: add, update, delete, or reorder build steps through a single tool interface.
  • manage_build_triggers: add or remove build triggers, with full property support.
  • create_vcs_root and add_vcs_root_to_build: define a VCS root and attach it to a build configuration.

See also docs/TEAMCITY_MCP_TOOLS_GUIDE.md for extended workflows and examples consistent with the current MCP implementation.

Security Considerations

Token management: configure TEAMCITY_TOKEN via environment variables or a configuration file (see .env.example); never commit real tokens. Use a token with the minimum necessary permissions; read-only tokens can be used for most Dev Mode operation. Only token-based authentication is supported; the MCP server does not support username/password. Logs redact sensitive values including tokens. Prefer Dev mode unless explicitly needed—this limits the impact of any misconfiguration or prompt injection. Full mode enables destructive operations (project deletion, agent management) that are difficult to undo easily.

Network security: Always use HTTPS for TeamCity connections; the server does not enforce this but strongly recommends it. The MCP server only connects to the configured TeamCity URL and makes no other network calls.

Notes for AI assistants: AI assistants may be manipulated through prompt injection in build logs, test output, or other TeamCity data. Dev mode's limited toolset reduces the impact of such attacks. All operations appear in the TeamCity audit log, attributed to the user associated with the token. Build logs and test failure details may contain sensitive information (secrets, paths, internal URLs) that will be visible to the AI assistant.

Repository security: Enable GitHub secret scanning and push protection. See SECURITY.md for vulnerability reporting.

Contributing and acknowledgments

Contributions are welcome; see CONTRIBUTING.md for details. Feedback is provided through GitHub Issues: report bugs or request features. See the docs/ folder in the repository for documentation.

Acknowledgments: JetBrains TeamCity for providing an excellent CI/CD platform; Anthropic for the Model Control Protocol specification; the open source community for its continued support. See THIRD_PARTY_NOTICES.md for third-party licenses.

This project is built for developers who enjoy efficient CI/CD workflows.