TeamCity MCP Server

TeamCity MCP Server

Enables management of TeamCity CI/CD operations through natural language commands, including builds, projects, tests, artifacts, and more.

Category
Visit Server

README

TeamCity MCP Server

A TypeScript implementation of the TeamCity MCP (Model Context Protocol) server, providing seamless integration with Claude Desktop and Claude Code through natural language. Manage your TeamCity CI/CD operations using simple, conversational commands.

šŸŽÆ MCP Protocol Compliant | šŸš€ Single Tool Architecture

Quick Start

# Run directly with npx - no installation needed!
npx @hexaust/teamcity-mcp

# Or install globally
npm install -g @hexaust/teamcity-mcp
teamcity-mcp

Features

šŸŽÆ Natural Language Interface

Interact with TeamCity using plain English commands - no need to learn complex APIs or remember tool names:

"show me failed builds from yesterday"
"trigger MyApp build on main branch"
"get build 12345 log"
"list all projects"
"cancel running builds"
"download test artifacts from latest build"
"find what broke the build"

šŸ”§ Core Capabilities

  • Zero-install usage via npx - no setup required
  • Production-ready security with comprehensive error sanitization and rate limiting
  • TypeScript implementation with strict type safety
  • Input validation using Zod schemas with security limits
  • MCP protocol compliant - proper JSON Schema validation, resources, and error handling
  • Complete TeamCity control - builds, projects, artifacts, agents, and more

šŸ“Š TeamCity Operations

  • Build Management: List, trigger, cancel, and monitor builds with real-time status
  • Project Control: Navigate project hierarchies and manage build configurations
  • Test Analysis: Analyze test failures with detailed error information
  • Artifact Access: Download and inspect build artifacts safely
  • Change Tracking: Monitor VCS changes with commit details and file impacts
  • Agent Monitoring: Check build agent status and availability
  • Queue Management: View and manage build queues
  • Problem Detection: Identify and analyze build failures
  • Live Resources: Access real-time status dashboards and build information through MCP resources

Prerequisites

  • Node.js 18 or later
  • TeamCity server with REST API access
  • Bearer token for TeamCity authentication

Configuration

Environment Variables

Set these before running the server:

export TEAMCITY_SERVER_URL="https://your-teamcity-server.com"
export TEAMCITY_BEARER_TOKEN="your_bearer_token_here"

Claude Desktop Configuration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "teamcity": {
      "command": "npx",
      "args": ["@hexaust/teamcity-mcp"],
      "env": {
        "TEAMCITY_SERVER_URL": "https://your-teamcity-server.com",
        "TEAMCITY_BEARER_TOKEN": "your_bearer_token_here"
      }
    }
  }
}

Claude Code Usage

Installation & Setup

Use Claude Code's built-in MCP management commands:

# Add TeamCity MCP server with environment variables
claude mcp add teamcity \
  --env TEAMCITY_SERVER_URL=https://your-teamcity-server.com \
  --env TEAMCITY_BEARER_TOKEN=your_bearer_token_here \
  -- npx @hexaust/teamcity-mcp

Additional MCP commands:

# List all MCP servers
claude mcp list

# Get server details
claude mcp get teamcity

# Remove server
claude mcp remove teamcity

Alternative: Global environment variables

# Set globally (then add without --env flags)
export TEAMCITY_SERVER_URL="https://your-teamcity-server.com"
export TEAMCITY_BEARER_TOKEN="your_bearer_token_here"
claude mcp add teamcity -- npx @hexaust/teamcity-mcp

How It Works

The TeamCity MCP server provides a single natural language tool that understands your requests and executes the appropriate TeamCity operations. Simply describe what you want to do in plain English, and the server will:

  1. Parse your intent - Understanding what TeamCity operation you need
  2. Execute the operation - Making the appropriate REST API calls to TeamCity
  3. Format the response - Presenting results in a clear, useful format

Natural Language Examples

Build Operations:

  • "show failed builds from yesterday"
  • "trigger MyApp build on staging branch"
  • "get build 12345 status and logs"
  • "cancel all running builds"

Project Management:

  • "list all projects with their configurations"
  • "show build configurations for MyProject"
  • "get VCS roots and their details"

Monitoring & Analysis:

  • "what's currently running?"
  • "compare last two builds"
  • "find what broke the main branch"
  • "analyze test failures in recent builds"

Artifact Management:

  • "show artifacts for build #8507"
  • "list artifacts for build 12345"
  • "get artifact metadata from latest build"

Authentication

The server uses Bearer token authentication with the TeamCity REST API. To obtain a bearer token:

  1. Go to your TeamCity server
  2. Navigate to your profile settings
  3. Go to "Access Tokens" tab
  4. Create a new token with appropriate permissions
  5. Use this token as the TEAMCITY_BEARER_TOKEN environment variable

Security Note: The server automatically sanitizes bearer tokens from logs and error messages to prevent accidental exposure.

Security & Production Readiness

This implementation includes comprehensive security measures for production deployment:

Input Validation & Sanitization

  • Zod schema validation for all user inputs with strict type checking
  • Resource limits preventing DoS attacks (max 1000 items for pagination)
  • Input sanitization removing dangerous characters and patterns
  • Parameter length limits preventing oversized requests

Error Handling & Information Security

  • Error sanitization prevents exposure of sensitive server details
  • Stack trace removal from user-facing error messages
  • URL sanitization removes internal paths and sensitive parameters
  • Request ID tracking for secure audit logging

Rate Limiting & Resource Protection

  • Built-in rate limiting (30-60 requests per minute per tool)
  • Pagination limits with secure defaults (max 1000 items, 100 per page)
  • Content size limits for responses (10MB text, 50MB binary)
  • Connection timeouts and retry limits

Troubleshooting

Environment Variables Not Found

Problem: Environment variables are not being picked up.

Solution: Make sure to restart your terminal or reload your shell profile after setting environment variables:

# After adding to .bashrc/.zshrc
source ~/.bashrc  # or ~/.zshrc

Connection Issues

Problem: Server can't connect to TeamCity.

Solution:

  1. Verify your TeamCity server URL is accessible
  2. Check that your bearer token has the required permissions
  3. Ensure TeamCity REST API is enabled

Development

Building from Source

# Clone the repository
git clone https://github.com/hex/teamcity-mcp.git
cd teamcity-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode
npm run dev

Project Structure

teamcity-mcp/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ index.ts                    # Main server with natural language tool
│   ā”œā”€ā”€ client/
│   │   └── teamcity-client.ts      # TeamCity REST API client
ā”œā”€ā”€ package.json
ā”œā”€ā”€ tsconfig.json                   # TypeScript configuration
└── README.md                       # Documentation

Testing

# Run tests
npm test

# Build and test
npm run build && npm test

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For issues and feature requests, please visit: https://github.com/hex/teamcity-mcp/issues


TeamCity MCP Server - Natural language interface for complete TeamCity integration with Claude Desktop and Claude Code.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured