Skip to content

feat(mcp): run the Audius MCP server on validator nodes - #14838

Open
dylanjeffers wants to merge 2 commits into
feat/audius-mcp-serverfrom
feat/audius-mcp-node-sidecar
Open

dylanjeffers wants to merge 2 commits into
feat/audius-mcp-serverfrom
feat/audius-mcp-node-sidecar

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

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

  • Path-aware server. PUBLIC_URL may now carry a path. Everything moves under it: the MCP endpoint is PUBLIC_URL itself, 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's mcpAuthRouter pins its endpoints to the host root, so app.ts builds the same router from the SDK's exported handlers. The consent form action and its cookie path follow the base path.
  • LISTEN_HOST lets the node keep the server on 127.0.0.1 behind its own proxy.
  • One-file build. npm run bundle uses esbuild to turn dist/ into bundle/audius-mcp.mjs (about 10 MB), which runs on Node 24 with no node_modules. The Dockerfile gains a bundle target that holds just that file; the default target is still the standalone server.
  • CI. MCP CI now bundles and smoke-tests the file the way a node runs it. On main a new job pushes audius/mcp-bundle:<sha> and :latest, which the node image copies in.
  • Tests. 11 new tests in basePath.test.ts cover 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 in cmd/openaudio/main.go, and the Dockerfile). It starts this file with Node, restarts it if it exits, and proxies /mcp to it, behind OPENAUDIO_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

  • Create the shared "Audius MCP" developer app, and register https://<node>/mcp/callback for each node that enables it (the API allows 50 redirect URIs per app).
  • Make sure the CI Docker Hub account can push to audius/mcp-bundle.
  • Sign-in state is in memory on each node, so the directory URL has to point at one node or a sticky load balancer.

Generated by Claude Code

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>
@changeset-bot

changeset-bot Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 769ec78

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

socket-security Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

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>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants