{"slug": "debug-unity-builds-from-rider-with-the-teamcity-cli-and-mcp", "title": "Debug Unity Builds From Rider With the TeamCity CLI and MCP", "summary": "At GameDev Day 2026, TeamCity solutions engineer Artem Rokhin demonstrated debugging a Unity game's staging deployment from JetBrains Rider using the TeamCity CLI and an MCP-connected AI agent, tracing a missing moon landscape to an incorrect build parameter despite a passing build. The workflow requires the TeamCity CLI (installed via Homebrew or WinGet), a TeamCity pipeline with YAML settings stored in the repository, and an MCP-capable agent in Rider such as Claude Agent; TeamCity On-Premises users can use version 2026.2 as a baseline with generally available Pipelines. After committing the fix, Rokhin asked the agent to explain the issue and follow the new build.", "body_md": "## TeamCity\n\nPowerful CI/CD for DevOps-centric teams\n\n[Rider](https://blog.jetbrains.com/teamcity/category/rider/)\n\n[TeamCity](https://blog.jetbrains.com/teamcity/category/teamcity-2/)\n\n# Debug Unity Builds From Rider With the TeamCity CLI and MCP\n\nAt [GameDev Day 2026](https://lp.jetbrains.com/gamedev-day-2026/), TeamCity solutions engineer Artem Rokhin demonstrated how to investigate a CI issue from Rider using the [TeamCity CLI](https://www.jetbrains.com/help/teamcity/teamcity-cli.html) and MCP integration.\n\nFor the demo, he used a Unity game that worked locally but was missing its background on staging. Though the build had passed, Artem used the CLI to inspect the logs and found an incorrect build parameter.\n\nAfter committing his fix, he asked an AI agent connected through MCP to explain the issue and follow the new build.\n\nLet’s go through that example, with the commands and setup you’ll need to try it with your own project.\n\n## The problem on staging\n\nIn Artem’s demo, a Unity game works locally but is missing its moon landscape on staging, despite a successful TeamCity build. He traces the deployment back to its build and checks the logs and configuration to see where they differ from those in his local setup.\n\n## What you need\n\nTo apply this workflow to your own project, you need:\n\n- A Unity project open in [Rider](https://www.jetbrains.com/rider/) .\n- A TeamCity pipeline that builds and deploys the project, with its YAML settings stored in the repository.\n- Access to that pipeline’s build details and logs.\n- The TeamCity CLI installed on your machine.\n- For the AI portion, an activated MCP-capable agent in Rider and access to TeamCity’s MCP endpoint. Artem uses Claude Agent.\n\nThe recording uses TeamCity Cloud. TeamCity On-Premises users can use 2026.2 as a baseline with generally available Pipelines. See the [Pipelines documentation](https://www.jetbrains.com/help/teamcity/create-and-edit-pipelines.html) for setup and version details.\n\nThe commands below use example IDs. Replace `MyGame_BuildWebGL` with your `WebGL` job’s ID, `12345` with the build you are investigating, and `12346` with the new deployment run when you reach that step.\n\n### Connect the TeamCity CLI from Rider\n\nOpen Rider’s terminal and install the TeamCity CLI if you have not already done so. On macOS with Homebrew:\n\n```\nbrew install jetbrains/utils/teamcity\n```\n\nOn Windows with WinGet:\n\n```\nwinget install JetBrains.TeamCityCLI\n```\n\nOther installation methods are available in the [*Getting Started* guide](https://www.jetbrains.com/help/teamcity/teamcity-cli-get-started.html).\n\nConnect to your server and check the connection:\n\n```\nteamcity auth login --server https://example.teamcity.com\nteamcity auth status\n```\n\nReplace the URL with your own TeamCity address. Follow the login flow, which may open your browser for authorization. The [authentication documentation](https://www.jetbrains.com/help/teamcity/teamcity-cli-authentication.html) covers the available methods.\n\nOnce connected, return to Rider’s terminal to inspect the build.\n\n### Find the build that produced the game\n\nList recent runs of the WebGL job:\n\n```\nteamcity run list --job MyGame_BuildWebGL --limit 5\n```\n\nChoose the run that produced the version on staging. Include successful runs in your search: In this example, the relevant build is green.\n\nIf several runs have completed recently, check the deployment’s source build and revision before investigating. The most recent WebGL build may be newer than the version you have open in the browser.\n\nInspect the selected run:\n\n```\nteamcity run view 12345\n```\n\nIn the recording, Artem starts with the pipeline run, identifies its WebGL job, and then opens that job’s build details. Going directly to the WebGL job’s recent runs is a shorter route when you already know which job produced the game.\n\n### Inspect the logs and the configuration\n\nRead the WebGL build log:\n\n```\nteamcity run log 12345\n```\n\nThe default log viewer supports search. Press */*, enter a term, and use *n* or *N* to move between matches. Full command details can be found in the [guide to managing runs](https://www.jetbrains.com/help/teamcity/teamcity-cli-managing-runs.html).\n\nArtem has recently been working with build flavors, so he searches for flavor. The log shows that the build used `gameBuildFlavor` with the value diagnostic.\n\nThat provides a specific setting to investigate. Search the checked-out project for `gameBuildFlavor`, including both the pipeline configuration and the Unity build code that uses it. \n\nThe value printed in the log tells you what the CI build actually received; the repository helps you trace where it came from and what it controls.\n\nIn this demo project, the expected flavor is game. The diagnostic value is associated with the version missing its background. These names are part of the example project’s build setup; your project may use a different parameter or no flavor switch at all.\n\nWhen you follow a similar lead, check both the definition and the code that consumes the value. Finding an unexpected parameter is useful evidence. Understanding its effect on the build lets you judge whether changing it addresses the symptom.\n\n### Commit the configuration change\n\nArtem finds the diagnostic value in the pipeline’s YAML configuration and changes it to `game`. Because the configuration lives alongside the game code, he can review and commit the change from Rider.\n\nTeamCity is configured to watch the repository, so pushing that commit starts a new pipeline run. You do not need to restart the old build manually in this setup.\n\nFor your own pipeline, check its trigger settings and confirm that the new run includes the configuration commit. Keep the original run ID so you can compare the settings and results afterward.\n\nWhile the new pipeline runs, Artem shows another way to investigate CI results from Rider: an AI agent connected to TeamCity through MCP.\n\n## Connect Rider to TeamCity MCP\n\nMCP gives the agent access to TeamCity tools, including tools for retrieving build logs and querying build information. The server endpoint is:\n\n```\nhttps://example.teamcity.com/app/mcp\n```\n\nFor this investigation, create a TeamCity access token limited to the relevant project with the *Read-only* preset. That is enough to inspect the CI results while you make the configuration change through Git. See [TeamCity’s AI integration documentation](https://www.jetbrains.com/help/teamcity/ai-agent-integration.html) for token permissions and connection options.\n\nIn Rider, go to *Settings | Tools | AI Assistant | Model Context Protocol (MCP)* and add an HTTP connection. A valid connection configuration should look like this:\n\n```\n{\n  \"mcpServers\": {\n    \"TeamCity\": {\n      \"url\": \"https://example.teamcity.com/app/mcp\",\n      \"headers\": {\n        \"Authorization\": \"Bearer YOUR_TEAMCITY_TOKEN\"\n      }\n    }\n  }\n}\n```\n\nReplace the server address and token placeholder in your private local configuration. Keep the token out of files you commit or share. Apply the configuration and check that Rider can connect. Our [AI Assistant MCP guide](https://www.jetbrains.com/help/ai-assistant/mcp.html) describes the connection settings.\n\nIf you use Claude Agent, also open *Settings | Tools | AI Assistant | Agents* and enable *Pass custom MCP servers*. Then select *Claude Agent* in the AI chat. This exposes the configured connection to the agent, as described in the [Claude Agent documentation](https://www.jetbrains.com/help/ai-assistant/claude-agent.html).\n\n### Ask the agent to investigate the symptom\n\nGive the agent the symptom and identify the build. For a similar investigation, you could adapt this prompt:\n\n```\nUse TeamCity MCP to inspect WebGL build BUILD_ID in PROJECT_ID. The game has its background when built locally, but the version deployed to staging is missing it. The CI build is successful. Inspect the build details and logs, then compare relevant settings with the project files. Explain the likely cause and cite the build ID, log entries, and files that support your explanation. Do not change anything yet.\n```\n\nReplace the IDs before sending the prompt. Attach the relevant pipeline YAML and Unity build script if the agent needs help locating them. TeamCity MCP supplies the CI information; the coding agent uses its IDE and file tools to inspect the local project.\n\nIn the recording, Claude identifies the diagnostic build flavor and connects it to the unexpected game behavior. It also notices that the correction has already been committed. This part of the demo happens after Artem’s CLI investigation and manual fix, so the response can refer to that existing change.\n\nCheck the evidence in the answer. Does it refer to the run you asked about? Does the parameter value match the log? Does the explanation fit the code that consumes it? Those checks make it easier to assess the proposed cause before changing a different pipeline or project.\n\n## Follow the new deployment\n\nArtem then asks the agent to check the new pipeline and return the staging URL when deployment finishes. The agent queries TeamCity during the active session and reports progress.\n\nA follow-up prompt could be:\n\n```\nCheck the pipeline run for the configuration fix in PROJECT_ID. Report whether the WebGL build and deployment have completed. When deployment succeeds, retrieve the staging URL from the deployment log. If the run is still in progress, report its current state.\n```\n\nFor continuous terminal updates, you can also watch the deployment run with the CLI:\n\n```\nteamcity run watch 12346 --logs\n```\n\nHere, `12346` represents the new deployment build’s ID. Use the ID from your own pipeline. Once it completes, inspect its log if you need to retrieve the URL:\n\n```\nteamcity run log 12346\n```\n\n## Verify the deployed game\n\nOpen the staging URL and repeat the interaction that exposed the problem. In Artem’s demo, the moon landscape is visible again, and the player can drive around it as expected.\n\nThis check confirms that the configuration change resolved the observed problem. The earlier run was already green, so another successful pipeline result alone would not establish that the background had returned.\n\nFor your own project, also confirm that you are viewing the deployment from the new run. Then compare the result with the local version that behaved correctly.\n\n## Make the next investigation easier\n\nThe example suggests a few useful improvements to the pipeline:\n\n- Log the selected build flavor and other settings that change the game output, so they are easy to find.\n- Validate the allowed flavors for staging builds in your project’s build script, and ensure that the run fails early when the value is unexpected.\n- Add a check for the behavior that went wrong here. Depending on the project, that might be a WebGL smoke test that loads the relevant scene or a visual check of the deployed game.\n\nStart with the missing check that would have caught this particular problem. That gives you a concrete way to improve the pipeline, along with a repeatable method for investigating its results in Rider.\n\n#### Subscribe to TeamCity Blog updates", "url": "https://wpnews.pro/news/debug-unity-builds-from-rider-with-the-teamcity-cli-and-mcp", "canonical_source": "https://blog.jetbrains.com/teamcity/2026/11/debug-unity-builds-from-rider-with-teamcity-cli-mcp/", "published_at": "2026-11-10 10:51:30+00:00", "updated_at": "2026-11-10 11:54:32.351177+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "developer-tools", "ai-tools"], "entities": ["TeamCity", "JetBrains", "Rider", "Artem Rokhin", "Unity", "Claude Agent", "GameDev Day 2026", "MCP"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/debug-unity-builds-from-rider-with-the-teamcity-cli-and-mcp", "markdown": "https://wpnews.pro/news/debug-unity-builds-from-rider-with-the-teamcity-cli-and-mcp.md", "text": "https://wpnews.pro/news/debug-unity-builds-from-rider-with-the-teamcity-cli-and-mcp.txt", "jsonld": "https://wpnews.pro/news/debug-unity-builds-from-rider-with-the-teamcity-cli-and-mcp.jsonld"}}