Skip to content

feat(server): connect claude.ai and other remote MCP clients to a CLI-run server - #65

Merged
volod-vana merged 1 commit into
mainfrom
volod/claude-connector
Sep 26, 2026
Merged

volod-vana merged 1 commit into
mainfrom
volod/claude-connector

Conversation

@volod-vana

@volod-vana volod-vana commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

A Personal Server already speaks remote MCP with OAuth at <public URL>/mcp, which is what claude.ai's custom connectors need. For a server vana server start runs, the OAuth approval step pointed at vana://mcp-authorization, a Vana Desktop link, so the flow dead-ended without Desktop.

What changes

  • The server process (entry.mjs) serves an approval page on 127.0.0.1 (random port) and passes it as mcpOAuthApprovalUrl. New runtime file mcp-approval.mjs, shipped with the runtime and asserted in the pack and SEA checks.
  • The page reads the authorization and the owner's scopes through the server's owner-only API (GET /v1/mcp/oauth/authorizations/:id, GET /v1/data), names the requester from its redirect ("Claude" for claude.ai), lists every scope ticked, and on Approve calls POST .../approve {scopes} and 303s the browser to the client's redirect. Deny 303s back with error=access_denied and the state. Styled like Account (the server 1.25 tokens and logotype), light and dark.
  • Safety: loopback only, Host header must be the page's own (DNS rebinding), a one-time form token per authorization, Origin checked on POST, CSP and frame-ancestors 'none'. The owner token never leaves the server process.
  • vana server status shows MCP URL: <public URL>/mcp to paste into claude.ai.

Verified

  • pnpm validate 516 tests (new: render, approve, deny, forged and reused token, wrong Host, requester name).
  • Live on Volod's mainnet test server: OAuth discovery, dynamic client registration with claude.ai's callback, /mcp/oauth/authorize now redirects to http://127.0.0.1:<port>/mcp?mcp_authorization=..., and the page renders "Allow Claude to read your data" with the account's scopes. Then, end to end in claude.ai (Volod's account, test Vana account on mainnet): Customize, Connectors, Add custom connector with the MCP URL; claude.ai detected OAuth and dynamic client registration on its own; Connect opened the local approval page; Approve returned to claude.ai with "Connected to Vana (test)" and the server's 7 tools listed; a new chat asking "what are my GitHub repos about?" called List granted scopes and Read scope (github.repositories) and answered with the account's real repos.

https://claude.ai/code/session_01Fcv6uEy4zcXaigzDNxeW3j

…-run server

The server's MCP OAuth sent the owner to vana://mcp-authorization, a Vana
Desktop link, so adding a CLI-run server as a claude.ai connector dead-ended
on any machine without Desktop. The server process now serves its own
approval page on 127.0.0.1 and uses it as the approval URL: it shows who is
asking (Claude, from the redirect), lists the owner's scopes ticked, and
approves the chosen ones (or denies back to the client with access_denied)
through the server's owner-only API with the token only that process holds.
Host-checked against DNS rebinding, one-time form token, no framing.

`vana server status` shows the MCP URL to paste into claude.ai
(<public URL>/mcp).

Claude-Session: https://claude.ai/code/session_01Fcv6uEy4zcXaigzDNxeW3j
@volod-vana
volod-vana merged commit d6651f2 into main Sep 26, 2026
7 checks passed
github-actions Bot pushed a commit that referenced this pull request Sep 26, 2026
## [0.35.0](v0.34.0...v0.35.0) (2026-09-26)

### Features

* **server:** connect claude.ai and other remote MCP clients to a CLI-run server ([#65](#65)) ([d6651f2](d6651f2))
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.35.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

1 participant