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
访问服务器

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选