Skip to content

feat(studio): X03 serve the published agent as an MCP server - #1119

Merged
LinuxDevil merged 2 commits into
mainfrom
fb-x03-serve-mcp
Nov 14, 2026
Merged

LinuxDevil merged 2 commits into
mainfrom
fb-x03-serve-mcp

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Summary

  • McpServerManager (server/serve/mcpServers.ts) starts/stops the SDK's serveMcp per agent against the published version, reusing the X02a serve bearer token; publish-pointer changes restart a running server, token rotation propagates.
  • Management routes GET/POST /agents/:id/serve/mcp (+ stop) with 409 LOUSHO_NOT_PUBLISHED / 503 LOUSHO_MCP_PEER_MISSING mappings; wired through createApp options, index.ts lifecycle (event subscription + shutdown closeAll).
  • Client: mcpStatus/startMcp/stopMcp runtime methods, useMcpServeStatus hook, and MCP rows on the Serve card (status, start/stop, URL + copyable client snippets) — unpublished agents show a disabled Start.

Test plan

  • mcpServers.test.ts 12 tests (lifecycle, auth token reuse, publish restart, rotate, peer-missing, real serveMcp tools/list over HTTP — skips without the peer)
  • serveRoutes.test.ts 16 tests incl. MCP route integration
  • ServeCard.test.tsx 17 tests incl. MCP section states
  • typecheck (client + server), lint (only pre-existing steerGate error), fallow clean on touched files

Stacked on #1118.

Generated with Devin

Adds an McpServerManager that starts/stops the SDK's serveMcp per agent
against the published version, guarded by the serve bearer token, with
GET/POST /agents/:id/serve/mcp routes, lifecycle wiring in index.ts, and
MCP rows on the Serve card (status, start/stop, URL + client snippets).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@LinuxDevil
LinuxDevil changed the base branch from fb-x02b-serve-card to main November 14, 2026 13:41
# Conflicts:
#	apps/agent-forge/server/index.ts
@LinuxDevil
LinuxDevil merged commit f73f9b3 into main Nov 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant