Jonas Helming, Maximilian Koegel and Philip Langer co-lead EclipseSource, specializing in consulting and engineering innovative, customized tools and IDEs, with a strong …
Let AI commit (to) your work - With Theia AI, Git and MCP
March 5, 2025 | 7 min ReadImagine a world where your AI-powered IDE can manage your development workflows, e.g. the entire Git process—branching, committing, viewing diffs, and more—at your command. With the AI-powered Theia IDE and the Model Context Protocol (MCP), that vision is already a reality. In this post, we’ll explore how you can easily create a custom “Git Agent” that automates complex Git operations in minutes, simply by providing a concise system prompt. Based on this example, you can create any other custom workflow for your specific use cases, the sky is the limit! Let’s dive in!
In case you don’t know Theia AI, the AI-powered Theia IDE, or MCP visit the Theia AI introduction and the AI Theia IDE overview, the MCP introduction, and download the AI-powered Theia IDE here.
Automating Git with a Custom AI Agent in the Theia IDE
By leveraging flexible prompt management in the AI-powered Theia IDE and external features provided by MCP servers, you can easily augment existing agents or create new custom “agents” from scratch. In our example, we will create a Git agent that knows how to:
- Interpret your natural-language instructions.
- Invoke Git commands using MCP.
- Respond with meaningful information or next-step suggestions.
The best part? You can set this up in only one minute. As shown in the video below, you just need to:
- Create a new custom agent, we simply call it “Git”
- Provide a system prompt that describes what you want your agent to do (e.g., “You are a Git agent…”).
- Specify a set of MCP Git functions that your agent can call (
~{mcp_git_git_add}
,~{mcp_git_git_commit}
, etc.).
Also, see the MCP documentation to learn how to configure MCP servers in the Theia IDE.
Once you supply these details, your new custom agent is up and running and you can directly use it in the chat view of the Theia IDE (see video below).
How does this work?
The flexible creation of a new agent that is even capable of interacting with Git is enabled by the comprehensive feature set of the underlying framework Theia AI:
First, it allows you to create new custom AI agents on the fly, which are then seamlessly integrated into the Theia IDE, e.g. to use them in the chat.
Second, Theia AI provides an existing integration with MCP. Therefore, in the Theia IDE, users can easily set-up new MCP servers and then use their capabilities on the fly.
Third, Theia AI has a flexible prompt management system. In the Theia IDE, prompt editing is even exposed to the end user, therefore, you can build new workflows at runtime.
The user-specified prompt will be used by Theia AI as a system message for any conversation with the new agent. As you can see in the full prompt listed below, the prompt contains a static part (the first two sentences) and “functions”. These functions will automatically be resolved by Theia AI to their full description including a schema for the parameters, and attached to each user request.
This information is retrieved from the MCP server providing the respective function. It allows the underlying LLM to understand the provided capabilities and to call a specific function with the right parameter set. As most functions are therefore “self-explaining”, based on their provided description, you would not even need the first static sentence in this case. With the provided set of functions, most LLMs would already know what to do anyways.
Speaking of “most LLMs”, of course the new agent works with all LLMs that support functions. With Theia AI, you can connect to the LLM provider and model of your choice, including self-hosted and local models.
You are a Git Agent supporting the user by managing their local repository.
You can interact with the Git repository using the following functions:
~{mcp_git_git_add}
~{mcp_git_git_commit}
~{mcp_git_git_create_branch}
~{mcp_git_git_diff_staged}
~{mcp_git_git_diff_unstaged}
~{mcp_git_git_log}
~{mcp_git_git_reset}
~{mcp_git_git_status}
~{mcp_git_git_checkout}
~{mcp_git_git_diff}
~{mcp_git_git_show}
Refine your new Git agent with full control!
Our new agent introduced above is now capable of executing Git functions. Depending on the underlying LLM, it will already be more “clever” than plain Git aliases, e.g. it can summarize changes, it can find unrelated changes or it can deal with erroneous states. However, the agent approach really gets interesting if you start to customize it to your personal or project-specific workflows.
For our Git agent, this would mean you describe the branching schema and the general Git workflow you apply in your project. Below you find an example prompt, that describes a typical workflow when working on an open source project such as Theia:
You are a Git Agent supporting the user by managing their local repository.
You can interact with the Git repository using the following functions:
~{mcp_git_git_add}
~{mcp_git_git_commit}
~{mcp_git_git_create_branch}
~{mcp_git_git_diff_staged}
~{mcp_git_git_diff_unstaged}
~{mcp_git_git_log}
~{mcp_git_git_reset}
~{mcp_git_git_status}
~{mcp_git_git_checkout}
~{mcp_git_git_diff}
~{mcp_git_git_show}
All changes should be committed to a separate branch.
If on master/main, create and switch to a new branch before committing.
Ask the user for the issue number if it is unknown.
Ask for the issue description or let the user describe what they did.
If an issue number is known, use the following branch name "GH-{issuenumber}".
If an issue number is known , add "fixed #{issuenumber}" at the end of the commit message.
Suggest a very concise commit message describing the changes and let the user review it
before committing.
With this more specific system prompt, the custom Git agent will be even more useful, as shown in the following video:
Given how easy it is to create, you might wonder why a Git agent isn’t already integrated into Theia IDE. We actually have this on the roadmap, but the custom approach we demonstrated in this article has two major advantages:
- As shown above, you as a user, can adapt the agent to your specific needs and workflows. This is true for custom agents, i.e. the ones you created, but also for the existing agents delivered within the Theia IDE.
- Agents are not restricted to Git, coding or any specific use case. You as a user can easily add new workflows you desire. With the rapidly growing ecosystem of available MCP servers, you can bring your ideas to life, faster than any IDE provider could develop, test and ship them to you.
To provide a concrete example for how the custom agent approach described above could be further extended: As you may have observed, we still had to push and create a pull request manually. Furthermore, we had to copy the ticket description ourselves into the chat. Both tasks, however, can actually be also automated by the AI, because - you guessed it: There is an MCP server supporting Github access and Git operations. Combining all the available bits and pieces, you can realize an AI-driven workflow where:
- The user just specifies the Github issue they want to work on
- The AI will pull all the necessary context
- The user solves the issue with the help of the Theia Coder agent
- When the user is done, the AI assists will switch to a branch, commit your work with a meaningful description and create a PR for you.
Conclusion
By leveraging Theia AI and MCP in the AI-powered Theia IDE and a handful of Git functions, you can supercharge your development workflow with minimal effort. Whether you’re creating new branches, inspecting diffs, or rolling back commits—no more juggling terminal windows or memorizing commands. Grab a well-deserved coffee instead!
Why not give it a try? Set up your custom Agent today, and let AI support you while you focus on coding your next big feature.
To explore more about the AI-powered Theia IDE and Theia AI, check out:
👉 Download the AI-powered Theia IDE
👉 AI-powered Theia IDE User documentation
👉 Introducing the AI-powered Theia IDE
👉 Our service offering for Tailored AI Assistance in Tools and IDEs
Want to take AI-powered tool development even further? EclipseSource provides consulting and implementation services backed by our extensive experience in tool development. We also specialize in tailored AI assistance for web- and cloud-based tools and professional support for Eclipse Theia and VS Code.
👉 Get in touch with us to discuss your specific use case!