AI代理如何与TeamCity交互

TL;DR · AI 摘要
AI代理现在可以设置TeamCity的构建配置和完整的构建链,添加构建功能并配置参数。
核心要点
- AI代理可以自动化TeamCity的构建配置和完整的构建链。
- 代理使用TeamCity文档、CLI和REST API来执行设置。
- 反馈循环允许代理不断改进配置。
结构提纲
按章节快速跳转。
思维导图
用一张图看清主题之间的关系。
查看大纲文本(无障碍 / 无 JS 友好)
- AI代理与TeamCity交互
- 实验一:解决方案搜索
- 使用ChatGPT和Codex设置复杂构建配置
- 实验二:Go项目CI设置
- 使用Codex为GitHub上的Go项目设置CI
- 结果分析
- AI代理自动化配置并通过反馈循环改进
金句 / Highlights
值得收藏与分享的关键句。
AI代理能够自动设置TeamCity的复杂构建配置。
Codex使用TeamCity REST API和CLI来执行设置。
AI代理通过反馈循环不断调整配置直到达到目标。
How AI Agents Can Work with TeamCity

May 26, 2026
TL;DR: At some point, we crossed an interesting threshold. AI agents can now set up TeamCity build configurations and even full build chains, add build features, and configure parameters.
This works because TeamCity documentation is structured and accessible through MCP via Context7, and because agents can rely on tools like the TeamCity CLI and the teamcity-cliskill.
I ran a couple of experiments recently to see how far this can go in practice.

#1 In search of a solution
First, I asked ChatGPT to come up with a solution for a customer request.
ChatGPT read TeamCity documentation via Context7 and proposed a setup that included:
- multiple build configurations
- two aggregate builds
- two build chains combining them
- triggers based on file extensions
- artifact and snapshot dependencies
So far, this is what you would expect from a capable LLM: a reasonably solid design.
Then I passed this solution to Codex and asked it to actually set everything up in TeamCity Nightly, in my personal sandbox project.
Five minutes later, I had a working demo.
There were some mistakes, but they were fixed in a few more minutes. Codex used the TeamCity REST API and executed the setup step by step via teamcity api commands, effectively reproducing the entire configuration from the original description.
The interesting part here is not that the configuration was correct on the first try. It was not.
The interesting part is how quickly the agent could:
- apply the configuration
- observe what did not work
- adjust and retry
What matters here is that the gap between describing a pipeline and actually having it running is now very small. The agent does not stop at producing a plan. It executes it and iterates until the result is usable.
At this point, the agent is not just describing a solution. It is implementing and refining it.
#2 Go project
In the second experiment, I cloned a small personal Go project from GitHub and asked Codex to set up CI for it in TeamCity.
It created a simple pipeline with “Tests” and “Build” configurations.
One funny detail: it managed to reuse my GitHub PAT from the gh utility to create the VCS root. “Stole” is not exactly the right word here, but it definitely felt funny.
The success condition was simple: the build should be green.
It was not.
After a few attempts, the agent figured out that Go was missing in the build agent environment. It then modified the build steps to work around this and retried until the build passed.
In other words, the agent is not just configuring TeamCity. It is working towards a goal and adapting its actions based on what happens during the build.
After reviewing the result, I noticed that Go tests were not reported properly in TeamCity.
I pointed this out.
The agent updated the configuration, added the required build feature, and on the next run the test results were reported correctly.
What these experiments show
In both cases, the agent followed a similar pattern:
- read documentation
- propose a solution
- apply it through the API
- observe the result
- iterate until the goal is reached
This loop is the main difference compared to earlier experiments with LLMs.
Instead of stopping at “here is how you could configure it”, the agent continues until the system actually works. This turns CI configuration into an iterative process that can converge on its own, instead of stopping at a static definition written upfront.
Conclusion
TeamCity works with AI agents, and AI agents can meaningfully help configure it. But the more interesting finding is how they go about it.
In both experiments the same pattern emerged: the agent didn’t stop at producing a configuration. It applied it, watched what happened, and kept adjusting until the pipeline ran. That feedback loop, which normally requires a developer to run the pipeline, read the output, fix something, and run it again, was happening inside the system on its own.
That said, these are early results. Agents need clear goals, good documentation, and a controlled environment to operate in. Setup tasks that used to take several manual iterations can now converge faster, with the agent handling much of the cycle.