feat(mcp): agent-native wave phase 1 — bridge MCP forwarding + structured diagnostic errors - #142
Merged
Merged
Conversation
…red diagnostic errors
- viteDevBridge and @devframes/next's createDevframeNextHandler gain an
mcp option, forwarded to createDevServer, and advertise the side-car
endpoint in their connection meta (ConnectionMeta.mcp gains port)
- resolveMcpConnectionMeta shared resolver exported from adapters/dev
- formatMcpError emits structured JSON { error: { code, message, fix,
docs } } for nostics Diagnostics so agents get the actionable next step
- agent-native guide: description-as-prompt, gateway tools, structured
errors conventions
- plans/031 umbrella plan (agent-native MCP wave) + README row
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
antfu
approved these changes
Jul 28, 2026
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.
Why
Plan 031 (agent-native MCP wave, included here) adopts the architecture Vercel's
next-devtools-mcp0.4.0 validated: the real MCP endpoint lives inside the framework, and external tooling just discovers and proxies it. Devframe already serves route-based MCP on the dev server — but neither hosted bridge could enable or advertise it, and coded errors crossed the MCP boundary as flattened strings.What
viteDevBridgeand@devframes/next'screateDevframeNextHandlergain anmcpoption (forwarded tocreateDevServer) and advertise the side-car endpoint in their hand-rolled__connection.json—ConnectionMeta['mcp']gains an optionalportfor side-car origins, mirroring the WS meta. Shared resolverresolveMcpConnectionMetaexported fromdevframe/adapters/dev.formatMcpErrornow emits{ error: { code, message, fix?, docs? } }for nosticsDiagnostics, so agents receive the actionable next step and docs URL instead of a bare message.build-server.tscorrected.plans/031-agent-native-mcp-wave.md(umbrella for the three phases) + README row.Phase 2 (fetch-handler extraction,
read_state, hub commands→agent bridge, git agent flags) and Phase 3 (instance registry,devframe connect, in-process Next MCP, e2e proofs) follow as stacked PRs.Verification
Full gate:
pnpm lint && pnpm test && pnpm typecheck && pnpm build— 886 tests incl. new vite-bridge/next-handler MCP round-trips against a real MCP SDK client; API snapshots updated deliberately (newmcpoptions + metaport).This PR was created with the help of an agent.