
Teamcity
io.github.Daghis由 GitHub 帳號 Daghis 發布v2.12.15更新於 Nov 7, 2026
MCP server exposing JetBrains TeamCity CI/CD workflows to AI coding assistants
概覽
本機 MCP 伺服器,讓 AI 程式設計助理觸發與監控 TeamCity 建置、讀取日誌與測試失敗,並可選擇管理建置設定。
- 可以做什麼
- 觸發建置、查看建置狀態、取得建置日誌並依條件列出建置
- 查看測試失敗、取得測試詳情並分析建置問題
- 列出專案、建置設定、佇列與參數,並排查問題
- 在 Full 模式下建立、複製與更新建置設定,管理建置步驟與觸發條件,設定 VCS 根與代理
- 不需重新啟動即可在執行時切換 Dev 與 Full 工具集
- 適用情境
- 適合希望助理在編輯器中直接操作 TeamCity CI/CD 伺服器的情境,例如排入建置、診斷失敗的測試或讀取日誌。最適合 2026.1 之前的 TeamCity 伺服器,因為較新版本已內建 MCP 端點,JetBrains 也提供官方 CLI。
- 執行需求
- 以 npx 執行的本機程序,需要 Node.js 20.10.0 以上版本。需要可存取 REST API 的 TeamCity 2020.1+ 伺服器、TEAMCITY_URL 基礎位址,以及 TEAMCITY_TOKEN 中的 TeamCity 個人存取權杖;MCP_MODE 選擇 dev(預設)或 full。需要能連線至 TeamCity 伺服器的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Teamcity,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
TeamCity MCP Server
[CI] [CodeQL] [codecov] [License: MIT]
A Model Control Protocol (MCP) server that bridges AI coding assistants with JetBrains TeamCity CI/CD server, exposing TeamCity operations as MCP tools.
[TeamCity Server MCP server][!NOTE] Project status (October 2026): stable, low-key maintenance. This does what it set out to do and is no longer under active development. It still works and stays installable; issues and PRs may get slow or no response, and security fixes are best-effort.
JetBrains now ships official AI integration for TeamCity — an MCP server built into TeamCity 2026.1+ and the TeamCity CLI with an installable agent skill — which is the better default for most workflows. See How this compares to JetBrains' official tooling below before adopting.
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 via MCP tools.
Upgrading from 1.x? Version 2.0.0 moved 15 tools from Dev to Full mode, including queue management, agent compatibility checks, and server health monitoring. If you relied on these tools in Dev mode, switch to
MCP_MODE=fullor use runtime mode switching (v2.1.0+). See CHANGELOG.md for details.
Features
🚀 Two Operational Modes
-
Dev Mode (default): Safe CI/CD operations (31 tools, ~14k context tokens)
- Trigger builds and monitor status
- Fetch build logs and inspect test failures
- List projects, configurations, and queue
- Read parameters and investigate problems
-
Full Mode: Complete infrastructure management (87 tools, ~26k context tokens)
- All Dev mode features, plus:
- Create and clone build configurations
- Manage build steps, triggers, and dependencies
- Configure VCS roots and agents
- Full CRUD for parameters (build config, project, and output parameters)
- Queue management and server administration
Runtime Mode Switching (v2.1.0+): Switch between modes at runtime using the get_mcp_mode and set_mcp_mode tools—no restart required. MCP clients that support notifications will see the tool list update automatically.
See the Tools Mode Matrix for the complete list of 87 tools and their availability by mode.
🎯 Key Capabilities
- Trigger and monitor builds, fetch logs, and inspect test failures
- Token-based authentication to TeamCity; sensitive values redacted in logs
- Modern architecture: simple, direct implementation with a singleton client
- Performance-conscious: fast startup with minimal overhead
- Clean codebase with clear module boundaries
How this compares to JetBrains' official tooling
As of October 2026 (TeamCity 2026.2, TeamCity CLI 1.6), JetBrains ships two first-party paths for AI agents, both generally available and officially supported:
- Built-in MCP server — every TeamCity 2026.1+ server (Cloud and On-Premises) exposes an MCP endpoint at
<server-url>/app/mcp, so there's nothing to install. It's a deliberately small toolset: build logs, generic REST APIGET/POSTpassthrough tools, and (since 2026.2) pipeline tools. By default it runs in a safe mode where the agent can read and queue personal builds; an opt-in "brave mode" lets it send arbitrary RESTPOSTrequests and edit or delete pipelines. Since 2026.2 you can also sign in with OAuth instead of pasting an access token. - TeamCity CLI — an open-source
teamcitycommand (TeamCity 2020.1+) with an installable agent skill (teamcity skill install) for Claude Code, Cursor, and other agents. It covers runs, logs, tests, the queue, agents, pools, projects, VCS roots, parameters, and pipelines, falls back to raw REST access viateamcity api, and has a read-only mode (TEAMCITY_RO=1). JetBrains' own docs describe it as the broader of the two options.
teamcity-mcp predates that tooling and overlaps with it heavily. The official tooling is the better default today. What teamcity-mcp still offers is narrower than it used to be:
- An MCP server for servers older than 2026.1. If your client speaks only MCP and your TeamCity server predates the built-in endpoint, this still works (TeamCity 2020.1+).
- Purpose-built MCP tools instead of a REST passthrough. It exposes 87 typed tools (gated by Dev/Full mode), so the agent doesn't need to know REST paths and locators — and it covers operations backed by
PUT/DELETE(such as enabling agents or deleting parameters), which the built-in MCP's genericGET/POSTtools don't reach.
JetBrains' tooling is evolving quickly, so rather than pin down a feature-by-feature comparison here (it would go stale fast), check the current docs and pick what fits:
- TeamCity 2026.2 announcement — pipeline tools, brave mode, and OAuth for the built-in MCP
- TeamCity 2026.1 announcement — where the official AI integration debuted
- AI agent integration docs — the built-in MCP, its tools, and safe vs. brave mode
- TeamCity CLI docs and agent skill — the terminal + agent-skill path
If you're comfortable with JetBrains' CLI, you may not need this project at all. It stays MIT-licensed and installable for whatever the built-ins don't yet reach — fork it if you want to take it further yourself.
Installation
Prerequisites
- Node.js >= 20.10.0 (LTS versions 20, 22, 24 tested in CI)
- TeamCity Server 2020.1+ with REST API access
- TeamCity authentication token
Quick Start
npm Package
Run the MCP server via npx (requires Node 20.x). Set your TeamCity environment variables inline or via a .env in the working directory.
Claude Code
- Add the MCP (relying on
.envfor configuration):claude mcp add teamcity -- npx -y @daghis/teamcity-mcp
- With env vars (if not using .env):
claude mcp add teamcity -e TEAMCITY_URL="https://teamcity.example.com" -e TEAMCITY_TOKEN="tc_<your_token>" -- npx -y @daghis/teamcity-mcp
- With CLI arguments (recommended for Windows):
claude mcp add teamcity -- npx -y @daghis/teamcity-mcp --url "https://teamcity.example.com" --token "tc_<your_token>" --mode dev
- Add
-s userto install user-wide instead of project-scoped (default) - Context usage (Opus 4.1, estimates):
- Dev (default): ~14k tokens for MCP tools
- Full (
MCP_MODE=full): ~26k tokens for MCP tools
Windows Users
On Windows, Claude Code's MCP configuration may not properly merge environment variables. Use CLI arguments as a workaround:
Or use a config file for better security (token not visible in process list):
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].textcontains 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:pageSizecontrols items per page.all: truefetches multiple pages up tomaxPages.- Legacy
countonlist_buildsis kept for compatibility butpageSizeis 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: falseanderror.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
Note: The legacy helpers exported from
src/teamcity/index.tsremain only for compatibility and include placeholder implementations. Prefer the MCP tools (see the reference linked above) or theTeamCityAPIshown here when automating workflows.
Development
Bundle analysis in CI
The CI workflow runs npm run build:bundle and uploads the generated coverage/bundles JSON using codecov/codecov-action with the javascript-bundle plugin.
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 MCP Tool Reference for argument details and additional options.
clone_build_config- Duplicate existing configurations into any project, preserving steps, triggers, and parameters.update_build_config- Adjust names, descriptions, artifact rules, and pause state for a configuration.manage_build_steps- Add, update, remove, or reorder build steps through a single tool surface.manage_build_triggers- Add or delete build triggers with full property support.create_vcs_root&add_vcs_root_to_build- Define VCS roots and attach them to build configurations.
See also: docs/TEAMCITY_MCP_TOOLS_GUIDE.md for expanded workflows and examples that align with the current MCP implementation.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for details.
Security
Token Management
- Configure
TEAMCITY_TOKENvia environment variable or config file (see.env.example); never commit real tokens - Use a token with minimal required permissions; read-only tokens work for most Dev mode operations
- Token-based authentication only; the MCP server does not support username/password
- Logs redact sensitive values including tokens
Mode Selection
- Prefer Dev mode unless Full mode is explicitly needed—this limits the blast radius of any misconfiguration or prompt injection
- Full mode enables destructive operations (project deletion, agent management) that cannot be easily undone
Network Security
- Always use HTTPS for TeamCity connections; the server does not enforce this but strongly recommends it
- The MCP server connects only to the configured TeamCity URL; no other network calls are made
AI Assistant Considerations
- AI assistants could be manipulated via prompt injection in build logs, test output, or other TeamCity data
- Dev mode's limited tool set reduces the impact of such attacks
- All actions appear in TeamCity's audit log under the token's associated user
- Build logs and test failure details may contain sensitive information (secrets, paths, internal URLs) that become visible to the AI assistant
Repository Security
This repository has GitHub secret scanning and push protection enabled. See SECURITY.md for vulnerability reporting.
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
- See THIRD_PARTY_NOTICES.md for third-party licenses
Built with ❤️ for developers who love efficient CI/CD workflows
來源:README.md,提交 cb6ad77
工具
0版本歷史
6- v2.12.15最新Nov 7, 2026
- v2.12.12Oct 29, 2026
- v2.12.10Oct 21, 2026
- v2.12.9Oct 20, 2026
- v2.12.8Oct 3, 2026
- v2.12.1Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分