TeamCity CI/CD

v1.0.1
io.github.desty2k/teamcity Checked 1 day ago Published 1 month ago

Read-only MCP server for JetBrains TeamCity — builds, configs, logs, tests, agents

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_projects Search Projects

Search TeamCity projects by name, ID, or parent. This is the PRIMARY tool for browsing the TeamCity project hierarchy. Projects are organizational containers that hold build configurations (jobs). Projects can be nested — use parent_project_id to navigate the tree. The root project '_Root' is the parent of all top-level projects.

ParameterTypeDescription
archivedbooleanInclude archived projects
limitintegerMax results per page
nameFilter by project name (case-insensitive exact match)
pageintegerPage number, 1-indexed
parent_project_idFilter to direct children of this parent project ID. Use '_Root' for top-level projects.
project_idFilter by exact project ID (e.g., 'MyProject'). Use this when you know the project's technical identifier.

get_project_details Get Project Details

Get detailed information about a single TeamCity project. Returns project metadata including: name, description, parent project, immediate child projects, build configurations defined in this project, and project parameters.

ParameterTypeDescription
project_id *stringProject ID (e.g., 'MyProject').

search_build_configs Search Build Configs

Search TeamCity build configurations (jobs/pipelines) by structured filters. A build configuration defines WHAT to build and HOW — steps, triggers, parameters, and VCS roots. Each run produces a build. At least one filter (project_id or build_type_id) is required.

ParameterTypeDescription
build_type_idFilter by exact build type ID (e.g., 'MyProject_Build'). Use when you know the exact identifier.
limitintegerMax results per page
pageintegerPage number, 1-indexed
pausedFilter by paused state. None = all.
project_idFilter by project ID. Returns only build configurations belonging to this project.

get_build_config_details Get Build Config Details

Get full details of a build configuration including steps, triggers, and parameters. Returns comprehensive configuration data: build steps (type, name, and properties), triggers (VCS, schedule, dependency), parameters, VCS roots, settings, and agent requirements. Use this to understand HOW a build is configured, not its run history.

ParameterTypeDescription
build_type_id *stringBuild configuration ID (e.g., 'MyProject_Build').

get_build_config_branches Get Build Config Branches

List branches available for a build configuration. Returns branch names with their default status and activity information. Use this to understand which branches a configuration can build. Example questions: - "What branches can this build run on?" - "What is the default branch for this pipeline?"

ParameterTypeDescription
build_type_id *stringBuild configuration ID
limitintegerMax results per page
pageintegerPage number, 1-indexed

search_builds Search Builds

Search build history with filters. This is the PRIMARY tool for finding builds (CI/CD runs). At least one filter is required: build_type_id, project_id, status, running, tag, or branch. Builds are returned newest-first.

ParameterTypeDescription
branchFilter by branch name. Use '<default>' for the default branch. Omit to return builds from all branches.
build_numberFilter by exact build number (display string, e.g., '1.2.3-456'). Build numbers are NOT numeric IDs — they are display strings.
build_type_idFilter by build configuration ID. Use this to get history for a specific pipeline.
limitintegerMax results per page
pageintegerPage number, 1-indexed
personalFilter personal builds. True = only personal, False = exclude personal, None = all.
project_idFilter by project ID. Returns builds from all configurations in the project.
runningFilter by running state. True = only running builds, False = only finished, None = all builds.
since_dateOnly builds started after this date. ISO 8601 format: 'yyyyMMddTHHmmss+0000'. Example: '20240101T000000+0000' for Jan 1 2024 UTC.
statusFilter by build status: 'SUCCESS', 'FAILURE', or 'ERROR'. Omit to return all statuses.
tagFilter by build tag (exact match)
until_dateOnly builds that finished before this date. Same format as since_date.

get_build_details Get Build Details

Get comprehensive details of a single build. Returns full build data: status, state, branch, triggered-by, build agent, VCS revisions, parameters, output parameters, statistics, snapshot dependencies, and tags.

ParameterTypeDescription
build_id *stringNumeric build ID — the internal ID, not the build number.

get_build_statistics Get Build Statistics

Get statistical metrics for a build. Returns numeric statistics: total duration, build step durations, artifact size, test counts (passed/failed/ignored/muted), code coverage metrics, and any custom statistics reported by build steps. Example questions: - "How long did each step take in this build?" - "What's the test pass rate for this build?" - "What was the code coverage?"

ParameterTypeDescription
build_id *stringNumeric build ID

get_build_chain Get Build Chain

Traverse a build's snapshot-dependency chain. Answers "what did this build depend on?" (upstream) and "what depended on this build?" (downstream) — the core of pipeline/build-chain debugging.

ParameterTypeDescription
build_id *stringNumeric build ID
directionstringWhich snapshot-dependency direction to traverse. 'upstream' = builds this one depends on; 'downstream' = builds that depend on this one; 'both' (default).

get_build_log Get Build Log

Retrieve build log content, paginated by line.

ParameterTypeDescription
build_id *stringNumeric build ID
end_lineStop reading at this line (exclusive). At most max_lines lines are returned even if the range is wider.
max_linesintegerMaximum number of lines to return (capped at 5000).
start_lineStart reading from this line (0-indexed). Omit to start at the beginning.
tailbooleanReturn the last lines instead of the first — use when investigating failures.

search_build_log Search Build Log

Search within a build log for specific text. Returns matching lines with surrounding context — find errors or patterns in large logs without paging through them.

ParameterTypeDescription
build_id *stringNumeric build ID
query *stringText to find in the build log (case-insensitive).
context_linesintegerLines of context to show around each match.
max_matchesintegerMaximum number of matches to return.

get_build_test_results Get Build Test Results

Get test results for a build. Returns test occurrences with name, status, duration, and failure details. A build can have thousands of tests — use pagination and the status filter to focus on what matters.

ParameterTypeDescription
build_id *stringNumeric build ID
limitintegerMax results per page
pageintegerPage number, 1-indexed
statusFilter by test status: 'SUCCESS', 'FAILURE', or 'UNKNOWN'. Omit for all tests. Use 'FAILURE' to see only failed tests.

get_test_details Get Test Details

Get detailed information about a specific test occurrence. Returns the full test name, status, duration, failure reason, and investigation/muting state, plus the first-failed / next-fixed build references that bracket the failure. Example questions: - "Show me the details of this failed test" - "What was the error message for this test?" - "Is this test being investigated?"

ParameterTypeDescription
test_locator *stringTest occurrence locator (the 'id' field of a test occurrence).

get_build_problems Get Build Problems

Get problems detected in a build. Returns structured problem data: compilation errors, exit-code failures, test failures, snapshot-dependency failures, and custom problem types. Each problem has a type, identity, and description. This is the PRIMARY tool for understanding WHY a build failed — it is easier to interpret than raw logs.

ParameterTypeDescription
build_id *stringNumeric build ID
limitintegerMax results per page
pageintegerPage number, 1-indexed

search_investigations Search Investigations

Search active investigations in TeamCity. Investigations are assignments to fix a failing build or test. When a build fails, TeamCity can assign an investigation to a team member.

ParameterTypeDescription
assigneeFilter by assignee username.
build_type_idFilter investigations by build configuration ID.
limitintegerMax results per page
pageintegerPage number, 1-indexed
project_idFilter investigations by project ID.

list_muted_tests List Muted Tests

List currently muted tests. A muted test does not fail its build even when it fails, so a mute can hide a real regression. This returns who muted what, where (scope), why, and how it resolves.

ParameterTypeDescription
build_type_idFilter mutes by build configuration ID.
limitintegerMax results per page
pageintegerPage number, 1-indexed
project_idFilter mutes by project ID.

get_build_queue Get Build Queue

List builds currently in the TeamCity build queue. Shows builds waiting to be assigned to an agent: queue entry, branch, triggered-by, wait reason, and compatible-agent count.

ParameterTypeDescription
build_type_idFilter queued builds by build configuration ID.
limitintegerMax results per page
pageintegerPage number, 1-indexed
project_idFilter queued builds by project ID.

search_agents Search Agents

Search TeamCity build agents. Build agents are machines that execute builds. Each belongs to an agent pool and reports capability properties (OS, installed software, etc.).

ParameterTypeDescription
authorizedFilter by authorization state. Unauthorized agents cannot run builds.
connectedFilter by connection state. True = connected, False = disconnected.
enabledFilter by enabled state. Disabled agents are excluded from build assignment.
limitintegerMax results per page
pageintegerPage number, 1-indexed
pool_idFilter by agent pool ID.

list_agent_pools List Agent Pools

List TeamCity agent pools. Agent pools group build agents for resource management. Each pool has a set of assigned projects and agent-count limits.

ParameterTypeDescription
limitintegerMax results per page
pageintegerPage number, 1-indexed

get_agent_details Get Agent Details

Get detailed status for a single build agent. Surfaces WHY an agent may not be taking builds: the enabled/authorized state with their human comments, last activity, version, pool, current build, and an OS summary. The first thing to check when builds sit queued or an agent looks idle.

ParameterTypeDescription
agent_id *integerAgent ID

search_changes Search Changes

Search VCS changes (commits) tracked by TeamCity. Returns changes with author, date, comment, and file count. Changes are linked to the builds that include them. At least one filter is required: build_id, build_type_id, project_id, or username.

ParameterTypeDescription
build_idGet VCS changes included in a specific build.
build_type_idGet pending changes for a build configuration.
limitintegerMax results per page
pageintegerPage number, 1-indexed
project_idGet changes across all build configurations in a project.
since_changeOnly changes after this one: a TeamCity change ID (e.g. '1234') or a full commit SHA.
usernameFilter changes by VCS username (committer).

get_change_details Get Change Details

Get detailed information about a VCS change including modified files. Returns the full commit details with the complete list of modified files (added, modified, deleted) and their paths. Example questions: - "What files were changed in this commit?" - "Show me the details of change 12345"

ParameterTypeDescription
change_id *stringChange ID

list_build_artifacts List Build Artifacts

List the artifacts a build produced (one directory level). Browse into a directory by passing its path back in.

ParameterTypeDescription
build_id *stringNumeric build ID
pathstringArtifact directory to list (e.g. 'reports'). Empty lists the root.

get_build_artifact_content Get Build Artifact Content

Read the text content of a build artifact, paginated by line. Intended for text artifacts (test reports, coverage summaries, logs). Page a large file by advancing start_line while has_more is true. Oversized artifacts are refused.

ParameterTypeDescription
build_id *stringNumeric build ID
path *stringArtifact path, e.g. 'reports/junit.xml'.
max_line_lengthintegerMaximum characters per line; longer lines are truncated.
max_linesintegerMaximum lines to return.
start_lineintegerFirst line to return (0-indexed).

diagnose_build Diagnose Build

Explain why a build failed, in one call. Combines the build's status, its build problems, its failed tests (unmuted first, with failure details) and the log lines most likely to explain the failure: lines TeamCity marked as errors plus lines with error keywords, with a little context. Use this first for "why did build X fail?"; drill down with get_build_log, search_build_log or get_test_details afterwards. Example questions: - "Why did build 12345 fail?" - "What broke the nightly build?"

ParameterTypeDescription
build_id *stringNumeric build ID
context_linesintegerLog lines of context around each match
max_failed_testsintegerFailed tests to include
max_log_matchesintegerError log lines to include

find_build_config Find Build Config

Find build configurations by fuzzy name/project matching. The PRIMARY tool when a configuration is described in natural language, vague terms, abbreviations, or partial names — it matches against every configuration's name and full project path.

ParameterTypeDescription
query *stringFree-text query — partial names, project-path fragments, or abbreviations.
limitintegerMaximum results to return

resolve_teamcity_url Resolve Teamcity Url

Parse a TeamCity web URL and extract entity identifiers. Users often paste URLs from their browser. This parses a TeamCity URL and extracts the project, build-configuration, and/or build IDs.

ParameterTypeDescription
url *stringA TeamCity web UI URL from the browser address bar. Supports both new-style URLs (/project/X, /buildConfiguration/X/123, /build/123, /change/45) and legacy URLs (/viewLog.html?buildId=X, /viewType.htm…

get_server_info Get Server Info

Get TeamCity server version and status information. Returns the server version, build number, start time, and current time. Use this to verify connectivity or check which TeamCity version is running. Example questions: - "What version of TeamCity are we running?" - "Is TeamCity up?" - "When was TeamCity last restarted?"

get_server_health Get Server Health

Get server health items and runtime metrics. Combines TeamCity's reported health items (configuration/disk/plugin warnings) with runtime metrics (CPU, memory, queue size, etc.) — the two things that explain server-side ERROR builds or sluggishness. Each source degrades independently: if your token lacks permission for one, the other is still returned with a note.