Feat/mcp client support#59
Open
Nivesh353 wants to merge 2 commits into
Open
Conversation
Connect to MCP servers declared in agent.yaml / SDK mcpServers, register their tools as native AgentTools (namespaced <server>__<tool>), and tear connections down on exit. stdio + HTTP + SSE transports, pagination, name sanitization, abort forwarding, fail-soft connect, recursive JSON Schema conversion. Fully opt-in; SDK not loaded when unused.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds MCP (Model Context Protocol) client support. Declare servers in
agent.yaml(or via the SDKmcpServersoption) and the agent automatically gains those servers' tools — no integration code.Why
Previously, every external capability (GitHub, Postgres, Slack, filesystem…) had to be hand-built and maintained by us as a custom tool/plugin. With MCP, users plug into the whole ecosystem of ready-made servers via a few lines of config, and we maintain none of it. Keeps gitagent aligned with the industry standard (Claude, Cursor, etc.).
How it works
On agent load, gitagent connects to each declared server (stdio / HTTP / SSE), calls
listTools, and registers every tool as a nativeAgentToolnamed<server>__<tool>. Execution forwards the call to the server and returns its result. Connections are pooled for the session and torn down on every exit path.