Repository navigation
feat(mcp): run the Audius MCP server on validator nodes - #14838
dylanjeffers wants to merge 2 commits into
Conversation
Following Ray's advice that nodes should run MCP rather than a standalone server, the server can now live under a path on a node and ship as one file the node image copies in. - PUBLIC_URL may carry a path (the node uses https://<node>/mcp). All routes, OAuth endpoints, the consent form and its cookie move under it, and discovery follows RFC 8414 / RFC 9728 path-aware URLs. - LISTEN_HOST lets the node keep it on 127.0.0.1 behind its proxy. - npm run bundle builds bundle/audius-mcp.mjs with esbuild (no node_modules needed); the Dockerfile's "bundle" target holds just that. - CI smoke-tests the bundle and, on main, pushes audius/mcp-bundle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Dependency limit exceeded — report not shown. This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report. Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard. Socket is always free for open source. If this is a public open source project under an OSI-approved license, contact us to request a free Business plan upgrade. |
The comment ratchet allows no new comments, so the reasons behind the node packaging and path routing now live in docs/adr. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Before: the Audius MCP server (#14816) only ran as a standalone server on its own host, at the root of that host.
After: an Open Audio Validator Node can run it at
https://<node>/mcp, which is what Ray suggested ("i'd almost like nodes to be running MCP rather than a standalone server"). The standalone setup still works as before.This is stacked on #14816 and only changes how the server is packaged and routed. The tools and auth flow are unchanged.
How
PUBLIC_URLmay now carry a path. Everything moves under it: the MCP endpoint isPUBLIC_URLitself, the OAuth endpoints are<PUBLIC_URL>/authorize|token|register|revoke|auth|callback, and discovery uses the RFC 8414 / RFC 9728 path-aware URLs (/.well-known/oauth-authorization-server/mcp). The SDK'smcpAuthRouterpins its endpoints to the host root, soapp.tsbuilds the same router from the SDK's exported handlers. The consent form action and its cookie path follow the base path.LISTEN_HOSTlets the node keep the server on127.0.0.1behind its own proxy.npm run bundleuses esbuild to turndist/intobundle/audius-mcp.mjs(about 10 MB), which runs on Node 24 with nonode_modules. The Dockerfile gains abundletarget that holds just that file; the default target is still the standalone server.maina new job pushesaudius/mcp-bundle:<sha>and:latest, which the node image copies in.basePath.test.tscover the routes under/mcp, the discovery documents, the 401 challenge, the consent form and a full sign-in through to tool calls. All 69 tests pass locally.The node side is a separate change to OpenAudio/go-openaudio (
pkg/mcp, wiring incmd/openaudio/main.go, and the Dockerfile). It starts this file with Node, restarts it if it exits, and proxies/mcpto it, behindOPENAUDIO_MCP_ENABLED=true. I checked that change locally against this bundle: health, discovery, registration and the consent page all work through the node's proxy, and the storage catch-all still gets every other path.Before rollout
https://<node>/mcp/callbackfor each node that enables it (the API allows 50 redirect URIs per app).audius/mcp-bundle.Generated by Claude Code