MCP server exposing JetBrains TeamCity CI/CD workflows to AI coding assistants
io.github.Daghis/teamcity MCP Server
MCP server exposing JetBrains TeamCity CI/CD workflows to AI coding assistants. It provides Model Context Protocol (MCP) integration for automation and DevOps use cases, connecting CI and CD contexts to tooling in Node.js/TypeScript ecosystems.
π οΈ Key Features
Model Context Protocol (MCP) server
JetBrains TeamCity CI/CD workflow exposure to AI coding assistants
π Use Cases
CI automation with TeamCity
CD workflows for DevOps pipelines
Integrating TeamCity within MCP-based developer tooling
β‘ Developer Benefits
Topics include nodejs and typescript, indicating ecosystem alignment
Uses structured automation/DevOps integration via MCP
β οΈ Limitations
Provided description and excerpt do not specify available tools or exact MCP capabilities beyond exposing TeamCity workflows
A Model Control Protocol (MCP) server that bridges AI coding assistants with JetBrains TeamCity CI/CD server, exposing TeamCity operations as MCP tools.
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.
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.
# Clone the repository
git clone https://github.com/Daghis/teamcity-mcp.git
cd teamcity-mcp
# Install dependencies
npm install
# Configure environmentcp .env.example .env# Edit .env with your TeamCity URL and token# Run in development mode
npm run dev
npm Package
Run the MCP server via npx (requires Node 20.x). Set your TeamCity environment variables inline or via a .env in the working directory.
bash
# One-off run (inline envs)
TEAMCITY_URL="https://teamcity.example.com" \
TEAMCITY_TOKEN="<your_token>" \
MCP_MODE=dev \
npx -y @daghis/teamcity-mcp
# Or rely on .env in the current directory
npx -y @daghis/teamcity-mcp
Claude Code
Add the MCP (relying on .env for configuration):
claude mcp add teamcity -- npx -y @daghis/teamcity-mcp
Environment is validated centrally with Zod. Supported variables and defaults:
env
# Server Configuration
PORT=3000
NODE_ENV=development
LOG_LEVEL=info
# TeamCity Configuration (aliases supported)
TEAMCITY_URL=https://teamcity.example.com
TEAMCITY_TOKEN=your-auth-token
# Optional aliases:
# TEAMCITY_SERVER_URL=...
# TEAMCITY_API_TOKEN=...
# MCP Mode (dev or full)
MCP_MODE=dev
# Optional advanced TeamCity options (defaults shown)
# Connection
# TEAMCITY_TIMEOUT=30000
# TEAMCITY_MAX_CONCURRENT=10
# TEAMCITY_KEEP_ALIVE=true
# TEAMCITY_COMPRESSION=true
# Extra headers attached to every TeamCity request β useful when TeamCity
# sits behind a reverse proxy that gates access on custom headers (e.g.
# Cloudflare Zero Trust service tokens). One env var per header; the part
# after `TEAMCITY_HEADER_` is used verbatim as the HTTP header name.
# Example (note the literal hyphens β most shells need quoting):
# TEAMCITY_HEADER_CF-Access-Client-Id=<id>
# TEAMCITY_HEADER_CF-Access-Client-Secret=<secret>
# Retry
# TEAMCITY_RETRY_ENABLED=true
# TEAMCITY_MAX_RETRIES=3
# TEAMCITY_RETRY_DELAY=1000
# TEAMCITY_MAX_RETRY_DELAY=30000
# Pagination
# TEAMCITY_PAGE_SIZE=100
# TEAMCITY_MAX_PAGE_SIZE=1000
# TEAMCITY_AUTO_FETCH_ALL=false
# Circuit Breaker
# TEAMCITY_CIRCUIT_BREAKER=true
# TEAMCITY_CB_FAILURE_THRESHOLD=5
# TEAMCITY_CB_RESET_TIMEOUT=60000
# TEAMCITY_CB_SUCCESS_THRESHOLD=2
These values are normalized in src/config/index.ts and consumed by src/teamcity/config.ts via helper getters.
Usage Examples
Once integrated with your AI coding assistant:
code
"Build the frontend on feature branch"
"Why did last night's tests fail?"
"Deploy staging with the latest build"
"Create a new build config for the mobile app"
Tool Responses and Pagination
Responses: Tools now return consistent MCP content. For list/get operations, the content[0].text contains a JSON string. Example shape:
{ "items": [...], "pagination": { "page": 1, "pageSize": 100 } } or { "items": [...], "pagination": { "mode": "all", "pageSize": 100, "fetched": 250 } }.
Pagination: Most list_* tools accept pageSize, maxPages, and all:
pageSize controls items per page.
all: true fetches multiple pages up to maxPages.
Legacy count on list_builds is kept for compatibility but pageSize is preferred.
Validation and Errors
Input validation: Tool inputs are validated with Zod schemas; invalid input returns a structured error payload in the response content (JSON string) with success: false and error.code = VALIDATION_ERROR.
Error shaping: Errors are formatted consistently via a global handler. In production, messages may be sanitized; sensitive values (e.g., tokens) are redacted in logs.
API Usage
typescript
import { TeamCityAPI } from'@/api-client';
// Get the API client instanceconst api = TeamCityAPI.getInstance();
// List projectsconst projects = await api.listProjects();
// Get build statusconst build = await api.getBuild('BuildId123');
// Trigger a new buildconst newBuild = await api.triggerBuild('BuildConfigId', {
branchName: 'main',
});
Note: The legacy helpers exported from src/teamcity/index.ts remain only for compatibility and include placeholder implementations. Prefer the MCP tools (see the reference linked above) or the TeamCityAPI shown here when automating workflows.
Development
bash
# 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.