MCP Server for TeamCity
480
This repository contains Model Context Protocol (MCP) server implementations for TeamCity CI/CD integration.
The server exposes the following tools for navigating TeamCity projects, inspecting build configurations, and querying build state.
| Tool | Description |
|---|---|
teamcity_list_projects | Lists projects with parent relationships; optional name/id regex filters. |
teamcity_get_project | Project details by ID — child projects, build configurations, and templates. |
teamcity_get_project_hierarchy | Renders the project tree as an indented markdown list; optional root and depth. |
teamcity_get_project_parameters | Configuration parameters defined on a project (cascade to child build configs); inheritance/name filters. |
teamcity_get_project_features | Project features — report tabs, graphs, versioned settings, issue trackers, etc. |
teamcity_list_build_types | Lists build configurations (build types); optional project scope and name/id regex filters. |
teamcity_get_build_type | Full build config detail — template linkage, settings, VCS roots, triggers, steps, agent reqs, dependencies, build features. |
teamcity_get_build_type_parameters | Parameters defined on a build configuration (own/inherited/all); name filter. |
teamcity_get_build_type_features | Build features on a build configuration (Matrix Build, failure conditions, swabra, etc.), grouped by type; own/inherited. |
teamcity_get_build_type_dependency_graph | Design-time snapshot/artifact dependency graph for a build type (dependencies/dependents/both); markdown or mermaid. |
teamcity_list_templates | Lists build templates; optional project scope and name/id regex filters. |
teamcity_list_vcs_roots | Lists VCS roots (id and name); optional project scope and name filter. |
teamcity_get_vcs_root | Full connection detail for one VCS root (URL, branch spec, auth); secure props redacted. |
teamcity_get_audit_log | Audit log entries (config/permission changes); optional build-type/project scope and config-changes-only filter. |
| Tool | Description |
|---|---|
teamcity_list_builds | Lists recent builds for a build type; filters for project, branch, status, state, count. |
teamcity_get_build | Comprehensive build details — status, agent, VCS revisions, build problems, composite flag. |
teamcity_get_build_status | Compact single-line status (state, branch, progress, URL). |
teamcity_get_running_builds | All running builds, optionally filtered by project. |
teamcity_get_queued_builds | All builds in the queue, optionally filtered by project. |
teamcity_search_builds | Searches builds across projects by multiple criteria (project, build type, branch, status, state, agent, tags, dates). |
teamcity_get_build_changes | VCS changes (commits) included in a build — author, comment, changed files. |
teamcity_get_build_problems | Dedicated build problem occurrences (exit-code, OOM, dependency failures) — distinct from test failures. |
teamcity_get_build_dependency_tree | Walks a build's actual snapshot/artifact dependency chain; per-node status; up/down direction; markdown or mermaid. |
teamcity_get_build_parameters | Resulting parameters actually applied to a build after overrides; name filter. |
teamcity_get_build_tests | Test occurrences for a build — accurate summary counts and per-test failure detail (failed/muted/all); composite/matrix-aware with per-sub-build totals. |
teamcity_get_test_history | Follows one test by name across builds; useful for flakiness or regression onset. |
teamcity_get_build_log_failures | For failed tests, returns console-log context around each failure by searching the build log. |
teamcity_search_build_log | Searches a build's full console log by regex/literal with surrounding context. |
teamcity_list_build_artifacts | Lists artifact files/dirs (including hidden .teamcity/...); optional subdirectory navigation. |
teamcity_get_build_artifact_content | Text content of a single artifact file; refuses binaries and truncates large files. |
teamcity_list_mutes | Mute details — reason, who/when, scope (project/build config), and resolution policy. |
teamcity_server_info | TeamCity server version and instance metadata. |
From your Linux server, create a directory for your configuration:
mkdir -p /opt/teamcity-mcp-server
cd /opt/teamcity-mcp-server
Pull the Docker image:
docker pull peakflames/teamcity-remote-mcp-server
Run the Docker container:
docker run -d \
--name teamcity-mcp-server \
-p 8080:8080 \
-e TEAM_CITY_URL="https://your-teamcity-server" \
-e TEAM_CITY_ACCESS_TOKEN="your_access_token" \
peakflames/teamcity-remote-mcp-server
The server should now be running. MCP clients will connect using:
http://{{your-server-ip}}:8080/mcp| Variable | Description | Required |
|---|---|---|
TEAM_CITY_URL | Full URL of your TeamCity server (e.g. https://teamcity.example.com) | Yes |
TEAM_CITY_ACCESS_TOKEN | TeamCity access token for authentication | Yes |
The server will fail to start if either variable is missing. Both are still required when optional authentication and per-caller RBAC (below) are enabled — the server uses its own token to query TeamCity permissions on the caller's behalf.
How to create a TeamCity access token:
Program.cs reads TEAM_CITY_URL and TEAM_CITY_ACCESS_TOKEN from environment variables (these take precedence over appsettings.json)TeamCityRemoteMcpServer can optionally require a bearer token from an external OAuth 2.1
authorization server, validating callers and publishing RFC 9728 protected-resource metadata at
/.well-known/oauth-protected-resource/mcp. Layered on top, per-caller RBAC authorizes each tool
call against the calling user's own TeamCity permissions instead of the server's shared access
token. Both are off by default and behavior is unchanged unless you configure them — see
docs/authentication.md and docs/rbac.md.
Add the server using the streamable HTTP transport:
claude mcp add --scope user --transport http teamcity-remote http://{{your-server-ip}}:8080/mcp
If the server has authentication enabled, the client performs an OAuth flow on first connect instead of connecting immediately — that's expected, not a broken command.
Open Cline's MCP settings UI
Click the "Remote Servers" tab
Add the following configuration:
{
"mcpServers": {
"TeamCity": {
"autoApprove": [],
"disabled": false,
"timeout": 60,
"url": "http://{{your-server-ip}}:8080/mcp",
"transportType": "streamableHttp"
}
}
}
Server fails to start:
TEAM_CITY_URL and TEAM_CITY_ACCESS_TOKEN environment variables are setdocker logs teamcity-mcp-serverlogs/TeamCityRemoteMcpServer_*.log inside the containerAuthentication errors (401):
401 from /mcp and the client never prompts to log in:
/mcp is only protected when McpAuth:Enabled=true — see docs/authentication.mdServer refuses to start with an McpAuth or Rbac validation message:
Every tool call is denied, or projects come back empty, with RBAC enabled:
See CONTRIBUTING.md for development setup, build instructions, Docker publishing, and code standards.
See LICENSE for details.
Content type
Image
Digest
sha256:35cb1c305…
Size
19.6 MB
Last updated
about 1 month ago
docker pull peakflames/teamcity-remote-mcp-server