feat(framework): add first-class mcpServers field to AgentInvocation#409
Merged
feat(framework): add first-class mcpServers field to AgentInvocation#409
Conversation
Replace the untyped extensions bag with a typed mcpServers field on AgentInvocation. Both CopilotBackend and ClaudeBackend now iterate mcpServers and emit the appropriate CLI flags (--additional-mcp-config / --mcp-config). Remove unused extensions fields from AgentResult and InvocationMetric.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #409 +/- ##
==========================================
- Coverage 91.36% 91.32% -0.04%
==========================================
Files 213 213
Lines 22862 22872 +10
Branches 3583 3585 +2
==========================================
Hits 20887 20887
- Misses 1927 1937 +10
Partials 48 48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Replace the untyped
extensionsbag with a typedmcpServersfield onAgentInvocation. BothCopilotBackendandClaudeBackendnow iteratemcpServersand emit the appropriate CLI flags (--additional-mcp-config/--mcp-config).Changes
packages/framework/src/runtime/context/types.tsAgentInvocation: replacedextensions?: Record<string, unknown>withmcpServers?: Record<string, { url: string }>— typed, explicit, self-documentingAgentResult: removed unusedextensionsfieldpackages/framework/src/runtime/launch-with-events.tsInvocationMetric: removed unusedextensionsfieldpackages/framework/src/runtime/backend/backend.tsCopilotBackend.invoke(): iteratesinvocation.mcpServersand pushes--additional-mcp-configper serverClaudeBackend.invoke(): iteratesinvocation.mcpServersand pushes--mcp-configper server (withtype: 'url'wrapper)Motivation
The
extensionsfield was a speculative untyped escape hatch (Record<string, unknown>) that was never set or read by any code — not by cadre itself, not by any consumer. Making MCP server forwarding a first-class typed field:ascasts in the backends