Labsco
Daghis logo

TeamCity MCP Server

β˜… 25

from Daghis

MCP server for JetBrains TeamCity with 87 tools for builds, tests, agents, and CI/CD pipeline management.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

TeamCity MCP Server

A Model Control Protocol (MCP) server that bridges AI coding assistants with JetBrains TeamCity CI/CD server, exposing TeamCity operations as MCP tools.

TeamCity Server MCP server

[!NOTE] Project status (June 2026): stable, low-key maintenance. This does what it set out to do and is no longer under active development. It still works and stays installable; issues and PRs may get slow or no response, and security fixes are best-effort.

JetBrains now ships official AI integration for TeamCity β€” a built-in MCP and the TeamCity CLI with an installable agent skill β€” which is the better default for most workflows. See How this compares to JetBrains' official tooling below before adopting.

Overview

The TeamCity MCP Server allows developers using AI-powered coding assistants (Claude Code, Cursor, Windsurf) to interact with TeamCity directly from their development environment via MCP tools.

Upgrading from 1.x? Version 2.0.0 moved 15 tools from Dev to Full mode, including queue management, agent compatibility checks, and server health monitoring. If you relied on these tools in Dev mode, switch to MCP_MODE=full or use runtime mode switching (v2.1.0+). See CHANGELOG.md for details.

Features

πŸš€ Two Operational Modes

  • Dev Mode (default): Safe CI/CD operations (31 tools, ~14k context tokens)

    • Trigger builds and monitor status
    • Fetch build logs and inspect test failures
    • List projects, configurations, and queue
    • Read parameters and investigate problems
  • Full Mode: Complete infrastructure management (87 tools, ~26k context tokens)

    • All Dev mode features, plus:
    • Create and clone build configurations
    • Manage build steps, triggers, and dependencies
    • Configure VCS roots and agents
    • Full CRUD for parameters (build config, project, and output parameters)
    • Queue management and server administration

Runtime Mode Switching (v2.1.0+): Switch between modes at runtime using the get_mcp_mode and set_mcp_mode toolsβ€”no restart required. MCP clients that support notifications will see the tool list update automatically.

See the Tools Mode Matrix for the complete list of 87 tools and their availability by mode.

🎯 Key Capabilities

  • Trigger and monitor builds, fetch logs, and inspect test failures
  • Token-based authentication to TeamCity; sensitive values redacted in logs
  • Modern architecture: simple, direct implementation with a singleton client
  • Performance-conscious: fast startup with minimal overhead
  • Clean codebase with clear module boundaries

How this compares to JetBrains' official tooling

As of June 2026, JetBrains ships first-party AI integration for TeamCity: a built-in MCP endpoint and the TeamCity CLI, which includes an installable agent skill. Together these are JetBrains' recommended path and cover the common AI workflows β€” reading logs, diagnosing failures, and rerunning builds β€” with no install and official support.

teamcity-mcp predates that tooling and overlaps with it. Broadly, the official tooling is the better default today; teamcity-mcp's remaining edge is a broader set of write and management operations exposed as an MCP server. That gap is real but narrowing, and JetBrains' tooling is evolving quickly β€” so rather than pin down a feature-by-feature comparison here (it would go stale fast), check the current docs and pick what fits:

If you're comfortable with JetBrains' CLI, you may not need this project at all. It stays MIT-licensed and installable for whatever the built-ins don't yet reach β€” fork it if you want to take it further yourself.

Development

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Lint code
npm run lint

# Format code
npm run format

# Type check
npm run typecheck

# Build for production
npm run build

# Analyze bundle for Codecov
npm run build:bundle

Bundle analysis in CI

The CI workflow runs npm run build:bundle and uploads the generated coverage/bundles JSON using codecov/codecov-action with the javascript-bundle plugin.

Project Structure

teamcity-mcp/
β”œβ”€β”€ src/                    # Source code
β”‚   β”œβ”€β”€ tools.ts           # All 87 MCP tool definitions
β”‚   β”œβ”€β”€ server.ts          # MCP server setup
β”‚   β”œβ”€β”€ api-client.ts      # TeamCity API singleton
β”‚   β”œβ”€β”€ config/            # Configuration with Zod validation
β”‚   β”œβ”€β”€ teamcity/          # Domain logic (build, agent, config managers)
β”‚   β”œβ”€β”€ teamcity-client/   # Auto-generated OpenAPI client
β”‚   β”œβ”€β”€ types/             # TypeScript type definitions
β”‚   └── utils/             # Logger, MCP helpers, pagination
β”œβ”€β”€ tests/                  # Unit and integration tests
β”œβ”€β”€ docs/                   # Documentation
└── scripts/                # Build and maintenance scripts

API Documentation

The MCP server exposes tools for TeamCity operations. Each tool corresponds to specific TeamCity REST API endpoints:

Build Management

  • TriggerBuild - Queue a new build
  • GetBuildStatus - Check build progress
  • FetchBuildLog - Retrieve build logs
  • ListBuilds - Search builds by criteria

Test Analysis

  • ListTestFailures - Get failing tests
  • GetTestDetails - Detailed test information
  • AnalyzeBuildProblems - Identify failure reasons

Configuration (Full Mode Only)

  • create_build_config - Create new TeamCity build configurations 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
    • See the MCP Tool Reference for argument details and additional options.
  • clone_build_config - Duplicate existing configurations into any project, preserving steps, triggers, and parameters.
  • update_build_config - Adjust names, descriptions, artifact rules, and pause state for a configuration.
  • manage_build_steps - Add, update, remove, or reorder build steps through a single tool surface.
  • manage_build_triggers - Add or delete build triggers with full property support.
  • create_vcs_root & add_vcs_root_to_build - Define VCS roots and attach them to build configurations.

See also: docs/TEAMCITY_MCP_TOOLS_GUIDE.md for expanded workflows and examples that align with the current MCP implementation.

Security

Token Management

  • Configure TEAMCITY_TOKEN via environment variable or config file (see .env.example); never commit real tokens
  • Use a token with minimal required permissions; read-only tokens work for most Dev mode operations
  • Token-based authentication only; the MCP server does not support username/password
  • Logs redact sensitive values including tokens

Mode Selection

  • Prefer Dev mode unless Full mode is explicitly neededβ€”this limits the blast radius of any misconfiguration or prompt injection
  • Full mode enables destructive operations (project deletion, agent management) that cannot be easily undone

Network Security

  • Always use HTTPS for TeamCity connections; the server does not enforce this but strongly recommends it
  • The MCP server connects only to the configured TeamCity URL; no other network calls are made

AI Assistant Considerations

  • AI assistants could be manipulated via prompt injection in build logs, test output, or other TeamCity data
  • Dev mode's limited tool set reduces the impact of such attacks
  • All actions appear in TeamCity's audit log under the token's associated user
  • Build logs and test failure details may contain sensitive information (secrets, paths, internal URLs) that become visible to the AI assistant

Repository Security

This repository has GitHub secret scanning and push protection enabled. See SECURITY.md for vulnerability reporting.

Support