Skip to content

feat(mcp): answer an MCP agent's scope request on Vana Web or in the terminal - #86

Merged
volod-vana merged 3 commits into
mainfrom
volod/mcp-scope-request-approval
Oct 7, 2026
Merged

volod-vana merged 3 commits into
mainfrom
volod/mcp-scope-request-approval

Conversation

@volod-vana

@volod-vana volod-vana commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

When an agent connected to your Personal Server (Claude, Claude Code, Cursor) needs data it was not given, it calls request_scope_access. Until now nothing on a CLI-run server let the owner answer that. With this PR:

  • The server vana server start runs passes vanaWebMcpScopeRequestApprovalUrl from personal-server-ts 1.30.0, so request_scope_access hands the agent a Vana Web link: https://app.vana.org/mcp/requests/<connection id>?ps_origin=<the server's tunnel URL>. That is the same approval surface as app data requests, and it works from a phone. Moksha uses https://app-dev.vana.org, since the CLI's moksha server already runs on the dev deployment (dev gateway, storage and relay). The page itself is unity-surfaces PR 1517.
  • A --local server (no public https origin), or a server whose tunnel is not up yet, gets no link; the agent is told to wait for approval in Vana.
  • vana mcp requests lists waiting requests (who, scopes, reason, age, what it already has) with the same Vana Web link per request when the server has a public origin (its /health apiOrigin). Without one it says to answer with vana mcp approve <id> or vana mcp deny <id>.
  • vana mcp approve <id> [--scopes a,b] and vana mcp deny <id> answer from the terminal through the owner endpoints, with the PS session token the CLI already holds. All three emit one outcome with --json; exit codes follow the table (2 bad scopes, 5 no server or gateway down, 6 concurrent update, 1 otherwise).
  • vana status adds one "Agents" line while a request waits, and accessRequests in --json.
  • vana mcp with no arguments still runs the stdio MCP server.
  • The MCP OAuth approval page on 127.0.0.1 is unchanged from main. The earlier loopback scope-request page and its .vana-cli-approval.json file are removed.

Server version

Pins personal-server-ts 1.30.0 (PERSONAL_SERVER_VERSION, runtime-pkg package.json and lockfile). The only change since 1.29.2 is personal-server-ts PR 372: the scope-request approve/deny endpoints, grantedScopes in the connection list, GET /v1/mcp/connections/:id, and the approval URL hook. @opendatalabs/personal-server-ts-core is now a direct runtime dependency at the same version because entry.mjs imports the hook from @opendatalabs/personal-server-ts-core/mcp. Install scripts are unchanged (better-sqlite3 12.11.1, secp256k1 5.0.2). A running server picks up 1.30.0 on its next vana server stop && vana server start. Against an older server the commands still list requests and say the server is too old to take the answer.

Tests

  • pnpm validate green (741 tests).
  • Unit tests: the Vana Web link (same encoding as the server hook, no link for http, loopback or missing origins, app-dev on moksha), listing with and without a public origin, JSON outcomes, exit code per server error (including MCP_CONNECTION_NOT_FOUND), --scopes validation, old server, 401, the status line.
  • Installed the pinned runtime from the lockfile and checked that @opendatalabs/personal-server-ts-core/mcp exports the hook and that it builds the same URL the CLI shows.
  • Still to do: a live run on a registered public server with the web page from unity-surfaces PR 1517.

https://claude.ai/code/session_01Fcv6uEy4zcXaigzDNxeW3j

…the terminal

When a connected agent calls request_scope_access, the server vana runs
now hands it a link to a loopback page where the owner ticks which of the
requested scopes to share, or declines. `vana mcp requests`, `vana mcp
approve <id> [--scopes a,b]` and `vana mcp deny <id>` give the same answer
from the terminal, and `vana status` shows one line while a request waits.
`vana mcp` with no arguments still runs the stdio MCP server.

Needs personal-server-ts PR 372 (mcpScopeRequestApprovalUrl and the
scope-request approve/deny endpoints); an older server keeps working and
the commands say it is too old.

Claude-Session: https://claude.ai/code/session_01Fcv6uEy4zcXaigzDNxeW3j
The approval surface for `request_scope_access` is now Vana Web, the same
place app data requests are answered, and it works from a phone. The local
server passes personal-server-ts 1.30.0's
`vanaWebMcpScopeRequestApprovalUrl` hook, so the agent gets
`<web>/mcp/requests/<id>?ps_origin=<tunnel URL>`: app.vana.org on mainnet,
app-dev.vana.org on moksha (served by the dev deployment). A `--local`
server has no public https origin and gets no link.

The loopback scope-request page and `.vana-cli-approval.json` are gone; the
MCP OAuth approval page is back to what main has. `vana mcp requests` shows
the same Vana Web link per request when the server has a public origin
(from its /health `apiOrigin`), and otherwise says to answer with
`vana mcp approve|deny`. An unknown connection's MCP_CONNECTION_NOT_FOUND
maps to not_found.

Pins personal-server-ts 1.30.0 (and its core package, which entry.mjs now
imports directly).

Claude-Session: https://claude.ai/code/session_01Fcv6uEy4zcXaigzDNxeW3j
@volod-vana volod-vana changed the title feat(mcp): approve an MCP agent's scope request from a local page or the terminal feat(mcp): answer an MCP agent's scope request on Vana Web or in the terminal Oct 7, 2026
@volod-vana
volod-vana merged commit 00c19ca into main Oct 7, 2026
6 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 7, 2026
## [0.39.0](v0.38.10...v0.39.0) (2026-10-07)

### Features

* **mcp:** answer an MCP agent's scope request on Vana Web or in the terminal ([#86](#86)) ([00c19ca](00c19ca))
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.39.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