Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-11-24-hosted-mcp-connectors-trust-vendor-read-hints.md
2026-11-24-hosted-mcp-connectors-trust-vendor-read-hints.md: 280acfa8ff770ec73a88a13bbf98caee3fe7b36b
2026-11-24-hosted-mcp-connectors-trust-vendor-read-hints.zh.md: d85f016476c17fa46e699e895474458473b18efa
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Agent Note: Hosted MCP connectors share the broker and trust their vendor's read hints

Status: implemented

English | [中文](2026-11-24-hosted-mcp-connectors-trust-vendor-read-hints.zh.md)

## Problem

Vercel, Atlassian, monday.com, and Stripe publish hosted MCP servers whose authorization servers register clients dynamically, as Notion's does ([Notion connector](2026-11-24-notion-hosted-mcp-through-the-broker.md)). Adding each as bespoke code would repeat the same registration, consent, and mounting four times. Their tool sets are large and change without notice, so a hand-written read list per vendor would go stale, and a tool missing from it would either ask needlessly or, if lists were permissive, run unreviewed. Separately, the five Microsoft connectors each need their own consent, while users of one work account expect a single sign-in.

## Decision

- **One table per side.** The Aeven API's `HOSTED_MCP` entry per provider names the registration, authorization, token, and revocation endpoints, the MCP resource, the scopes, and the token-endpoint authentication method; Vercel and Stripe accept only public clients, so their registrations carry no secret. Atlassian publishes no protected-resource metadata, so its requests name no resource. The Host's `hosted-mcp.ts` maps each provider to its MCP endpoint. Adding a vendor with dynamic registration is one entry on each side plus its Settings copy, icon, and skill.
- **Vendor read hints decide approvals.** `@aeven/mcp-client` copies a tool's MCP `annotations.readOnlyHint: true` onto its `ToolDefinition` as `readOnlyHint`, which never reaches the model. For hosted MCP connectors, account-integrations reads it from the calling agent's tool view in `tools/pre-execute`: a tool the vendor's own server marks read-only runs directly, and every other tool, including an unmarked one, asks first. Notion keeps its published read list. Claude's connectors make the same choice: a read-only connector policy runs a tool directly only when its server sets `readOnlyHint`.
- **Salesforce brings its own application.** Salesforce's hosted MCP servers support neither a shared application nor dynamic registration, so the user submits the External Client App their org's administrator created — My Domain, consumer key, and optional secret — with the consent. The Aeven API accepts only a Salesforce My Domain host, keeps the app with the grant for refresh and revocation, and assumes a 15-minute token lifetime because Salesforce reports none. Salesforce tools follow the same `readOnlyHint` rule.
- **Shopify runs Aeven's own server.** Shopify publishes no hosted admin MCP server, so `native/shopify-mcp` serves one store per stdio process over the Admin GraphQL API with four tools: three reads and `graphql_mutation`. The read tool refuses any document that defines a mutation or subscription, which a lexer over the document's top-level definitions decides, so its `readOnlyHint` holds. The deployment's Shopify app installs per store through the broker, which verifies Shopify's signature on the redirect and on every webhook, keeps an expiring offline token, and deletes a store's grants on uninstall or shop redaction.
- **Microsoft 365 beside the five.** A `microsoft-365` provider asks for the union of the five services' delegated permissions in one consent and serves the union of their tools through the same Graph bridge. Teams and SharePoint exist only for work or school accounts, so it consents at `organizations` and refuses the consumer tenant; personal accounts keep the individual connectors.

## Alternatives considered

- **Curated read lists for every vendor** — strict, but each list needs upkeep whenever the vendor adds tools, and a vendor's server already declares which of its tools only read.
- **Trusting `readOnlyHint` for every MCP server** — custom servers are not the vendor's own and may annotate carelessly, so GitHub and custom connectors keep the read-name pattern.
- **Replacing the five Microsoft connectors** — would force every existing connection to sign in again and drop personal accounts, which cannot use Teams or SharePoint.

## Consequences

- A vendor that marks a writing tool read-only lets it run without approval; the trust is limited to vendor-operated servers.
- Every new vendor-hosted connector registers at that vendor on its first consent, one registration per redirect URI.
- Shopify needs the Aeven app in the Shopify Partner dashboard, and stores outside development stores can install it only after Shopify's App Store review.
- Salesforce works only in orgs whose administrator created the app and enabled the server; Aeven cannot set that up centrally.
- Microsoft 365 often needs a tenant administrator's approval, because the Teams permissions require it.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Agent Note:托管 MCP 连接器共用代理并信任供应商的只读提示

Status: implemented

[English](2026-11-24-hosted-mcp-connectors-trust-vendor-read-hints.md) | 中文

## 问题

Vercel、Atlassian、monday.com 和 Stripe 发布了托管 MCP 服务器,其授权服务器像 Notion 一样动态注册客户端([Notion 连接器](2026-11-24-notion-hosted-mcp-through-the-broker.zh.md))。若逐一编写专用代码,相同的注册、授权和挂载要重复四次。它们的工具集很大且会无预告地变化,因此每个供应商一份手写的读取清单会过时;清单中缺失的工具要么多余地征求批准,要么在清单宽松时未经审查就执行。另外,五个 Microsoft 连接器各需单独授权,而使用同一工作账户的用户期望只登录一次。

## 决定

- **两端各一张表。** Aeven API 的 `HOSTED_MCP` 为每个提供方列出注册、授权、令牌及撤销端点、MCP 资源、权限范围和令牌端点认证方式;Vercel 和 Stripe 只接受公开客户端,因此其注册不带密钥。Atlassian 不发布受保护资源元数据,因此其请求不指定资源。宿主的 `hosted-mcp.ts` 将每个提供方映射到其 MCP 端点。新增一个支持动态注册的供应商,只需在两端各加一项,再加上其设置文案、图标和技能。
- **由供应商的只读提示决定批准。** `@aeven/mcp-client` 将工具的 MCP `annotations.readOnlyHint: true` 复制到其 `ToolDefinition` 的 `readOnlyHint` 上,该字段绝不会到达模型。对托管 MCP 连接器,account-integrations 在 `tools/pre-execute` 中从调用代理的工具视图读取它:供应商自己的服务器标为只读的工具直接执行,其他所有工具(包括未标注的工具)都会先征求批准。Notion 保留其发布的读取清单。Claude 的连接器做出相同选择:只读连接器策略仅在服务器设置 `readOnlyHint` 时才直接执行工具。
- **Salesforce 使用自带应用。** Salesforce 的托管 MCP 服务器既不支持共享应用,也不支持动态注册,因此用户在授权时提交其组织管理员创建的外部客户端应用——“我的域”、使用者密钥及可选的使用者密码。Aeven API 只接受 Salesforce“我的域”主机,将该应用与授权一起保存以供刷新和撤销,并且由于 Salesforce 不报告令牌有效期,假定其为 15 分钟。Salesforce 工具遵循同一 `readOnlyHint` 规则。
- **Shopify 运行 Aeven 自己的服务。** Shopify 不提供托管的后台 MCP 服务器,因此 `native/shopify-mcp` 通过 Admin GraphQL API 为每个店铺运行一个 stdio 进程,提供四个工具:三个读取工具和 `graphql_mutation`。读取工具会拒绝任何定义了变更或订阅的文档,由一个针对文档顶层定义的词法分析器判断,因此其 `readOnlyHint` 成立。部署的 Shopify 应用通过代理逐店铺安装,代理校验 Shopify 在重定向及每个 webhook 上的签名,保存可过期的离线令牌,并在卸载或店铺数据删除时删除该店铺的授权。
- **Microsoft 365 与五个连接器并存。** `microsoft-365` 提供方以一次授权请求五项服务的委托权限并集,并通过同一 Graph 桥接提供它们的工具并集。Teams 和 SharePoint 仅存在于工作或学校账户中,因此它在 `organizations` 授权并拒绝消费者租户;个人账户继续使用单独的连接器。

## 考虑过的替代方案

- **为每个供应商维护精选读取清单** —— 严格,但供应商每次新增工具都需维护,而供应商的服务器本身已声明哪些工具只读。
- **对所有 MCP 服务器信任 `readOnlyHint`** —— 自定义服务器并非供应商自有,标注可能随意,因此 GitHub 和自定义连接器保留读取名称模式。
- **替换五个 Microsoft 连接器** —— 会迫使所有现有连接重新登录,并且放弃无法使用 Teams 或 SharePoint 的个人账户。

## 影响

- 若供应商把写入工具标为只读,该工具将无需批准即可执行;这种信任仅限于供应商运营的服务器。
- 每个新的供应商托管连接器都会在首次授权时向该供应商注册,每个重定向 URI 一个注册。
- Shopify 需要在 Shopify 合作伙伴后台创建 Aeven 应用,且开发店铺以外的店铺只能在 Shopify 应用商店审核通过后安装。
- Salesforce 仅在管理员已创建该应用并启用服务器的组织中可用;Aeven 无法集中完成这项设置。
- Microsoft 365 常需租户管理员批准,因为 Teams 权限要求如此。
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-11-24-notion-hosted-mcp-through-the-broker.md
2026-11-24-notion-hosted-mcp-through-the-broker.md: 52c3e62c955e2e4a12a3398d030f073ab5d1995b
2026-11-24-notion-hosted-mcp-through-the-broker.zh.md: cfcc8db0a360119065cec2ce1d317cc8fad83410
2026-11-24-notion-hosted-mcp-through-the-broker.md: 318eb4eaebdb1ddbe352fedb2cc9a5bf3f4b314a
2026-11-24-notion-hosted-mcp-through-the-broker.zh.md: 01c5eed0b36d3342b26026715ede04e14deca70d
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The connector uses the hosted server, and the Aeven API stays the only holder of

- **Registration.** On the first Notion consent the API registers itself at Notion's registration endpoint as a confidential client (`client_secret_post`) with its connector callback as the only redirect URI, and stores the result in `connector_clients`, the secret encrypted. The row is keyed by provider and redirect URI, so development and production register separately and a changed callback registers again. Concurrent first consents share one registration; a registration Notion later refuses with `invalid_client` is deleted, so the next consent registers again and existing grants ask to reconnect.
- **Grant.** Consent, code exchange, refresh, and revocation run through the existing broker routes with the stored registration's credentials and `resource=https://mcp.notion.com/mcp`. The Host treats Notion as one more brokered provider: it fetches short-lived access tokens with `broker.token()` and mounts the hosted server over Streamable HTTP.
- **Approvals.** Notion's tool names (`notion-search`, `notion-create-pages`) do not match the shared read-name pattern, so `notion.ts` lists the read tools from Notion's published reference. Every other tool, including one Notion adds later, asks first.
- **Approvals.** Notion's tool names (`notion-search`, `notion-create-pages`) do not match the shared read-name pattern, so `hosted-mcp.ts` lists Notion's read tools from Notion's published reference. Every other tool, including one Notion adds later, asks first.

## Alternatives considered

Expand All @@ -25,6 +25,6 @@ The connector uses the hosted server, and the Aeven API stays the only holder of

## Consequences

- The deployment configures no Notion credential; `connectors.notion` in the API configuration only names the client on Notion's consent screen.
- The deployment configures no Notion credential; `connectors.registration` in the API configuration only names the client on Notion's consent screen. The other vendor-hosted connectors share the mechanism ([hosted MCP connectors](2026-11-24-hosted-mcp-connectors-trust-vendor-read-hints.md)).
- A Notion grant reaches only the pages the user shared on Notion's consent screen.
- A Notion connection row is named after the provider, as GitHub's is; the workspace name is not recorded.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Notion 是第一个其提供商不发布可注册普通 OAuth 应用的连接器

- **注册。** 首次 Notion 授权时,API 以机密客户端(`client_secret_post`)身份在 Notion 的注册端点注册自身,以其连接器回调作为唯一重定向 URI,并将结果保存在 `connector_clients` 中,密钥加密存储。该行以提供商和重定向 URI 为键,因此开发与生产环境分别注册,回调变更后会重新注册。并发的首次授权共享同一注册;Notion 之后以 `invalid_client` 拒绝的注册会被删除,下次授权重新注册,已有授权则提示重新连接。
- **授权。** 授权、授权码兑换、刷新及撤销都经由现有代理路由,使用所存注册的凭据及 `resource=https://mcp.notion.com/mcp`。宿主将 Notion 视为又一个代理提供商:通过 `broker.token()` 获取短期访问令牌,并以 Streamable HTTP 挂载托管服务器。
- **批准。** Notion 的工具名称(`notion-search`、`notion-create-pages`)不符合共享的读取名称模式,因此 `notion.ts` 按 Notion 发布的参考列出读取工具。其他所有工具(包括 Notion 日后新增的工具)都会先征求批准。
- **批准。** Notion 的工具名称(`notion-search`、`notion-create-pages`)不符合共享的读取名称模式,因此 `hosted-mcp.ts` 按 Notion 发布的参考列出 Notion 的读取工具。其他所有工具(包括 Notion 日后新增的工具)都会先征求批准。

## 考虑过的替代方案

Expand All @@ -25,6 +25,6 @@ Notion 是第一个其提供商不发布可注册普通 OAuth 应用的连接器

## 影响

- 部署无需配置任何 Notion 凭据;API 配置中的 `connectors.notion` 仅用于在 Notion 授权页面上显示客户端名称。
- 部署无需配置任何 Notion 凭据;API 配置中的 `connectors.registration` 仅用于在 Notion 授权页面上显示客户端名称。其他供应商托管的连接器共用该机制([托管 MCP 连接器](2026-11-24-hosted-mcp-connectors-trust-vendor-read-hints.zh.md))。
- Notion 授权只能访问用户在 Notion 授权页面上共享的页面。
- Notion 连接行以提供商命名,与 GitHub 相同;不记录工作区名称。
4 changes: 2 additions & 2 deletions docs/config-catalog.i18n.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/config-catalog.md
config-catalog.md: d7b952e5de52699e70e2f4d636713fa554236be0
config-catalog.zh.md: fd00494bae237ecb100f482b5390c4a3c1560e35
config-catalog.md: ef71e5388bdf372005652aea94b660dff2005be0
config-catalog.zh.md: 5ff9dde3a1109ae09415bd1e566026d643527b48
11 changes: 11 additions & 0 deletions docs/config-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,11 @@ export interface Config {
maxDiscordGuilds: number
/** Slack workspaces one signed-in user may connect. */
maxSlackWorkspaces: number
/**
* Salesforce hosted MCP server a Salesforce connector mounts, such as `sobject-all`. The org's
* administrator must have enabled it in Setup → API Catalog → MCP Servers.
*/
salesforceMcpServer: string
/**
* The deployment's Slack app client id, which is public because Slack's PKCE client is a public
* client. Absent leaves Slack unavailable, and no Slack secret exists for this Host to hold.
Expand All @@ -1876,6 +1881,12 @@ export interface Config {
telegramEntryPath?: string
/** Discord connector server entry; defaults to the vendored package installed for this host. */
discordEntryPath?: string
/** Shopify connector server entry; defaults to the `@aeven/shopify-mcp` package installed for this host. */
shopifyEntryPath?: string
/** Shopify Admin API version the Shopify server calls, such as `2026-10`; Shopify supports each version for a year. */
shopifyApiVersion: string
/** Largest result text one Shopify tool call returns, in bytes; a longer one is cut and says so. */
shopifyMaxResultBytes: number
/** Discord permissions the install link requests, as a base-10 bitfield string. */
discordPermissions?: string
/** Whether connected guilds also serve the administration and moderation tools. */
Expand Down
11 changes: 11 additions & 0 deletions docs/config-catalog.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -1857,6 +1857,11 @@ export interface Config {
maxDiscordGuilds: number
/** Slack workspaces one signed-in user may connect. */
maxSlackWorkspaces: number
/**
* Salesforce hosted MCP server a Salesforce connector mounts, such as `sobject-all`. The org's
* administrator must have enabled it in Setup → API Catalog → MCP Servers.
*/
salesforceMcpServer: string
/**
* The deployment's Slack app client id, which is public because Slack's PKCE client is a public
* client. Absent leaves Slack unavailable, and no Slack secret exists for this Host to hold.
Expand All @@ -1878,6 +1883,12 @@ export interface Config {
telegramEntryPath?: string
/** Discord connector server entry; defaults to the vendored package installed for this host. */
discordEntryPath?: string
/** Shopify connector server entry; defaults to the `@aeven/shopify-mcp` package installed for this host. */
shopifyEntryPath?: string
/** Shopify Admin API version the Shopify server calls, such as `2026-10`; Shopify supports each version for a year. */
shopifyApiVersion: string
/** Largest result text one Shopify tool call returns, in bytes; a longer one is cut and says so. */
shopifyMaxResultBytes: number
/** Discord permissions the install link requests, as a base-10 bitfield string. */
discordPermissions?: string
/** Whether connected guilds also serve the administration and moderation tools. */
Expand Down
4 changes: 2 additions & 2 deletions docs/subsystems/credentials.i18n.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/subsystems/credentials.md
credentials.md: aa8f8448642a481998ceb88b11ce96514b41b098
credentials.zh.md: 45c24e9871cc8a8478a545d78305ab2d3418164c
credentials.md: 75157cf9b41cab0bfa4438be74ad706289692d99
credentials.zh.md: 08efd5d4a020c338e775d72fdc885276f10a9955
15 changes: 15 additions & 0 deletions docs/subsystems/credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,21 @@ Signed-in users manage their own integrations; each agent mounts only its owner'
*/
@Remote async authorize(provider: ConnectorProvider): Promise<ConnectorAuthorization>

/**
* Start installing the Aeven Shopify app into one store. Each store is its own connector row, so
* connecting a store again re-consents that row.
* @param request - the store, as a domain, URL, admin URL, or handle.
* @returns the store's consent URL.
*/
@Remote async authorizeShopify(request: ShopifyAuthorizationRequest): Promise<ConnectorAuthorization>

/**
* Start the consent for a Salesforce org through the External Client App its administrator created.
* @param request - the org's My Domain and the app's consumer key and optional secret; the secret is write-only.
* @returns the org's consent URL.
*/
@Remote async authorizeSalesforce(request: SalesforceAuthorizationRequest): Promise<ConnectorAuthorization>

/**
* Enable or disable one personal connector; disabled calls are immediately denied.
* @param id - caller-owned connector.
Expand Down
Loading