npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@hexaust/teamcity-mcp

v4.2.4

Published

TeamCity MCP server for Model Context Protocol integration

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.