Enables running the MCP server as a containerized application, with support for environment variable configuration and Docker Compose deployment.
Provides deployment options for Kubernetes environments, including Helm chart support for configuring and managing the MCP server in cluster environments.
Exposes metrics for monitoring server performance and operations through a dedicated metrics endpoint compatible with Prometheus.
Exposes JetBrains TeamCity as structured resources and tools for managing builds, including triggering, canceling, and pinning builds, setting tags, downloading artifacts, and performing advanced build searches with comprehensive filtering options.
TeamCity MCP Server
A comprehensive Model Context Protocol (MCP) server that exposes JetBrains TeamCity as structured AI-ready resources and tools for LLM agents and IDE plugins.
Quick Start
IDE Integration (Cursor)
The TeamCity MCP server is designed to work seamlessly with AI-powered IDEs like Cursor. Here's how to configure it:
Cursor Configuration
Add this to your Cursor MCP settings:
Local Development
1. Build the Server
2. Set Environment Variables
3. Run the Server
4. Test the Server
Expected result: Health endpoint should return {"status":"ok"}
and MCP endpoint should return initialization response.
Features
- MCP Protocol Compliance: Full JSON-RPC 2.0 over HTTP/WebSocket support
- TeamCity Integration: Complete REST API integration with authentication
- Resource Access: Projects, build types, builds, agents, and artifacts
- Build Operations: Trigger, cancel, pin builds, set tags, download artifacts, search builds
- Advanced Search: Comprehensive build search with multiple filters (status, branch, user, dates, tags)
- Production Ready: Docker, Kubernetes, monitoring, caching, and comprehensive logging
- Environment-Based Configuration: No config files needed, everything via environment variables
Environment Variables Reference
Required Variables
Variable | Description | Example |
---|---|---|
TC_URL | TeamCity server URL | https://teamcity.company.com |
SERVER_SECRET | HMAC secret for client authentication (optional) | my-secure-secret-123 |
Authentication Variables
Variable | Description | Example |
---|---|---|
TC_TOKEN | TeamCity API token | eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9... |
Optional Variables
Variable | Default | Description | Example |
---|---|---|---|
LISTEN_ADDR | :8123 | Server listen address | :8080 or 0.0.0.0:8123 |
TC_TIMEOUT | 30s | TeamCity API timeout | 60s or 2m |
TLS_CERT | Path to TLS certificate | /path/to/cert.pem | |
TLS_KEY | Path to TLS private key | /path/to/key.pem | |
LOG_LEVEL | info | Log level | debug , info , warn , error |
LOG_FORMAT | json | Log format | json or console |
CACHE_TTL | 10s | Cache TTL for API responses | 30s or 1m |
Configuration Examples
Development Environment
Production Environment
Docker Deployment
Build and Run
Docker Compose
Kubernetes Deployment
Using Helm
Manual Kubernetes Deployment
Command Line Options
Flag | Description | Default |
---|---|---|
--help | Show environment variable help | |
--version | Show version information | |
--transport | Transport mode: http or stdio | http |
Help and Documentation
Testing and Verification
Automated Verification
Use the included verification script to test all functionality:
Manual Testing
Development Testing
Available Make Commands
Use make help
to see all available commands:
MCP Protocol Testing
Initialize MCP Session
List Resources
List Tools
Available Tools
The TeamCity MCP server provides 6 powerful tools for managing builds:
1. trigger_build
Trigger a new build in TeamCity.
Parameters:
buildTypeId
(required): Build configuration IDbranchName
(optional): Branch name to buildproperties
(optional): Build properties object
Example:
2. cancel_build
Cancel a running build.
Parameters:
buildId
(required): Build ID to cancelcomment
(optional): Cancellation comment
Example:
3. pin_build
Pin or unpin a build to prevent it from being cleaned up.
Parameters:
buildId
(required): Build ID to pin/unpinpin
(required): true to pin, false to unpincomment
(optional): Pin comment
Example:
4. set_build_tag
Add or remove tags from a build.
Parameters:
buildId
(required): Build IDtags
(optional): Array of tags to addremoveTags
(optional): Array of tags to remove
Example:
5. download_artifact
Download build artifacts.
Parameters:
buildId
(required): Build IDartifactPath
(required): Path to the artifact
Example:
6. search_builds
Search for builds with comprehensive filtering options.
Parameters (all optional):
buildTypeId
: Filter by build configuration IDstatus
: Filter by build status (SUCCESS, FAILURE, ERROR, UNKNOWN)state
: Filter by build state (queued, running, finished)branch
: Filter by branch nameagent
: Filter by agent nameuser
: Filter by user who triggered the buildsinceBuild
: Search builds since this build IDsinceDate
: Search builds since this date (YYYYMMDDTHHMMSS+HHMM)untilDate
: Search builds until this date (YYYYMMDDTHHMMSS+HHMM)tags
: Array of tags to filter bypersonal
: Include personal builds (boolean)pinned
: Filter by pinned status (boolean)count
: Maximum number of builds to return (1-1000, default: 100)
Examples:
Search for failed builds:
Search for recent builds on main branch:
Search for builds with specific tags:
Local Binary Configuration
If you prefer to use the local binary instead of Docker:
Usage in Cursor
Once configured, you can use natural language commands like:
- "Search for failed builds in the last week"
- "Trigger a build for the main branch"
- "Show me recent builds for project X"
- "Pin the latest successful build"
- "Cancel the running build 12345"
- "Add a release tag to build 12345"
The AI will automatically use the appropriate TeamCity tools to fulfill your requests.
Available Resources
The server exposes TeamCity data as MCP resources:
teamcity://projects
- List all projectsteamcity://buildTypes
- List all build configurationsteamcity://builds
- List recent buildsteamcity://agents
- List build agents
Troubleshooting
Common Issues
- Missing required environment variablesSolution: Set all required environment variables
- Authentication failuresSolution: Set
TC_TOKEN
with your TeamCity API token - Invalid timeout formatSolution: Use valid duration format like
30s
,1m
,2h
- Port already in useSolution: Set
LISTEN_ADDR
to a different port or stop the conflicting service
Debug Mode
Enable debug logging:
Health Check
The server provides a health endpoint:
Metrics
Prometheus metrics are available:
TeamCity Integration Testing
Verify TeamCity connectivity:
Protocol Reference
See Protocol.md for detailed MCP protocol implementation and TeamCity API mapping.
License
MIT License - see LICENSE for details.
This server cannot be installed
Once configured, you can use natural language commands like:
"Search for failed builds in the last week" "Why last deploy was failed" "Search the most failed builds" "Trigger a build for the main branch" "Show me recent builds for project X" "Pin the latest successful build" "Cancel the running bui
Related MCP Servers
- AsecurityAlicenseAquality🍎 Build iOS Xcode workspace/project and feed back errors to llm.Last updated -269PythonMIT License
- -securityAlicense-qualityEnable Claude (or any other LLM) to interactively debug your code (set breakpoints and evaluate expressions in stack frame). It's language-agnostic, assuming debugger console support and valid launch.json for debugging in VSCode.Last updated -384TypeScriptMIT License
- AsecurityAlicenseAqualityEnables users to interact with GitHub's Projects v2 API through natural language for Agile project management, supporting repository details, issue tracking, and project board management operations.Last updated -3129TypeScriptGPL 2.0
- -securityAlicense-qualityConnects to Xcode's build system to extract, parse, and display errors and warnings from your Swift projects, helping AI assistants quickly identify code issues without manually searching through build logs.Last updated -4PythonMIT License