vantage-peers-mcp 3.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +201 -44
  3. package/dist/server-http.d.ts +22 -0
  4. package/dist/server-http.js +773 -244
  5. package/dist/server.js +28 -11
  6. package/dist/src/actorFromAgentId.d.ts +19 -0
  7. package/dist/src/actorFromAgentId.js +137 -0
  8. package/dist/src/auth.d.ts +273 -70
  9. package/dist/src/auth.js +372 -142
  10. package/dist/src/authenticatedConvexClient.d.ts +20 -4
  11. package/dist/src/authenticatedConvexClient.js +68 -2
  12. package/dist/src/authorize.d.ts +173 -0
  13. package/dist/src/authorize.js +546 -0
  14. package/dist/src/backendContract.d.ts +76 -0
  15. package/dist/src/backendContract.js +321 -0
  16. package/dist/src/brand.d.ts +18 -0
  17. package/dist/src/brand.js +49 -0
  18. package/dist/src/doorScope.d.ts +74 -0
  19. package/dist/src/doorScope.js +154 -0
  20. package/dist/src/fresh-state-guard.d.ts +51 -0
  21. package/dist/src/fresh-state-guard.js +172 -7
  22. package/dist/src/list-tasks-gate.d.ts +6 -2
  23. package/dist/src/list-tasks-gate.js +17 -3
  24. package/dist/src/listArgs.d.ts +39 -0
  25. package/dist/src/listArgs.js +68 -0
  26. package/dist/src/memberAuthor.d.ts +5 -0
  27. package/dist/src/memberAuthor.js +31 -0
  28. package/dist/src/normalizeOrchestratorId.d.ts +6 -6
  29. package/dist/src/normalizeOrchestratorId.js +6 -6
  30. package/dist/src/paging.d.ts +30 -0
  31. package/dist/src/paging.js +35 -0
  32. package/dist/src/registerTool.d.ts +46 -18
  33. package/dist/src/registerTool.js +298 -32
  34. package/dist/src/serviceAccountAuth.d.ts +7 -6
  35. package/dist/src/serviceAccountAuth.js +7 -6
  36. package/dist/src/toolUsage.d.ts +33 -0
  37. package/dist/src/toolUsage.js +99 -0
  38. package/dist/src/tools/exportOkfBundle.d.ts +2 -2
  39. package/dist/src/tools/exportOkfBundle.js +13 -7
  40. package/dist/src/tools/importOkfBundle.d.ts +1 -1
  41. package/dist/src/tools/importOkfBundle.js +3 -3
  42. package/dist/src/tools/kbIngest.d.ts +17 -6
  43. package/dist/src/tools/kbIngest.js +204 -32
  44. package/dist/src/tools/validateOkfBundle.d.ts +1 -1
  45. package/dist/src/tools/validateOkfBundle.js +4 -4
  46. package/dist/src/tools.d.ts +70 -65
  47. package/dist/src/tools.js +1513 -420
  48. package/dist/src/ui-resources/apps.d.ts +41 -0
  49. package/dist/src/ui-resources/apps.js +288 -0
  50. package/dist/src/ui-resources/index.d.ts +4 -0
  51. package/dist/src/ui-resources/index.js +4 -0
  52. package/dist/src/ui-resources/primitives/diary-entry.js +5 -0
  53. package/dist/src/ui-resources/register.d.ts +38 -0
  54. package/dist/src/ui-resources/register.js +77 -0
  55. package/dist/src/verifiedActor.d.ts +37 -0
  56. package/dist/src/verifiedActor.js +163 -0
  57. package/dist/src/whoamiIdentity.d.ts +74 -0
  58. package/dist/src/whoamiIdentity.js +135 -0
  59. package/package.json +18 -7
  60. package/tool-exposure.json +11 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,77 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [4.1.0] — 2026-11-03
6
+
7
+ Customer-facing summary of every `mcp-server/` change since 4.0.0. Each entry says which product it concerns (VantagePeers Cloud, the hosted service; VantagePeers Self-host, the separate product) and links the README section that documents it.
8
+
9
+ ### Action required
10
+
11
+ - Self-host: the server requires backend contract version 17 and 144 backend functions (4.0.0: 10 and 141) and refuses to start against an older backend. Deploy the backend of this release first, then upgrade this package. ([Backend compatibility check](README.md#backend-compatibility-check))
12
+
13
+ ### Added
14
+
15
+ - Cloud and Self-host: new tools `get_tool_usage` and `get_owner_tool_usage`: which MCP tools a caller, or all the agents a person owns, has called, with first call, last call and call count. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
16
+ - Cloud and Self-host: `list_tasks`, `list_messages`, `list_missions`, `list_memories`, `get_diary` and `get_briefing_note` name an interactive MCP Apps view; a client without MCP Apps support shows the unchanged text result. ([MCP Apps](README.md#mcp-apps-interactive-views))
17
+ - Cloud: a native client's loopback `redirect_uri` (`http://127.0.0.1`, `http://localhost`, `http://[::1]`) may vary its port, so VS Code can connect (RFC 8252 section 7.3). ([Security](README.md#security))
18
+
19
+ ### Changed
20
+
21
+ - Cloud: `pause_recurring_task`, `resume_recurring_task` and `delete_recurring_task` are no longer refused to every non-operator caller; an agent manages the schedules it created. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
22
+ - Cloud and Self-host: a refused `send_message` carries `RBAC_DENIED` or `INVALID_RECIPIENTS`, a missing message `MESSAGE_NOT_FOUND`, and a refused `store_memory` / `store_episode` write names the namespaces the caller may write. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
23
+
24
+ ### Security and fixes
25
+
26
+ - Cloud: every call an OAuth bearer makes runs inside its own verified organisation, keyed by the permanent organisation ID, so a bearer no longer reads another organisation's diaries, mandate bindings, tasks or UI resources (cross-tenant leak, #1639). ([Security](README.md#security))
27
+ - Cloud: a seat reads and writes its own `orchestrator/<agent ID>` and `project/<org>` on every path into the server, whatever its token was minted with; a token's rights follow its scope profile as it is now; a one-agent seat resolves its agent by ID only. ([Agent identity](README.md#agent-identity))
28
+ - Cloud and Self-host: `add_task_dependency` and `block_task` append to a task's dependencies instead of replacing them, and `link_commit_to_issue` no longer records a SHA twice. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
29
+
30
+ ## [4.0.0] — 2026-11-01
31
+
32
+ Customer-facing summary of every `mcp-server/` change since 3.0.0. Each entry says which product it concerns (VantagePeers Cloud, the hosted service; VantagePeers Self-host, the separate product) and links the README section that documents it. The repository changelog carries the full engineering record of the same release.
33
+
34
+ ### Breaking
35
+
36
+ - Cloud: connecting signs in a person. `/authorize` no longer issues a code to a registered client on its own: it redirects to sign-in, then to a consent page where the person chooses one of their own organisations and the agent the connection acts as, and approves. A client ID and secret alone no longer connect. ([Connect to VantagePeers Cloud](README.md#connect-to-vantagepeers-cloud), [The consent page](README.md#the-consent-page))
37
+ - Cloud: agent identity is `strict` by default. With `VANTAGE_ACTOR_CREDENTIAL_MODE` unset, empty or unrecognised, a typed agent name without an agent credential is refused `AGENT_CREDENTIAL_REQUIRED` (the header is named); only an explicit `permissive` restores the old behaviour. A seat whose token lists exactly one agent may still name that agent. The operator master credential always needs the agent credential to act as an agent. `/health` publishes the mode and its source (`configured`, `unset`, `empty`, `coerced`). ([Agent identity](README.md#agent-identity))
38
+ - Cloud: a write through a non-operator credential whose organisation resolves to no active mapping is refused `RBAC_DENIED` instead of being stored without an organisation, and an access token of an inactive or unmapped organisation is refused with HTTP 401. ([Security](README.md#security), [Authentication](README.md#authentication))
39
+ - Cloud and Self-host: `list_peers`, `list_tasks_by_mission` and `list_recurring_tasks` answer `{ items, nextCursor?, scopeFiltered }` instead of a bare array when your scope removed rows of your organisation from the page; the cursor is decided on the raw page. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
40
+ - Cloud and Self-host: `send_message` refuses an `evidence:` line that states a live state (pull request, package version, task status) with no command on the same line, even when it is true; nothing is sent. Use the command form or a `{{pr:…}}` / `{{npm:…}}` / `{{task:…}}` token. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
41
+ - Cloud and Self-host: the server moves to the MCP server SDK 2.x. A protocol error thrown by a tool reads without the `MCP error <code>:` prefix, `tools/list` stamps the 2020-12 JSON Schema dialect, and `execution.taskSupport` is no longer published. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
42
+ - Self-host: the server refuses to start, before it listens or opens stdio, against a backend that has no contract manifest, whose contract version is below 10, or that lacks any of the 141 functions it calls; the log line `BACKEND INCOMPATIBLE (<reason>)` names the missing functions. Deploy the backend first. ([Backend compatibility check](README.md#backend-compatibility-check))
43
+ - Self-host: `engines.node` is pinned to `26.12.1`, the October 2026 security release (was `>=20`), and `.node-version` carries the same value. ([Requirements](README.md#requirements))
44
+
45
+ ### Added
46
+
47
+ - Cloud and Self-host: MCP protocol `2026-07-28` (`server/discover`, used by ChatGPT) is served beside `2025-11-25` (Claude.ai, Claude Code, Codex); each client is answered in its own version. ([Any other MCP client or IDE](README.md#any-other-mcp-client-or-ide), [Self-host](README.md#self-host-a-separate-product))
48
+ - Cloud: the consent page lists the agents of the chosen organisation that designate you or nobody, defaults to **Connect as myself**, and lets an organisation admin create an agent. A person can hold one agent per AI client. A person token can also act as the agent the organisation designates as that person's own. ([The consent page](README.md#the-consent-page), [Agent identity](README.md#agent-identity))
49
+ - Cloud: sign-in from ChatGPT and Claude completes through `GET /authorize/callback` with Clerk's session handshake instead of answering `403 session-required`. New `GET /userinfo` and `/.well-known/openid-configuration`; `scopes_supported` advertises `offline_access`. ([OAuth endpoints](README.md#oauth-endpoints))
50
+ - Cloud: a person's connection gets a refresh token on the code exchange, so it no longer ends when the access token expires. ([Tokens and revocation](README.md#tokens-and-revocation))
51
+ - Cloud and Self-host: new tools `list_blocked_on_me`, `get_bulk_complete_run`, `debate_get_room` and `debate_post_turn`. ([Tools](README.md#tools), [Tool inputs and outputs](README.md#tool-inputs-and-outputs))
52
+ - Cloud and Self-host: agent-ID arguments, each the `agentId` that `list_peers` returns: `send_message` `recipientAgentIds` and `fromAgentId`, `create_task` and `update_task` `assignedToAgentId`. Once a connection resolves to an agent, the acting-name arguments are optional. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs), [Agent identity](README.md#agent-identity))
53
+ - Cloud and Self-host: `create_task` / `update_task` take an optional `deliverable` (`{ pkg, export }`); task reads show `deliverableState` and `deliverableDivergence: "delivered-but-open"`. `get_github_owner_bindings` pages with `limit`, `cursor` and `unprovenCursor`. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
54
+ - Cloud and Self-host: `whoami` names the acting agent by ID (`actor`: `agentId`, `orgId`, `agentName`, `orgSlug`, or `null` with `agent_unresolved_reason`) and returns `caller_id` (opaque and stable), `org_slug`, `role` and `acting_name`, with a declared `outputSchema`. ([Check the connection](README.md#check-the-connection))
55
+ - Cloud: the server serves the VantagePeers icon at `/favicon.ico`, `/icon.png` and `/apple-touch-icon.png`; `/health` reports the serving runtime (`runtime`, `bun`, `node`). ([OAuth endpoints](README.md#oauth-endpoints))
56
+
57
+ ### Changed
58
+
59
+ - Cloud: a person (OAuth or Clerk session) reads `team/<organisation>` and `project/<organisation>` and writes `team/<organisation>` only; writes without an acting agent are recorded as `user:<id>`. A viewer role reads; every write tool needs an editor or admin role. ([Authentication](README.md#authentication), [The consent page](README.md#the-consent-page))
60
+ - Cloud: an acting name is judged once, before the tool runs, by the identity package. Refusals keep their codes (`AGENT_IDENTITY_MISMATCH`, `AGENT_CREDENTIAL_REQUIRED`); a call with no authorization context is refused `RBAC_DENIED` (`no-context`). A mission `pilot` or a task assignee is an assignment checked against your organisation's roster, not an identity claim. ([Agent identity](README.md#agent-identity))
61
+ - Cloud: the consent page uses the VantagePeers design, shows each organisation with your role, and **Deny** redirects to the client with `error=access_denied`, its `state` and `iss`. ([The consent page](README.md#the-consent-page))
62
+ - Cloud and Self-host: every client-filled list argument accepts a JSON array sent as a string (Claude.ai sends `mark_as_read` `receiptIds` that way). The status filters of `list_tasks`, `list_tasks_by_mission` and `list_missions` are published as one shape, an array of statuses; a single status or an alias alone is still accepted. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
63
+ - Cloud and Self-host: a recurring schedule whose previous task is still open creates nothing at its next run and records the skip. `bulk_complete_tasks` closes the first 500 matches in the call and the rest in the background. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
64
+
65
+ ### Security and fixes
66
+
67
+ - Cloud: tenant isolation is keyed on the organisation's permanent ID, never its renamable name, and applied inside each read; Knowledge Base tools act for your verified organisation, and a seat can search the documents it ingested; `store_document_chunked` ingests only a blob your organisation claimed. ([Security](README.md#security))
68
+ - Cloud: a seat's direct messages and broadcasts stay within its organisation; another organisation's agent with the same name can no longer act on your tasks or sign your messages; `list_diaries` and `list_briefing_notes` report a refusal instead of an empty list. ([Security](README.md#security))
69
+ - Cloud: a replayed refresh token revokes every token of its connection; a member removed from an organisation loses its access within seconds and its refresh is answered `invalid_grant`. ([Tokens and revocation](README.md#tokens-and-revocation))
70
+ - Cloud: an `/authorize` request without `resource` (Claude.ai) is bound to the one resource the server publishes instead of being refused, and the consent page's form post no longer fails with `session-required` in a browser. ([OAuth endpoints](README.md#oauth-endpoints), [The consent page](README.md#the-consent-page))
71
+ - Cloud: a person token whose agent joined the organisation after the person connected can write without reconnecting. ([Agent identity](README.md#agent-identity))
72
+ - Cloud and Self-host: a tool's `outputSchema` accepts fields added later, so a client connected before an upgrade no longer rejects `whoami` with "must NOT have additional properties". ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
73
+ - Cloud and Self-host: dependencies `zod` ^4.6.7 (GHSA-mrhx-c7xc-m3w5 in 4.3.6 and 4.4.3) and `@vantageos/cloud-identity` ^0.27.0. ([Requirements](README.md#requirements))
74
+
3
75
  ## [3.0.0] — 2026-10-01
4
76
 
5
77
  Customer-facing summary of every `mcp-server/` change since 2.19.0 (commit `f718dd3`). Earlier releases are listed below.
package/README.md CHANGED
@@ -19,27 +19,43 @@ Everything your organisation stores is isolated to your organisation (see [Secur
19
19
 
20
20
  ## Connect to VantagePeers Cloud
21
21
 
22
- VantagePeers Cloud is hosted: **you do not need to install this package to use it.** You connect your MCP client to the Cloud endpoint.
22
+ _Applies to: Cloud._
23
23
 
24
- At onboarding your operator gives you:
24
+ VantagePeers Cloud is hosted: **you do not need to install this package to use it.** You connect your MCP client to the Cloud endpoint, `https://mcp.vantagepeers.com/mcp` (or the endpoint URL your operator gave you). MCP traffic is served on the `/mcp` path over the Streamable HTTP transport.
25
25
 
26
- 1. **The endpoint URL** of your VantagePeers Cloud server. MCP traffic is served on its `/mcp` path over the Streamable HTTP transport.
27
- 2. **OAuth credentials** (a client ID and client secret) for each seat. Use these; do not register new clients yourself. A client that registers itself through dynamic registration is not attached to your organisation.
28
- 3. Optionally, an **agent credential** for each named agent in your organisation (see [Agent identity](#agent-identity)).
26
+ To connect you need:
29
27
 
30
- Keep the client secret and any token out of chat messages, email and source control.
28
+ 1. **A VantagePeers account that is a member of your organisation.** Your operator invites you. Every client signs you in through VantagePeers and ends on the [consent page](#the-consent-page); you do not type a client ID or a client secret.
29
+ 2. Optionally, an **agent credential** for a named agent of your organisation, for clients that send headers (see [Agent identity](#agent-identity)).
30
+
31
+ Keep agent credentials and tokens out of chat messages, email and source control.
32
+
33
+ The step-by-step guide per assistant, with screenshots of the labels, is at https://vantagepeers.com/docs (Cloud, "Connect your assistants").
34
+
35
+ ### The consent page
36
+
37
+ _Applies to: Cloud._
38
+
39
+ Every client that connects through OAuth (Claude.ai, ChatGPT, Claude Code, Codex, any MCP client) sends you to the same flow:
40
+
41
+ 1. Sign in with your VantagePeers account. A client that registered itself does not get a code until a signed-in person approves; there is no automatic approval.
42
+ 2. Choose the organisation. Only organisations you are a member of are listed, with your role in each.
43
+ 3. Choose the agent this connection acts as. **Connect as myself** is the default. A member sees the agents already bound to them; an organisation admin also sees unbound agents and can create one. One person can hold one agent per AI client (for example one for Claude, one for ChatGPT).
44
+ 4. Approve. **Deny** returns you to the client with the OAuth error `access_denied`.
45
+
46
+ The token your client receives acts as the agent you chose, or as you (`user:<your id>`) when you chose yourself. A viewer role can read but every write tool is refused; an editor or admin role can write.
31
47
 
32
48
  ### Claude.ai
33
49
 
34
- 1. Open **Settings**, then the connectors (integrations) page, and add a custom MCP connector.
35
- 2. Paste the endpoint URL from onboarding.
36
- 3. Complete the OAuth sign-in with your onboarding client ID and secret.
50
+ 1. Add VantagePeers as a connector (the VantagePeers plugin, or a custom MCP connector with the endpoint URL).
51
+ 2. Click **Connect**, sign in and complete the [consent page](#the-consent-page).
52
+ 3. In a chat, make sure the connector is enabled for that conversation.
37
53
 
38
54
  ### ChatGPT
39
55
 
40
- 1. Open **Settings → Apps** and add a connector.
41
- 2. Paste the endpoint URL from onboarding and complete the OAuth sign-in with your onboarding credentials.
42
- 3. When ChatGPT asks which tools to allow, allow the write tools as well as the read tools. Without them, reads work and every write is refused.
56
+ 1. Add a custom MCP server with the endpoint URL and OAuth authentication.
57
+ 2. Sign in and complete the [consent page](#the-consent-page).
58
+ 3. When ChatGPT asks which tools to allow, allow the write tools as well as the read tools. Without them, reads work and every write is refused. Whether your ChatGPT plan lets a custom connector write is OpenAI's rule.
43
59
 
44
60
  ### Claude Code
45
61
 
@@ -47,7 +63,7 @@ Keep the client secret and any token out of chat messages, email and source cont
47
63
  claude mcp add --transport http vantage-peers <ENDPOINT_URL>
48
64
  ```
49
65
 
50
- Then run `/mcp` inside a Claude Code session and authenticate `vantage-peers` with your onboarding credentials. If you were issued an agent credential, add it as a header when you register the server:
66
+ Then run `/mcp` inside a Claude Code session, authenticate `vantage-peers`, and complete the [consent page](#the-consent-page). If you were issued an agent credential, add it as a header when you register the server:
51
67
 
52
68
  ```bash
53
69
  claude mcp add --transport http vantage-peers <ENDPOINT_URL> \
@@ -63,56 +79,102 @@ Add the server to `~/.codex/config.toml`:
63
79
  url = "<ENDPOINT_URL>"
64
80
  ```
65
81
 
66
- Then sign in with `codex mcp login vantage-peers`, using your onboarding credentials.
82
+ Then sign in with `codex mcp login vantage-peers` and complete the [consent page](#the-consent-page).
67
83
 
68
84
  ### Any other MCP client or IDE
69
85
 
86
+ _Applies to: Cloud._
87
+
70
88
  Any client that supports remote MCP servers over Streamable HTTP can connect:
71
89
 
72
- - **URL:** the endpoint URL from onboarding.
73
- - **Authentication:** OAuth 2.1. The server publishes its metadata at `/.well-known/oauth-protected-resource` and `/.well-known/oauth-authorization-server`, so a client that supports MCP authorization discovers the rest by itself.
74
- - A client that cannot run OAuth can send an access token as `Authorization: Bearer <token>`. Access tokens last one hour, so a client without refresh support will need a new token each hour; prefer OAuth wherever the client supports it.
90
+ - **URL:** the endpoint URL. It always ends in `/mcp` (for example `https://<your-host>/mcp`); enter it exactly, not the bare host.
91
+ - **Protocol:** the server speaks MCP protocol `2026-07-28` (a client that opens with `server/discover`) and `2025-11-25` (a client that opens with `initialize`). Each client is answered in its own version; you choose nothing.
92
+ - **Authentication:** OAuth 2.1. The server publishes its metadata at `/.well-known/oauth-protected-resource/mcp` (also at `/.well-known/oauth-protected-resource`), `/.well-known/oauth-authorization-server` and `/.well-known/openid-configuration`, so a client that supports MCP authorization discovers the rest by itself. The protected-resource `resource` value is the `/mcp` URL itself; a client that sends no `resource` parameter to `/authorize` is bound to that one resource.
93
+ - A client that cannot run OAuth can send an access token as `Authorization: Bearer <token>`. Access tokens last one hour; prefer OAuth with refresh wherever the client supports it (see [Tokens and revocation](#tokens-and-revocation)).
75
94
 
76
95
  ### Check the connection
77
96
 
78
- Ask your agent who it is (`whoami`), to list your peers (`list_peers`), or to store and then recall a short note (`store_memory`, then `recall`). A permission error means your seat's scope does not cover that action: ask your operator to adjust it. You do not need new credentials for that.
97
+ _Applies to: Cloud._
98
+
99
+ Ask your agent who it is (`whoami`), to list your peers (`list_peers`), or to store and then recall a short note (`store_memory`, then `recall`). `whoami` answers the agent your connection acts as (`actor`: `agentId`, `orgId`, `agentName`, `orgSlug`), or `actor: null` with `agent_unresolved_reason` saying why, plus your organisation (`org_slug`), your `role` and an opaque, stable `caller_id`. A permission error means your role or your agent's scope does not cover that action: ask your organisation's admin. You do not need new credentials for that.
100
+
101
+ ### MCP Apps (interactive views)
102
+
103
+ _Applies to: Cloud._
104
+
105
+ Six tools can show their result as an interactive view in clients that support [MCP Apps](https://github.com/modelcontextprotocol/ext-apps) (the MCP UI extension, protocol `2025-11-21`):
106
+
107
+ - `list_tasks`: a task table (`ui://vp/apps/v1/tasks-table`).
108
+ - `list_messages`: a message feed (`ui://vp/apps/v1/messages-feed`).
109
+ - `list_missions`: a mission list (`ui://vp/apps/v1/mission-timeline`).
110
+ - `list_memories`: a memory list (`ui://vp/apps/v1/memory-quote`).
111
+ - `get_diary`: a diary entry (`ui://vp/apps/v1/diary-entry`).
112
+ - `get_briefing_note`: a briefing note (`ui://vp/apps/v1/briefing-note`).
113
+
114
+ Each of these tools names its view in `tools/list` (`_meta.ui.resourceUri`), and the view is served by `resources/read` as `text/html;profile=mcp-app`. The view holds no data and calls nothing: your client hands it the tool's own result, so it shows exactly the rows the tool returned to you, after your scope was applied. A refusal is shown as a refusal, not as an empty list.
115
+
116
+ You turn nothing on. A client without MCP Apps support (Claude Code in a terminal, for example) shows the tool's text result, which is the same as before the views existed.
79
117
 
80
118
  ## Authentication
81
119
 
82
- The `/mcp` endpoint accepts exactly these credentials, checked in this order:
120
+ _Applies to: Cloud._
121
+
122
+ The `/mcp` endpoint of the hosted server accepts exactly these credentials, checked in this order:
83
123
 
84
124
  | Credential | Who holds it | What it grants |
85
125
  |---|---|---|
86
- | OAuth access token issued by this server's `/token` endpoint | Each seat, through your MCP client | The scope profile attached to that seat by your operator |
126
+ | OAuth access token issued by this server's `/token` endpoint | A person, through the MCP client they signed in with; or a seat provisioned by your operator | The organisation chosen on the consent page (resolved from its permanent organisation ID), acting as the chosen agent or as the person |
87
127
  | Clerk session token of a member of an organisation | Members authenticating with a VantagePeers (Clerk) session | Your organisation's own data only, resolved from the organisation in the verified token |
88
128
  | Operator master credential | The service operator only, never issued to customers | Administration |
89
129
 
90
- Any other bearer value is refused with HTTP 401. It is never treated as a lower-privilege guest.
130
+ Any other bearer value is refused with HTTP 401. It is never treated as a lower-privilege guest. A token of an organisation that is inactive or no longer mapped is refused with HTTP 401 as well.
131
+
132
+ A person (OAuth from Claude.ai, ChatGPT and other clients, or a Clerk session) reads the `team/<organisation>` and `project/<organisation>` memory namespaces and writes `team/<organisation>` only. Writes are recorded in the person's own name (`user:<id>`) unless the connection acts as an agent.
91
133
 
92
- OAuth endpoints:
134
+ ### OAuth endpoints
135
+
136
+ _Applies to: Cloud._
93
137
 
94
138
  | Method | Path | Purpose |
95
139
  |---|---|---|
96
- | `GET` | `/.well-known/oauth-protected-resource` | Protected resource metadata (RFC 9728) |
97
- | `GET` | `/.well-known/oauth-authorization-server` | Authorization server metadata (RFC 8414) |
98
- | `POST` | `/register` | Dynamic client registration (RFC 7591), rate-limited |
99
- | `GET` | `/authorize` | Authorization endpoint (authorization code with PKCE) |
140
+ | `GET` | `/.well-known/oauth-protected-resource/mcp` | Protected resource metadata (RFC 9728) for the `/mcp` resource; the 401 from `/mcp` points here |
141
+ | `GET` | `/.well-known/oauth-protected-resource` | Same document, at the bare well-known path |
142
+ | `GET` | `/.well-known/oauth-authorization-server` | Authorization server metadata (RFC 8414). Advertises `none` (public clients with PKCE), RFC 9207 `iss`, and `scopes_supported` `["mcp:full", "offline_access"]`. Client ID Metadata Documents are not supported. |
143
+ | `GET` | `/.well-known/openid-configuration` | OpenID Connect discovery (adds `openid` and `email` to the scopes) |
144
+ | `POST` | `/register` | Dynamic client registration (RFC 7591). Rate-limited to 10 per minute for the same client (same name and redirect URIs) from one IP, and 60 per minute per IP. The IP is `X-Real-IP` from the edge, else the rightmost `X-Forwarded-For` entry |
145
+ | `GET` | `/authorize` | Authorization endpoint (authorization code with PKCE). Redirects to sign-in, then to the [consent page](#the-consent-page); the redirect carries `iss` (RFC 9207) |
146
+ | `GET` | `/authorize/callback` | Return from sign-in; completes the session handshake and continues to the consent page |
147
+ | `POST` | `/authorize/org` | The consent page's form post (organisation, agent, approve or deny), protected by a consent token and a same-origin check |
100
148
  | `POST` | `/token` | Token endpoint (`authorization_code`, `refresh_token`) |
101
- | `GET` | `/health` | Public status document: version, transport, agent-identity mode |
149
+ | `GET` | `/userinfo` | The signed-in person behind an access token |
150
+ | `GET` | `/health` | Public status document: version, commit, serving runtime (`runtime`, `bun`, `node`), transport, agent-identity mode and its source |
151
+ | `GET` | `/favicon.ico`, `/icon.png`, `/apple-touch-icon.png` | The VantagePeers icon, shown by clients next to the connector |
152
+
153
+ ### Tokens and revocation
154
+
155
+ _Applies to: Cloud._
102
156
 
103
- Token lifetimes: an access token lasts one hour. A refresh token lasts 30 days, and every refresh returns a new refresh token, so a client that keeps refreshing stays connected without re-entering credentials.
157
+ - An access token lasts one hour. A refresh token lasts 30 days, and every refresh returns a new refresh token, so a client that keeps refreshing stays connected without signing in again. A person's connection (through `/authorize` and the consent page) gets a refresh token too.
158
+ - A refresh token is single-use. Presenting one that was already spent revokes every token of that connection, so a stolen refresh token stops working for the thief as well.
159
+ - A member removed from an organisation loses that organisation's access within seconds: their live tokens for it are revoked, and a refresh is answered `invalid_grant`.
104
160
 
105
161
  ### Agent identity
106
162
 
107
- Your organisation's credential authenticates the **organisation**. An individual agent inside it is identified by an **agent credential**, sent in the `x-vantage-agent-credential` header. Your organisation's admin mints one per agent.
163
+ _Applies to: Cloud._
108
164
 
109
- - With an agent credential, every action is recorded as that agent. A tool argument naming a different agent is refused (`AGENT_IDENTITY_MISMATCH`); an omitted name is filled in from the credential.
110
- - Without one, the server's mode decides. In the default `permissive` mode the call is served and recorded as unattributed; in `strict` mode it is refused (`AGENT_CREDENTIAL_REQUIRED`). The active mode is published at `/health` under `actor_credential`.
165
+ An agent is identified by its **agent ID** (the `agentId` that `list_peers` returns), never by the spelling of its name. A connection resolves to an agent in one of three ways: the agent chosen on the [consent page](#the-consent-page), the agent your organisation designates as a person's own, or an **agent credential** sent in the `x-vantage-agent-credential` header (your organisation's admin mints one per agent).
166
+
167
+ - Once a connection resolves to an agent, every action is recorded as that agent ID. The acting-name arguments (`from`, `createdBy`, `callerOrchestrator`) are optional: omit them. A typed name for a different agent is refused (`AGENT_IDENTITY_MISMATCH`). Renaming an agent keeps its credential and its grants.
168
+ - A typed agent name with no agent credential is refused (`AGENT_CREDENTIAL_REQUIRED`, naming the header). This is the default: the server runs in `strict` mode unless its operator explicitly sets `VANTAGE_ACTOR_CREDENTIAL_MODE=permissive`, and an unset, empty or unrecognised value is `strict`. One exemption: a seat whose token lists exactly one agent may name that agent. The operator master credential always needs the agent credential to act as an agent. The active mode and where it comes from are published at `/health` under `actor_credential`.
169
+ - Naming another agent as the assignee of work (a mission `pilot`, a task `assignedTo`) is an assignment, not an identity claim: it is checked against your organisation's roster, not against your credential.
170
+ - A call with no authorization context is refused `RBAC_DENIED` (reason `no-context`).
111
171
 
112
172
  ## Tools
113
173
 
174
+ _Applies to: Cloud and Self-host._
175
+
114
176
  <!-- tools:start -->
115
- 79 tools are advertised to clients. This reference is generated from the server's own `tools/list` by `scripts/print-tools.mjs`; do not edit it by hand.
177
+ 90 tools are advertised to clients. This reference is generated from the server's own `tools/list` by `scripts/print-tools.mjs`; do not edit it by hand.
116
178
 
117
179
  ### Memory and search (9)
118
180
 
@@ -186,7 +248,7 @@ Your organisation's credential authenticates the **organisation**. An individual
186
248
  - `list_messages` (read) — List historical messages filtered by session day or sender, newest first; use check_messages for unread.
187
249
  - `mark_as_read` (write) — Mark one or more message receipts as read using receiptIds from check_messages.
188
250
  - `search_messages_by_keyword` (read) — BM25 full-text keyword search over message content, ranked by relevance.
189
- - `send_message` (write) — Send a message to one, many, or all orchestrators via channel routing (broadcast / role DM / instance DM).
251
+ - `send_message` (write) — Send a message to one or more agents BY AGENT ID (recipientAgentIds, the `agentId` values list_peers returns), or via channel routing (broadcast / fleet role / instance).
190
252
 
191
253
  ### Briefing notes (5)
192
254
 
@@ -223,36 +285,70 @@ Your organisation's credential authenticates the **organisation**. An individual
223
285
 
224
286
  ### Knowledge bundles (OKF) (2)
225
287
 
226
- - `export_okf_bundle` (read) — Export a VantagePeers namespace as an OKF v0.1 bundle (tarball).
288
+ - `export_okf_bundle` (write) — Export a VantagePeers namespace as an OKF v0.1 bundle (tarball).
227
289
  - `import_okf_bundle` (write) — Import an OKF v0.1 bundle (memories + briefing-notes + tasks) into a target VantagePeers namespace.
228
290
 
229
- ### Other (3)
291
+ ### Other (14)
230
292
 
293
+ - `add_repo_mapping` (write) — Register or update a GitHub repo to orchestrator mapping for webhook event routing.
294
+ - `claim_upload` (write) — Claim an uploaded blob for your organisation with the single-use ticket generate_upload_url returned.
295
+ - `debate_get_room` (read) — Read a debate room: its subject, frozen template, pointer and the full transcript.
296
+ - `debate_post_turn` (write) — Post your answer to the debate-room turn you were asked for; the only way a turn enters a room.
231
297
  - `generate_upload_url` (write) — Mint a Convex storage upload URL for the Knowledge Base ingest flow.
298
+ - `get_bulk_complete_run` (read) — Read the status of one live bulk_complete_tasks run by the `bulkRunId` its first call returned.
299
+ - `get_github_owner_bindings` (read) — List the GitHub owners bound to your organisation (master: all), and for master the org-owned repo mappings that have no proof.
300
+ - `get_owner_tool_usage` (read) — List which MCP tools a person has used across all the agents it owns (one per AI client) and its own direct calls, summed per tool with the earliest first call and the latest last call.
301
+ - `get_tool_usage` (read) — List which MCP tools a caller has called, with the first call time, the last call time and the call count of each.
232
302
  - `improvisation_digest` (read) — Scan a rolling time window of VP tasks, messages, and memories for durable artifacts that carry fleet/state tokens (commit SHA, PR#, VP id, or decisive verb such as merged/deployed/approved) but have NO VP-Sources footer.
303
+ - `list_blocked_on_me` (read) — List the tasks that other peers have BLOCKED on one of YOUR live tasks (blockedOnTaskId), oldest wait first, with the age of each wait.
304
+ - `list_repo_mappings` (read) — List all GitHub repo to orchestrator webhook mappings, newest first with cursor paging support.
305
+ - `remove_repo_mapping` (write, destructive) — Delete a GitHub repo mapping by repo name, stopping webhook event routing for that repo.
233
306
  - `whoami` (read) — Returns the orchestrator identity baked into the current bearer's scope context.
234
307
 
235
308
  The tools below are present in the server code but disabled in this release: a client can neither list nor call them. They are named so this reference matches the code exactly.
236
309
 
237
- ### Registered, not advertised (29)
310
+ ### Registered, not advertised (26)
238
311
 
239
- `accept_mandate`, `add_deployment`, `add_repo_mapping`, `create_bu`, `create_mandate`, `delete_bu`, `get_bu`, `get_error`, `get_issue`, `get_mandate`, `get_repo_mapping`, `issue_stats`, `link_commit_to_issue`, `list_bus`, `list_errors`, `list_issues`, `list_mandates`, `list_repo_mappings`, `remove_deployment`, `remove_repo_mapping`, `settle_mandate`, `soft_delete_mission_template`, `update_bu`, `update_issue_status`, `update_mandate`, `validate_mandate_spending`, `validate_okf_bundle`, `validate_task_payload`, `verify_issue`
312
+ `accept_mandate`, `add_deployment`, `create_bu`, `create_mandate`, `delete_bu`, `get_bu`, `get_error`, `get_issue`, `get_mandate`, `get_repo_mapping`, `issue_stats`, `link_commit_to_issue`, `list_bus`, `list_errors`, `list_issues`, `list_mandates`, `remove_deployment`, `settle_mandate`, `soft_delete_mission_template`, `update_bu`, `update_issue_status`, `update_mandate`, `validate_mandate_spending`, `validate_okf_bundle`, `validate_task_payload`, `verify_issue`
240
313
  <!-- tools:end -->
241
314
 
242
- Every tool declares MCP annotations (`readOnlyHint`, `destructiveHint`, `openWorldHint`), so clients such as ChatGPT can label read and write actions correctly. Most list and search tools page their results with a cursor and keep each response under a fixed size; when a response says more results exist, call again with the returned cursor.
315
+ ### Tool inputs and outputs
316
+
317
+ _Applies to: Cloud and Self-host._
318
+
319
+ - **Annotations.** Every tool declares MCP annotations (`readOnlyHint`, `destructiveHint`, `openWorldHint`), so clients such as ChatGPT can label read and write actions correctly. A tool marked read-only is checked against what its handler does.
320
+ - **Paging.** Most list and search tools page their results with a cursor and keep each response under a fixed size; when a response says more results exist, call again with the returned cursor. `get_github_owner_bindings` takes `limit`, `cursor` and `unprovenCursor` and returns `nextCursor` and `unprovenNextCursor`.
321
+ - **Rows your scope removed.** `list_peers`, `list_tasks_by_mission` and `list_recurring_tasks` answer a bare array when nothing was filtered out, and `{ items, nextCursor?, scopeFiltered }` when your scope removed rows of your own organisation from the page (`scopeFiltered` is that count; another organisation's rows are never counted). `list_broadcast_status` reports `scopeFiltered` and `truncated` beside its receipts. The cursor is decided on the raw page, so a narrowed page still carries its cursor.
322
+ - **List arguments.** Every list argument a client fills (for example `mark_as_read` `receiptIds`) accepts a JSON array or the same array sent as a JSON string. The status filters of `list_tasks`, `list_tasks_by_mission` and `list_missions` are published as an array of statuses; a single status, or an alias (`open`, `active`, `all`) on its own, is still accepted.
323
+ - **Output schemas are open.** A tool's `outputSchema` allows fields added in a later release, so a client connected before an upgrade keeps validating the answers.
324
+ - **Agents by ID.** `send_message` takes `recipientAgentIds` (the `agentId` values `list_peers` returns) and `fromAgentId`; `create_task` and `update_task` take `assignedToAgentId`. A message to a fleet coordinator by channel name is refused (`coordinator-by-name-refused`); address it by ID.
325
+ - **Evidence lines in messages.** In `send_message`, an `evidence:` line that states a live state (a pull request's state, a package version, a task status) must carry the command that produced it on the same line (for example `gh pr view 12 -R owner/repo --json state -> MERGED`) or a token (`{{pr:owner/repo#N}}`, `{{npm:pkg@tag}}`, `{{task:id}}`). A bare literal is refused, even when true, and nothing is sent; a stated state is still checked live.
326
+ - **Tasks.** `create_task` and `update_task` take an optional `deliverable` (`{ pkg, export }`); `get_task` and `list_tasks` then show `deliverableState` and, when the export is published while the task is still open, `deliverableDivergence: "delivered-but-open"`. `bulk_complete_tasks` closes the first 500 matches in the call and the rest in the background; read the run with `get_bulk_complete_run` and the `bulkRunId` it returned. `list_blocked_on_me` lists the tasks other peers have blocked on your live tasks.
327
+ - **Recurring tasks.** A schedule whose previous task is still open creates nothing at its next run and records the skip (`skippedRuns`, `lastSkippedAt`, `lastSkipReason`, shown by `get_recurring_task` and `list_recurring_tasks`).
328
+ - **Debate rooms.** `debate_get_room` reads a room and its transcript; `debate_post_turn` posts your answer when it is your turn. Out-of-turn, non-participant, empty, stale or over-long posts are refused with their own codes (`not_your_turn`, `not_a_participant`, `empty`, `stale_turn`, `too_long`).
329
+ - **Dependencies append.** `add_task_dependency` and `block_task` (`blockedBy`) add to a task's existing dependencies, deduplicated, and answer the resulting list; they no longer replace it. `update_task` `dependsOn` stays the explicit replace. `link_commit_to_issue` skips a commit SHA already recorded.
330
+ - **Tool usage.** `get_tool_usage` lists which MCP tools a caller has called, with first call, last call and call count; `get_owner_tool_usage` sums that across the agents a person owns.
331
+ - **Refusal codes.** A refused `send_message` carries `RBAC_DENIED` or `INVALID_RECIPIENTS`, and a missing message `MESSAGE_NOT_FOUND`, instead of a bare server error.
332
+ - **Errors.** A protocol error thrown by a tool reads without the former `MCP error <code>:` prefix. `tools/list` stamps its JSON Schemas with the 2020-12 dialect and no longer carries `execution.taskSupport`.
243
333
 
244
334
  ## Security
245
335
 
246
- - **Tenant isolation.** Each seat's token carries a scope profile set by your operator: which agents it may act as or read from, and which memory namespaces it may read and write. A member signed in through Clerk is confined to the `team/<organisation>` namespaces resolved from the organisation in the verified token. Which organisation's data a request can reach is decided from the verified credential, never from a value the client types into a tool argument.
247
- - **Agent identity comes from a credential, not a typed name.** See [Agent identity](#agent-identity). A caller from another organisation cannot send a message under one of your agents' names.
248
- - **A refusal never looks like an empty result.** A read you are not allowed to make returns an explicit error (for example, `list_peers` returns text opening with `REFUSED (RBAC_DENIED)`) rather than an empty list, so an agent cannot mistake "not allowed" for "nothing there". An agent credential that does not resolve is refused with its own code (`AGENT_CREDENTIAL_INVALID`, HTTP 401), distinct from a lookup failure. A signed-in user whose account has no organisation yet receives its own refusal, distinct from an invalid token.
249
- - **Token checks.** Clerk session tokens are verified against the issuer's published keys, with issuer and audience both bound. OAuth client secrets are compared in constant time. `redirect_uri` must match a registered URI exactly, and dynamic registration rejects non-HTTPS redirect URIs (except `localhost` / `127.0.0.1`).
250
- - **Health document.** `/health` is public and publishes only aggregates (version, commit, transport, the agent-identity mode and where it comes from). It never echoes a secret or a customer identifier.
336
+ _Applies to: Cloud._
337
+
338
+ - **Tenant isolation by permanent organisation ID.** Which organisation's data a request can reach is decided from the verified credential, never from a value the client types into a tool argument, and it is keyed on the organisation's permanent ID, not on its renamable name: an organisation that later takes a name another one released reads none of the previous holder's data. The tenant is applied inside each read, so another organisation's row is never read and then dropped. Each seat's token carries a scope profile set by your operator: which agents it may act as or read from, and which memory namespaces it may read and write.
339
+ - **Writes land in your organisation or are refused.** A write made through a non-operator credential is stamped with that credential's organisation; when the organisation resolves to no active mapping, the write is refused `RBAC_DENIED` instead of being stored without an organisation. Knowledge Base tools act for your verified organisation, and `store_document_chunked` ingests only a blob your organisation claimed with `claim_upload`.
340
+ - **Messages stay in your organisation.** A seat's direct messages and broadcasts reach its own organisation's roster, plus fleet coordinators your organisation is explicitly allowed to address.
341
+ - **Agent identity comes from a credential, not a typed name.** See [Agent identity](#agent-identity). A caller from another organisation cannot send a message, or act on a task, under one of your agents' names, even when both organisations have an agent with the same name.
342
+ - **A refusal never looks like an empty result.** A read you are not allowed to make returns an explicit error (for example, `list_peers`, `list_diaries` and `list_briefing_notes` return text opening with `REFUSED (RBAC_DENIED)`) rather than an empty list, so an agent cannot mistake "not allowed" for "nothing there". An agent credential that does not resolve is refused with its own code (`AGENT_CREDENTIAL_INVALID`, HTTP 401), distinct from a lookup failure. A signed-in user whose account has no organisation yet receives its own refusal, distinct from an invalid token.
343
+ - **Token checks.** Clerk session tokens are verified against the issuer's published keys, with issuer and audience both bound. OAuth client secrets are compared in constant time. `redirect_uri` must match a registered URI exactly, and dynamic registration rejects non-HTTPS redirect URIs (except the loopback addresses `localhost`, `127.0.0.1` and `[::1]`, whose port may differ from the registered one, RFC 8252 section 7.3). The consent page's form post must come from the same origin.
344
+ - **Health document.** `/health` is public and publishes only aggregates (version, commit, serving runtime, transport, the agent-identity mode and where it comes from). It never echoes a secret or a customer identifier.
251
345
 
252
346
  To report a vulnerability, open an issue at https://github.com/vantageos-agency/vantage-peers/issues without exploit details and ask for a private channel.
253
347
 
254
348
  ## Self-host (a separate product)
255
349
 
350
+ _Applies to: Self-host._
351
+
256
352
  This package also contains the server itself, and can run as a local stdio MCP server against your own deployment:
257
353
 
258
354
  ```bash
@@ -261,10 +357,69 @@ CONVEX_URL=https://<your-deployment>.convex.cloud npx vantage-peers-mcp
261
357
 
262
358
  That is **VantagePeers Self-host**, a separate product with its own setup (backend deployment, service identity, environment). It is documented separately at https://vantagepeers.com/docs/getting-started. Nothing in that setup applies to VantagePeers Cloud, and nothing above is needed to self-host.
263
359
 
360
+ The stdio server answers MCP protocol `2026-07-28` and `2025-11-25` clients alike. It presents the service identity of your deployment to your backend (`CLERK_SECRET_KEY` and `CLERK_SERVICE_ACCOUNT_USER_ID`, see the Self-host guide); without it, it refuses to start.
361
+
362
+ The stdio server registers the same tools, so `list_tasks`, `list_messages`, `list_missions`, `list_memories`, `get_diary` and `get_briefing_note` carry the same `_meta.ui.resourceUri` links and serve the same static `ui://vp/apps/v1/<view>` documents for an MCP Apps-capable local client.
363
+
264
364
  The package also exports typed function references for the VantagePeers backend at `vantage-peers-mcp/api`, for TypeScript services that call a deployment directly.
265
365
 
366
+ ### Backend compatibility check
367
+
368
+ _Applies to: Self-host._
369
+
370
+ Before it serves anything, the server asks your backend for its contract manifest (`meta:backendContract`) and refuses to start, with a log line beginning `BACKEND INCOMPATIBLE (<reason>)`, when:
371
+
372
+ - the backend has no manifest (it predates this check);
373
+ - the backend's contract version is below **17**, the version this release requires;
374
+ - any of the **144** backend functions this release calls is missing (they are named in the log);
375
+ - the server cannot present its service identity, or the backend refuses it.
376
+
377
+ So upgrade in this order: deploy the backend of the same release first, then upgrade this package. The check sees a missing function, not a changed argument; the contract version covers that.
378
+
266
379
  ## Release notes
267
380
 
381
+ ### 4.1.0
382
+
383
+ _Applies to: Cloud and Self-host._ Each item names the product it concerns.
384
+
385
+ **Action required (Self-host)**
386
+
387
+ - Self-host: the server now requires backend contract version 17 and 144 backend functions (was 10 and 141). Deploy the backend of this release first, then upgrade the package; an older backend is refused at start (see [Backend compatibility check](#backend-compatibility-check)).
388
+
389
+ **Added**
390
+
391
+ - Cloud and Self-host: `get_tool_usage` and `get_owner_tool_usage` (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
392
+ - Cloud and Self-host: six tools name an interactive MCP Apps view (see [MCP Apps](#mcp-apps-interactive-views)).
393
+ - Cloud: a native client's loopback `redirect_uri` may vary its port (see [Security](#security)).
394
+
395
+ **Fixes**
396
+
397
+ - Cloud: every call runs inside the bearer's verified organisation, keyed by its permanent ID; a seat reaches its own `orchestrator/<agent ID>` and `project/<org>` on every path; diaries and mandate bindings stay inside the organisation; an agent can pause, resume and delete its own recurring tasks (see [Security](#security), [Agent identity](#agent-identity)).
398
+ - Cloud and Self-host: dependencies append instead of replacing; refusals carry their code (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
399
+
400
+ ### 4.0.0
401
+
402
+ _Applies to: Cloud and Self-host._ Each item names the product it concerns.
403
+
404
+ **Breaking**
405
+
406
+ - Cloud: connecting signs in a person. `/authorize` no longer issues a code to a registered client on its own: you sign in with your VantagePeers account and approve on the [consent page](#the-consent-page), choosing the organisation and the agent.
407
+ - Cloud: agent identity is `strict` by default. A typed agent name without an agent credential is refused `AGENT_CREDENTIAL_REQUIRED` unless the operator explicitly sets `permissive` (see [Agent identity](#agent-identity)).
408
+ - Cloud: a write whose organisation resolves to no active mapping is refused instead of stored without an organisation, and a token of an inactive or unmapped organisation is refused with HTTP 401 (see [Security](#security)).
409
+ - Cloud and Self-host: `list_peers`, `list_tasks_by_mission` and `list_recurring_tasks` answer `{ items, nextCursor?, scopeFiltered }` when your scope removed rows; `send_message` refuses an `evidence:` line that states a live state without its command; tool protocol errors lose the `MCP error <code>:` prefix (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
410
+ - Self-host: the server refuses to start against a backend below contract version 10 or missing a function it calls (see [Backend compatibility check](#backend-compatibility-check)). `engines.node` is `26.12.1` (see [Requirements](#requirements)).
411
+
412
+ **Added**
413
+
414
+ - Cloud and Self-host: MCP protocol `2026-07-28` beside `2025-11-25`.
415
+ - Cloud: the consent page lets you choose the agent a connection acts as; a person can hold one agent per AI client; a person's connection gets a refresh token; `offline_access` is advertised; OpenID discovery and `/userinfo` (see [OAuth endpoints](#oauth-endpoints)).
416
+ - Cloud and Self-host: `list_blocked_on_me`, `get_bulk_complete_run`, `debate_get_room`, `debate_post_turn`; agent-ID arguments; task deliverables; `whoami` names the agent by ID and returns `caller_id`, `org_slug`, `role` (see [Tools](#tools)).
417
+
418
+ **Security and fixes**
419
+
420
+ - Cloud: tenant isolation keyed on the permanent organisation ID and applied inside each read; a removed member loses access within seconds; a replayed refresh token revokes its connection (see [Tokens and revocation](#tokens-and-revocation)).
421
+ - Cloud and Self-host: list arguments accept a JSON string; output schemas accept added fields; dependencies updated (`zod` ^4.6.7, `@vantageos/cloud-identity` ^0.27.0; `zod` 4.3.6 and 4.4.3 carried GHSA-mrhx-c7xc-m3w5).
422
+
268
423
  ### 3.0.0
269
424
 
270
425
  **Breaking**
@@ -303,7 +458,9 @@ Full history: [CHANGELOG.md](https://github.com/vantageos-agency/vantage-peers/b
303
458
 
304
459
  ## Requirements
305
460
 
306
- Node.js 20 or later, for the Self-host stdio server and the `vantage-peers-mcp/api` exports. VantagePeers Cloud clients need nothing installed.
461
+ _Applies to: Self-host._
462
+
463
+ Node.js 26.12.1 (the October 2026 security release), for the Self-host stdio server and the `vantage-peers-mcp/api` exports: `engines.node` names that exact version. A backend of the same release (contract version 17, see [Backend compatibility check](#backend-compatibility-check)). VantagePeers Cloud clients need nothing installed.
307
464
 
308
465
  ## License
309
466
 
@@ -27,6 +27,9 @@
27
27
  * BEARER_SECRET_MASTER — master admin token
28
28
  * PUBLIC_BASE_URL — public URL of this server (for OAuth discovery)
29
29
  * PORT — HTTP port (default 3000)
30
+ * AUTHORIZE_STATE_SECRET, CLERK_DOMAIN, AUTHORIZE_SIGN_IN_URL,
31
+ * AUTHORIZE_CALLBACK_URL, CLERK_SECRET_KEY — person authorization
32
+ * (/authorize); any missing => 503, never auto-approve
30
33
  * NODE_ENV — set to "production" on Railway
31
34
  */
32
35
  import { Hono } from "hono";
@@ -44,3 +47,22 @@ export declare function parseBasicAuthSecret(authHeader: string | undefined, bod
44
47
  };
45
48
  export declare function redirectUriMatches(registeredUri: string, presentedUri: string): boolean;
46
49
  export declare const app: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
50
+ export declare const MCP_RESOURCE_PATH = "/mcp";
51
+ export declare const OFFLINE_ACCESS_SCOPE = "offline_access";
52
+ export declare const REGISTER_RATE_LIMIT_PER_CLIENT = 10;
53
+ export declare const REGISTER_RATE_LIMIT_PER_IP = 60;
54
+ /**
55
+ * The client address a rate limiter may key on: the one the TRUSTED edge
56
+ * observed, never a value the client wrote.
57
+ *
58
+ * 1. `x-real-ip` — the Railway edge sets it "for identifying client's remote
59
+ * IP" (docs.railway.com/networking/public-networking/specs-and-limits).
60
+ * 2. else the RIGHTMOST `x-forwarded-for` entry — a proxy appends the address
61
+ * it observed; every entry to its left is client-supplied. The first entry
62
+ * is attacker-controlled and must never be the key (rotating it bypassed
63
+ * the per-IP ceiling).
64
+ * 3. else `"unknown"` — one shared bucket, as before.
65
+ */
66
+ export declare function clientIpForRateLimit(header: (name: string) => string | undefined): string;
67
+ /** Test-only: clear every DCR rate-limit bucket. */
68
+ export declare function _resetRegisterRateLimitForTest(): void;