Enables natural language control of JetBrains TeamCity CI/CD server, allowing users to trigger builds, monitor build status, fetch logs, analyze test failures, create build configurations, manage build steps and triggers, and configure VCS roots and agents.
TeamCity MCP Server
A Model Control Protocol (MCP) server that bridges AI coding assistants with JetBrains TeamCity CI/CD server, enabling natural language control of builds, tests, and deployments.
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 using natural language commands.
Features
🚀 Two Operational Modes
- Dev Mode: Safe CI/CD operations
- Trigger builds
- Monitor build status and progress
- Fetch and analyze build logs
- Investigate test failures
- List projects and configurations
- Full Mode: Complete infrastructure management
- All Dev mode features, plus:
- Create and clone build configurations
- Manage build steps and triggers
- Configure VCS roots and agents
- Set up new projects
- Modify infrastructure settings
🎯 Key Capabilities
- Natural Language Control: Execute CI/CD tasks using conversational commands
- Intelligent Analysis: Automatic test failure summarization and build problem identification
- Real-time Monitoring: Live build status updates via WebSocket/SSE
- Enterprise Security: Token-based authentication with audit logging
- Modern Architecture: Simple, direct implementation with singleton pattern
- Performance Optimized: Fast startup time with minimal overhead
- Clean Codebase: Well-organized modules with clear separation of concerns
Installation
Prerequisites
- Node.js >= 24.0.0
- TeamCity Server 2020.1+ with REST API access
- TeamCity authentication token
Quick Start
npm Package (Coming Soon)
Configuration
Environment is validated centrally with Zod. Supported variables and defaults:
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:
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
, andall
:pageSize
controls items per page.all: true
fetches multiple pages up tomaxPages
.- Legacy
count
onlist_builds
is kept for compatibility butpageSize
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
anderror.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
Development
Project Structure
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 buildGetBuildStatus
- Check build progressFetchBuildLog
- Retrieve build logsListBuilds
- Search builds by criteria
Test Analysis
ListTestFailures
- Get failing testsGetTestDetails
- Detailed test informationAnalyzeBuildProblems
- 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 Tool Reference for details: docs/mcp-tools-reference.md
CloneBuildConfig
- Duplicate configurations (coming soon)ManageBuildSteps
- Add/edit/remove steps (coming soon)ManageVCS
- Configure version control (coming soon)
See also: docs/TEAMCITY_MCP_TOOLS_GUIDE.md
for an overview. Some advanced sections in that guide describe future enhancements; the behavior above reflects the current implementation.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for details.
Security
- Configure
TEAMCITY_TOKEN
via environment (see.env.example
); never commit real tokens - Token-based authentication only
- Logs redact sensitive values
Support
- GitHub Issues: Report bugs or request features
- Documentation: See the
docs/
folder in this repository
Acknowledgments
- JetBrains TeamCity for the excellent CI/CD platform
- Anthropic for the Model Control Protocol specification
- The open-source community for continuous support
Built with ❤️ for developers who love efficient CI/CD workflows
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables AI coding assistants to interact with JetBrains TeamCity CI/CD server through natural language commands. Supports triggering builds, monitoring status, analyzing test failures, and managing build configurations directly from development environments.