A Model Control Protocol (MCP) server that bridges AI coding assistants with JetBrains TeamCity CI/CD server, exposing TeamCity operations as MCP tools. 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. - Dev Mode (default): Safe CI/CD operations (31 tools
Add this skill
npx mdskills install Daghis/teamcity-mcpComprehensive TeamCity integration with 87 tools, dual operational modes, and excellent documentation
A Model Control Protocol (MCP) server that bridges AI coding assistants with JetBrains TeamCity CI/CD server, exposing TeamCity operations as MCP tools.
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=fullor use runtime mode switching (v2.1.0+). See CHANGELOG.md for details.
Dev Mode (default): Safe CI/CD operations (31 tools, ~14k context tokens)
Full Mode: Complete infrastructure management (87 tools, ~26k context tokens)
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.
# Clone the repository
git clone https://github.com/Daghis/teamcity-mcp.git
cd teamcity-mcp
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env with your TeamCity URL and token
# Run in development mode
npm run dev
Run the MCP server via npx (requires Node 20.x). Set your TeamCity environment variables inline or via a .env in the working directory.
# One-off run (inline envs)
TEAMCITY_URL="https://teamcity.example.com" \
TEAMCITY_TOKEN="" \
MCP_MODE=dev \
npx -y @daghis/teamcity-mcp
# Or rely on .env in the current directory
npx -y @daghis/teamcity-mcp
.env for configuration):
claude mcp add teamcity -- npx -y @daghis/teamcity-mcpclaude mcp add teamcity -e TEAMCITY_URL="https://teamcity.example.com" -e TEAMCITY_TOKEN="tc_" -- npx -y @daghis/teamcity-mcpclaude mcp add teamcity -- npx -y @daghis/teamcity-mcp --url "https://teamcity.example.com" --token "tc_" --mode dev-s user to install user-wide instead of project-scoped (default)MCP_MODE=full): ~26k tokens for MCP toolsOn Windows, Claude Code's MCP configuration may not properly merge environment variables. Use CLI arguments as a workaround:
{
"mcpServers": {
"teamcity": {
"command": "npx",
"args": ["-y", "@daghis/teamcity-mcp", "--url", "https://teamcity.example.com", "--token", "YOUR_TOKEN"]
}
}
}
Or use a config file for better security (token not visible in process list):
{
"mcpServers": {
"teamcity": {
"command": "npx",
"args": ["-y", "@daghis/teamcity-mcp", "--config", "C:\\path\\to\\teamcity.env"]
}
}
}
Environment is validated centrally with Zod. Supported variables and defaults:
# 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
# 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.
Once integrated with your AI coding assistant:
"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"
content[0].text contains a JSON string. Example shape:
{ "items": [...], "pagination": { "page": 1, "pageSize": 100 } } or { "items": [...], "pagination": { "mode": "all", "pageSize": 100, "fetched": 250 } }.pageSize, maxPages, and all:
pageSize controls items per page.all: true fetches multiple pages up to maxPages.count on list_builds is kept for compatibility but pageSize is preferred.success: false and error.code = VALIDATION_ERROR.import { TeamCityAPI } from '@/api-client';
// Get the API client instance
const api = TeamCityAPI.getInstance();
// List projects
const projects = await api.listProjects();
// Get build status
const build = await api.getBuild('BuildId123');
// Trigger a new build
const newBuild = await api.triggerBuild('BuildConfigId', {
branchName: 'main',
});
Note: The legacy helpers exported from
src/teamcity/index.tsremain only for compatibility and include placeholder implementations. Prefer the MCP tools (see the reference linked above) or theTeamCityAPIshown here when automating workflows.
# 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
The CI workflow runs npm run build:bundle and uploads the generated coverage/bundles JSON using codecov/codecov-action with the javascript-bundle plugin.
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
The MCP server exposes tools for TeamCity operations. Each tool corresponds to specific TeamCity REST API endpoints:
TriggerBuild - Queue a new buildGetBuildStatus - Check build progressFetchBuildLog - Retrieve build logsListBuilds - Search builds by criteriaListTestFailures - Get failing testsGetTestDetails - Detailed test informationAnalyzeBuildProblems - Identify failure reasonscreate_build_config - Create new TeamCity build configurations with full support for:
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.
We welcome contributions! Please see CONTRIBUTING.md for details.
TEAMCITY_TOKEN via environment variable or config file (see .env.example); never commit real tokensThis repository has GitHub secret scanning and push protection enabled. See SECURITY.md for vulnerability reporting.
docs/ folder in this repositoryBuilt with β€οΈ for developers who love efficient CI/CD workflows
Install via CLI
npx mdskills install Daghis/teamcity-mcpTeamCity MCP Server is a free, open-source AI agent skill. A Model Control Protocol (MCP) server that bridges AI coding assistants with JetBrains TeamCity CI/CD server, exposing TeamCity operations as MCP tools. 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. - Dev Mode (default): Safe CI/CD operations (31 tools
Install TeamCity MCP Server with a single command:
npx mdskills install Daghis/teamcity-mcpThis downloads the skill files into your project and your AI agent picks them up automatically.
TeamCity MCP Server works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.