Skip to content

feat(settings): MCP connected clients and a live tool catalog - #1530

Merged
Makisuo merged 27 commits into
feat/settings-audit-health-datafrom
feat/settings-mcp
Oct 17, 2026
Merged

Makisuo merged 27 commits into
feat/settings-audit-health-datafrom
feat/settings-mcp

Conversation

@Makisuo

@Makisuo Makisuo commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

MCP tab redesign with connected clients and a live tool catalog.

  • Connect a client: correct setup per client (Claude Code .mcp.json / claude mcp add, Cursor, Windsurf, Other).
  • New GET/DELETE /v2/mcp_connections: one row per OAuth grant (client, user, scopes, connected, last refreshed, expires). Admins see and revoke all, members their own; revoke ends the grant family and writes an audit entry. /v2/api_keys no longer lists the hourly OAuth access-key rows.
  • New /internal/mcp/tools served by the AI worker (forwarded by the API) from the real tool registry; the tab lists all public tools grouped and searchable with Read only / Writes badges. The hardcoded list (24 tools, one that does not exist) is gone.

Known follow-up: the Keys tab reads keys from the live sync shape, which does not carry the metadata needed to hide those OAuth rows there yet.

Verification

  • Service tests (Postgres), route tests (authz, audit), tool grouping and client config tests, registry contract test. Local stack: tools load end to end.

MCP

Stack

Settings redesign, bottom to top: #1525 foundation, #1526 general and members, #1527 billing and usage, #1528 keys, ingestion and sampling, #1529 audit log, setup health and data platform, #1530 MCP, #1531 AI and email preferences. Bug fixes from the same audit shipped in #1524. Alerts routing is a later stack.

🤖 Generated with Claude Code

…config

One section with the server URL, per-client tabs (Claude Code, Cursor,
Windsurf, Other) using each client's real config file and URL key, and a
single entry to the MCP key fallback that inserts the secret into the
snippets.
One connection per refresh-token family, with client name, approving
member, scopes, connected, last refreshed and expiry. Members see and
revoke their own, admins everyone's; revoking ends the family and its
access keys and records mcp_connection.revoked in the audit log.

The hourly OAuth access keys are left out of the API key list, since the
grant is now managed as a connection.
The AI Worker lists what the public MCP transport serves (name, title,
description, read-only and destructive hints); api forwards
/internal/mcp/* to it like the chat paths.
Replaces the hardcoded 24-tool list, which named a tool that does not
exist. Tools are grouped by topic from their names, searchable, and
marked read only or writes.
@Makisuo
Makisuo added this pull request to stack #1532 October 17, 2026 09:21
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be576988-9547-4f9d-b0fd-89f57e7bafa1
📥 Commits

Reviewing files that changed from the base of the PR and between 8bb9654 and 7ba87e5.

⛔ Files ignored due to path filters: 1
  • packages/domain/src/generated/anticipated-error-identifiers.ts is excluded by !**/generated/**
📒 Files selected for processing: 36
  • apps/ai/src/routes/internal/mcp-tools.http.test.ts
  • apps/ai/src/routes/internal/mcp-tools.http.ts
  • apps/ai/src/runtime/http-graph.ts
  • apps/api/src/routes/v2/mcp-connections.http.test.ts
  • apps/api/src/routes/v2/mcp-connections.http.ts
  • apps/api/src/routes/v2/v2-test-support.ts
  • apps/api/src/runtime/http-graph.ts
  • apps/api/src/runtime/service-graph.ts
  • apps/api/src/worker/ai-forward.test.ts
  • apps/api/src/worker/ai-forward.ts
  • apps/ios/Packages/MapleAPI/Sources/MapleAPI/openapi.json
  • apps/web/src/components/mcp/mcp-tool-groups.test.ts
  • apps/web/src/components/mcp/mcp-tool-groups.ts
  • apps/web/src/components/mcp/mcp-tools-list.tsx
  • apps/web/src/components/settings/mcp-client-config.test.ts
  • apps/web/src/components/settings/mcp-client-config.ts
  • apps/web/src/components/settings/mcp-connected-clients.tsx
  • apps/web/src/components/settings/mcp-section.tsx
  • docs/api-v2.md
  • packages/backend/src/services/auth/McpConnectionsService.test.ts
  • packages/backend/src/services/auth/McpConnectionsService.ts
  • packages/backend/src/services/auth/McpOAuthService.ts
  • packages/backend/src/services/auth/mcp-oauth-family.ts
  • packages/backend/src/services/org/ApiKeysService.ts
  • packages/domain/src/audit-actions.ts
  • packages/domain/src/http/ai-api.ts
  • packages/domain/src/http/index.ts
  • packages/domain/src/http/mcp-connections.ts
  • packages/domain/src/http/mcp-tools.ts
  • packages/domain/src/http/v2/api.ts
  • packages/domain/src/http/v2/index.ts
  • packages/domain/src/http/v2/mcp-connections.ts
  • packages/domain/src/http/v2/openapi.test.ts
  • packages/domain/src/http/v2/public-id.ts
  • packages/domain/src/http/v2/resource-ids.ts
  • packages/primitives/src/index.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@maple-review-bot

maple-review-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 8/10 · likely safe to merge
New endpoints are additive and pinned by service and route tests covering admin, member, own-org and unknown-id cases.
quality 100/100 · no findings · tests covered · risk medium · 4/4 new units observable

Adds a v2 MCP connections API (list and revoke, admin-or-own scoping, audit entry), drops the hourly OAuth access keys from the API key list, and serves the real tool catalog from the AI worker to a redesigned MCP settings tab. Safe to merge. The generated apps/ios/.../openapi.json was not reviewed.

  • McpConnectionsService reduces refresh-token rows to one connection per OAuth grant and revokes the family
  • GET/DELETE /v2/mcp_connections added to MapleApiV2; revoke records mcp_connection.revoked
  • ApiKeysService.list hides rows whose metadata source is maple_mcp_oauth
  • MCP settings tab reads the live catalog from /internal/mcp/tools and per-client setup snippets

Production impact

Production traffic of the changed files (last 7 days)
File Calls/day Busiest operations
apps/api/src/worker/ai-forward.ts 24k POST /mcp 11k/day, 0.0% err
POST /mcp 11k/day, 0.0% err
GET /mcp 733/day, 0.0% err
apps/ai/src/runtime/http-graph.ts 130 POST /internal/triage/classify 89/day, 0.0% err
POST /internal/triage/classify 41/day, 0.0% err
Telemetry this change adds and removes (3)
  • ➕ span name McpConnectionsService.liveConnections · packages/backend/src/services/auth/McpConnectionsService.ts:88
  • ➕ span name McpConnectionsService.list · packages/backend/src/services/auth/McpConnectionsService.ts:124
  • ➕ span name McpConnectionsService.revoke · packages/backend/src/services/auth/McpConnectionsService.ts:132
What was checked
  • Viewer scoping is enforced in the query (McpConnectionsService.ts:100); route tests cover admin, member, other org and unknown id
  • /internal/mcp/tools keeps SessionAuthorization even though api forwards /internal/mcp/* ahead of its router (packages/domain/src/http/mcp-tools.ts:30)
  • ApiKeysService.list keeps rows with no metadata and excludes only maple_mcp_oauth, pinned by McpConnectionsService.test.ts:124
Observability coverage: 4 of 4 changes observable
Change Kind Observable Evidence
GET /v2/mcp_connections HTTP entrypoint (api) yes Existing HttpApiBuilder v2 graph; handler service annotates the span with orgId and tenant.userId (McpConnectionsService.ts:128)
DELETE /v2/mcp_connections/:id HTTP entrypoint (api) yes Same v2 graph; revoke is an Effect.fn span and writes a mcp_connection.revoked audit row
GET /internal/mcp/tools HTTP entrypoint (maple-ai, forwarded from api) yes Typed group behind SessionAuthorization; the api hop passes its traceparent (apps/api/src/worker/ai-forward.ts)
Postgres reads/writes in McpConnectionsService DB access yes Runs under the service's Effect.fn spans with makeDbExecute structured error logs; the repo emits no PG client spans anywhere, so this follows the existing convention

2691b66 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@maple-review-bot

maple-review-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 8/10 · likely safe to merge
New admin-or-own scoping and family revocation are pinned by service and route tests, and the OAuth-key filter matches the metadata written at McpOAuthService.ts:218.
quality 100/100 · no findings · tests covered · risk high · 2/2 new units observable

Adds /v2/mcp_connections (one row per OAuth grant, admin-or-own scoped, revoke ends the family and audited), serves the live tool catalog from the AI worker at /internal/mcp/tools, and rebuilds the MCP settings tab. Safe to merge.

  • McpConnectionsService.list returns one row per refresh-token family, scoped by viewer
  • DELETE /v2/mcp_connections/{id} revokes the family and writes mcp_connection.revoked
  • /internal/mcp/tools serves the registry's public catalog, forwarded by the API worker
  • ApiKeysService.list hides hourly maple_mcp_oauth access keys; the MCP tab lists tools per client

Production impact

Production traffic of the changed files (last 7 days)
File Calls/day Busiest operations
apps/api/src/worker/ai-forward.ts 24k POST /mcp 11k/day, 0.0% err
POST /mcp 11k/day, 0.0% err
GET /mcp 733/day, 0.0% err
apps/ai/src/runtime/http-graph.ts 132 POST /internal/triage/classify 90/day, 0.0% err
POST /internal/triage/classify 42/day, 0.0% err
Telemetry this change adds and removes (3)
  • ➕ span name McpConnectionsService.liveConnections · packages/backend/src/services/auth/McpConnectionsService.ts:88
  • ➕ span name McpConnectionsService.list · packages/backend/src/services/auth/McpConnectionsService.ts:124
  • ➕ span name McpConnectionsService.revoke · packages/backend/src/services/auth/McpConnectionsService.ts:132
What was checked
  • mcp_connections:read|write scopes derive from the path, no scope registry to extend (packages/domain/src/http/v2/auth.ts)
  • The maple_mcp_oauth source filter matches the metadata oauthKeyMetadata writes (McpOAuthService.ts:218)
  • familyId is a randomUUID, so decodeConnectionId cannot silently drop rows (McpOAuthService.ts approve/rotate)
Observability coverage: 2 of 2 changes observable
Change Kind Observable Evidence
GET/DELETE /v2/mcp_connections HTTP endpoint yes maple-api v2 routes emit server spans with url.path/http.route (live window: 4.3k http.route spans); no route adds its own span, matching every other v2 route
GET /internal/mcp/tools (maple-ai) HTTP endpoint yes maple-ai HttpApi spans carry http.route, e.g. POST /internal/triage/classify in the window; the group is mounted through the same HttpApiBuilder layer

667112a · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@maple-review-bot

maple-review-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 9/10 · safe to merge
Every added hunk is exercised by a service or route test, including cross-org and member-vs-admin revocation.
quality 100/100 · no findings · tests covered · risk medium · 3/3 new units observable

Rebuilds Settings > MCP: per-client connect snippets, connected OAuth grants with member/admin revoke at a new /v2/mcp_connections, and a tool catalog read from the AI worker's real registry. Scoping, authz and revocation are pinned by service and route tests; safe to merge.

  • McpConnectionsService collapses the hourly refresh rotation to one row per OAuth grant, org- and viewer-scoped
  • GET/DELETE /v2/mcp_connections gives admins every member's grants, members their own, and audits revokes
  • ApiKeysService.list drops maple_mcp_oauth rows using metadata_json.source
  • Settings > MCP lists the live catalog from /internal/mcp/tools, served by maple-ai and forwarded by the api

Production impact

Production traffic of the changed files (last 7 days)
File Calls/day Busiest operations
apps/api/src/worker/ai-forward.ts 24k POST /mcp 11k/day, 0.0% err
POST /mcp 11k/day, 0.0% err
GET /mcp 728/day, 0.0% err
apps/ai/src/runtime/http-graph.ts 132 POST /internal/triage/classify 90/day, 0.0% err
POST /internal/triage/classify 42/day, 0.0% err
Telemetry this change adds and removes (3)
  • ➕ span name McpConnectionsService.liveConnections · packages/backend/src/services/auth/McpConnectionsService.ts:88
  • ➕ span name McpConnectionsService.list · packages/backend/src/services/auth/McpConnectionsService.ts:124
  • ➕ span name McpConnectionsService.revoke · packages/backend/src/services/auth/McpConnectionsService.ts:132
What was checked
  • The new list query filters orgId and narrows to userId for non-admins (McpConnectionsService.ts:99); the cross-org grant is excluded in the service test
  • connected_at = familyExpiresAt - REFRESH_FAMILY_ABSOLUTE_TTL_MS is the approval time: the base sets the ceiling once at approval and carries it across rotations (McpOAuthService.ts:707,846 at base…
  • The keys-list filter matches the source: "maple_mcp_oauth" McpOAuthService pins on every minted access key (McpOAuthService.ts:218 at base)
Observability coverage: 3 of 3 changes observable
Change Kind Observable Evidence
GET /internal/mcp/tools (maple-ai) inbound HTTP yes mcpTools group on MapleAiApi, same worker HttpApi instrumentation as /internal/chat/apply; reached through forwardsToAi
GET / DELETE /v2/mcp_connections (maple-api) inbound HTTP yes HttpApiBuilder.group in the api route graph; McpConnectionsService.list/revoke annotate orgId and tenant.userId
McpConnectionsService reads and family revoke database yes makeDbExecute/db.run and db.transaction, one span per query named for the service

8408068 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@maple-review-bot

maple-review-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 8/10 · likely safe to merge
Org scoping and admin/member revocation are pinned by Postgres-backed route tests, and both production graphs wire the new route and service.
quality 100/100 · no findings · tests covered · risk high · 3/3 new units observable

Adds a live MCP connected-clients list with admin/member revocation on a new /v2/mcp_connections route, hides hourly OAuth access keys from /v2/api_keys, and replaces the hardcoded tool list with a registry-backed GET /internal/mcp/tools. Safe to merge.

  • McpConnectionsService dedupes OAuth grants to one live row per refresh-token family
  • GET/DELETE /v2/mcp_connections scopes admins to all grants, members to their own, and audits revokes
  • ApiKeysService stops listing hourly OAuth access keys
  • /internal/mcp/tools serves the live registry catalog to the MCP settings tab

Production impact

Production traffic of the changed files (last 7 days)
File Calls/day Busiest operations
apps/api/src/worker/ai-forward.ts 24k POST /mcp 11k/day, 0.0% err
POST /mcp 11k/day, 0.0% err
GET /mcp 728/day, 0.0% err
apps/ai/src/runtime/http-graph.ts 132 POST /internal/triage/classify 90/day, 0.0% err
POST /internal/triage/classify 42/day, 0.0% err
Telemetry this change adds and removes (3)
  • ➕ span name McpConnectionsService.liveConnections · packages/backend/src/services/auth/McpConnectionsService.ts:88
  • ➕ span name McpConnectionsService.list · packages/backend/src/services/auth/McpConnectionsService.ts:124
  • ➕ span name McpConnectionsService.revoke · packages/backend/src/services/auth/McpConnectionsService.ts:132
What was checked
  • Forwarding predicate adds only /internal/mcp/; /internal/mcpx still 404s (apps/api/src/worker/ai-forward.test.ts:39)
  • Member path filters UserId in SQL and re-checks the matched row before revoking (McpConnectionsService.ts:104)
  • Production http-graph.ts:185 and service-graph.ts:95 wire the route and service, not just test support
Observability coverage: 3 of 3 changes observable
Change Kind Observable Evidence
GET /v2/mcp_connections HTTP inbound yes HttpApiBuilder.group(MapleApiV2, "mcpConnections") at apps/api/src/routes/v2/mcp-connections.http.ts:28; service reads wrapped in Effect.fn and annotated with maple.org.id/tenant.user_id
DELETE /v2/mcp_connections/:id HTTP inbound yes same group; revoke writes an audit entry (recordHttpAudit, mcp-connections.http.ts:60) and reports 404/503 through typed errors
GET /internal/mcp/tools (AI worker, forwarded from api) HTTP inbound yes Layer.provide(HttpMcpToolsLive) in apps/ai/src/runtime/http-graph.ts:88; group guarded by SessionAuthorization, path forwarded by ai-forward.ts:33

9f7cf77 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@maple-review-bot

maple-review-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 8/10 · likely safe to merge
Scoping, revocation and the tool catalog are pinned by service, route and registry tests; the five "changed since" files are base-branch changes outside this PR's diff.
quality 100/100 · no findings · tests covered · risk medium · 3/3 new units observable

Adds GET/DELETE /v2/mcp_connections (one row per OAuth grant, admins see all, revoke ends the family with an audit entry), hides OAuth access-key rows from /v2/api_keys, and backs the redesigned MCP tab with a live tool catalog served by the AI worker. Safe to merge.

  • New mcpConnections v2 group: list per OAuth family, revoke ends it
  • /internal/mcp/tools forwarded to the AI worker's real tool registry
  • /v2/api_keys list filters out OAuth-sourced hourly access keys
  • MCP tab rebuilt: per-client setup snippets and connected clients

Before merge

Production impact

Production traffic of the changed files (last 7 days)
File Calls/day Busiest operations
apps/api/src/worker/ai-forward.ts 24k POST /mcp 11k/day, 0.0% err
POST /mcp 11k/day, 0.0% err
GET /mcp 728/day, 0.0% err
apps/ai/src/runtime/http-graph.ts 132 POST /internal/triage/classify 90/day, 0.0% err
POST /internal/triage/classify 42/day, 0.0% err
Telemetry this change adds and removes (3)
  • ➕ span name McpConnectionsService.liveConnections · packages/backend/src/services/auth/McpConnectionsService.ts:88
  • ➕ span name McpConnectionsService.list · packages/backend/src/services/auth/McpConnectionsService.ts:124
  • ➕ span name McpConnectionsService.revoke · packages/backend/src/services/auth/McpConnectionsService.ts:132
What was checked
  • Member vs admin scoping is a userId predicate plus isAdmin(roles) (McpConnectionsService.ts:100), pinned by route tests.
  • forwardsToAi adds only /internal/mcp/; /internal/mcp and /oauth/* stay with api's own routers (ai-forward.ts:29-33).
  • The settings catalog calls mapleToolCatalogFor("mcp"), the same source the public transport's tools/list uses, so the hardcoded list is truly gone.
Observability coverage: 3 of 3 changes observable
Change Kind Observable Evidence
GET/DELETE /v2/mcp_connections HTTP route yes Mounted in apps/api/src/runtime/http-graph.ts:185; api emits a Server span per route (route_usage lists /v2/* routes).
GET /internal/mcp/tools HTTP route yes HttpMcpToolsLive in apps/ai/src/runtime/http-graph.ts:88; the AI worker traces its HttpApi routes (POST /internal/triage/classify appears in route data).
McpConnectionsService.list/revoke Postgres reads and family revocation database call yes DatabaseLive wraps every execute in a client span with db.system.name=postgresql and peer.service (packages/backend/src/platform/DatabaseLive.ts:129-162).

fcadd90 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@Makisuo

Makisuo commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

Preview test results and traces for the whole stack are on #1531 (all flows passed on the latest deploy).

@maple-review-bot

maple-review-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Maple review

Nothing to review

Nothing left to review: since the last review at fcadd90 the head only advanced by merging the base branch, and the single file that moved, apps/web/src/components/settings/spend-chart.tsx, comes from the base branch. No change in this pull request is new.

Production impact

Production traffic of the changed files (last 7 days)
File Calls/day Busiest operations
apps/api/src/worker/ai-forward.ts 24k POST /mcp 11k/day, 0.0% err
POST /mcp 11k/day, 0.0% err
GET /mcp 723/day, 0.0% err
apps/ai/src/runtime/http-graph.ts 133 POST /internal/triage/classify 90/day, 0.0% err
POST /internal/triage/classify 43/day, 0.0% err
Telemetry this change adds and removes (3)
  • ➕ span name McpConnectionsService.liveConnections · packages/backend/src/services/auth/McpConnectionsService.ts:88
  • ➕ span name McpConnectionsService.list · packages/backend/src/services/auth/McpConnectionsService.ts:124
  • ➕ span name McpConnectionsService.revoke · packages/backend/src/services/auth/McpConnectionsService.ts:132

fb149bf · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

# Conflicts:
#	apps/api/src/routes/v2/v2-test-support.ts
@maple-review-bot

maple-review-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 8/10 · likely safe to merge
Held at 8 because 1 reviewed file was not read.
quality 100/100 · no findings · tests covered · risk medium · 4/4 new units observable · 1 file not read

Redesigns the MCP settings tab around a live tool catalog served by the AI worker, per-client connect snippets, and a /v2/mcp_connections list/revoke API over OAuth grant families. Org scoping, derived scopes, family revocation and the new telemetry hold up; the regenerated iOS OpenAPI snapshot was left unread.

  • GET/DELETE /v2/mcp_connections lists and revokes one row per OAuth grant family
  • McpConnectionsService derives a connection from the newest live refresh token of each family
  • GET /internal/mcp/tools serves the real registry catalog, forwarded by the api worker
  • /v2/api_keys no longer lists the hourly maple_mcp_oauth access keys

Production impact

Production traffic of the changed files (last 7 days)
File Calls/day Busiest operations
apps/api/src/worker/ai-forward.ts 23k POST /mcp 11k/day, 0.0% err
POST /mcp 11k/day, 0.0% err
GET /mcp 722/day, 0.0% err
apps/ai/src/runtime/http-graph.ts 134 POST /internal/triage/classify 90/day, 0.0% err
POST /internal/triage/classify 44/day, 0.0% err
Telemetry this change adds and removes (3)
  • ➕ span name McpConnectionsService.liveConnections · packages/backend/src/services/auth/McpConnectionsService.ts:88
  • ➕ span name McpConnectionsService.list · packages/backend/src/services/auth/McpConnectionsService.ts:124
  • ➕ span name McpConnectionsService.revoke · packages/backend/src/services/auth/McpConnectionsService.ts:132
What was checked
  • Revoke re-reads the family through the org- and viewer-scoped query before writing (McpConnectionsService.ts:138)
  • /internal/mcp/tools is reached only through the shared bridge under SessionAuthorization (mcp-tools.ts:30)
  • The api-key filter drops only source = maple_mcp_oauth rows, keeping NULL metadata (ApiKeysService.ts:265)
Observability coverage: 4 of 4 changes observable
Change Kind Observable Evidence
GET/DELETE /v2/mcp_connections inbound HTTP route yes Joined ApiV2Routes in apps/api/src/runtime/http-graph.ts and served by the api worker's traced bridge; live maple-api spans carry http.route alongside orgId
GET /internal/mcp/tools inbound HTTP route yes HttpApiBuilder.layer(MapleAiApi) in apps/ai/src/runtime/http-graph.ts:86 rides the shared @maple/infra/worker-http bridge (apps/ai/src/worker/http.ts:36), the same path that stamps maple-ai POST /mcp
MCP connection reads/writes (Postgres) outbound database call yes db.* attributes (db.system.name, db.operation.name, db.query.text) on maple-api spans come from the same PG layer this service uses
api -> maple-ai forwarding of /internal/mcp/ outbound service call yes forwardToAi replaces traceparent with this hop's span (ai-forward.ts:103), pinned in ai-forward.test.ts:83 so the service-map edge survives
Files not reviewed (1)

The review ended before it read these diffs, so nothing above vouches for them.

  • apps/ios/Packages/MapleAPI/Sources/MapleAPI/openapi.json

17b4aa0 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@maple-review-bot

maple-review-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 9/10 · safe to merge
The only delta since the last review is the CFG-SAMP-01 action in setup-health.ts, verified against the DOCS table it now points at.
quality 100/100 · no findings · tests partial · risk low

Since the previous review the only delta is setup-health.ts: CFG-SAMP-01 now sends the user to the sampling docs page instead of the ingestion tab anchor. The link target exists in DOCS, so this is safe to merge.

  • setupHealthAction returns a docs action for CFG-SAMP-01 instead of a settings-tab link

Production impact

Production traffic of the changed files (last 7 days)
File Calls/day Busiest operations
apps/api/src/worker/ai-forward.ts 23k POST /mcp 11k/day, 0.0% err
POST /mcp 11k/day, 0.0% err
GET /mcp 722/day, 0.0% err
apps/ai/src/runtime/http-graph.ts 135 POST /internal/triage/classify 91/day, 0.0% err
POST /internal/triage/classify 44/day, 0.0% err
Telemetry this change adds and removes (3)
  • ➕ span name McpConnectionsService.liveConnections · packages/backend/src/services/auth/McpConnectionsService.ts:88
  • ➕ span name McpConnectionsService.list · packages/backend/src/services/auth/McpConnectionsService.ts:124
  • ➕ span name McpConnectionsService.revoke · packages/backend/src/services/auth/McpConnectionsService.ts:132
What was checked
  • docsUrl("samplingThroughput") resolves to an existing DOCS entry (apps/web/src/lib/docs.ts:10)
  • The existing setupHealthAction registry test still covers the changed branch (setup-health.test.ts:10)

7ba87e5 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@Makisuo
Makisuo merged commit 742e03e into main Oct 17, 2026
36 of 50 checks passed
@Makisuo
Makisuo deleted the feat/settings-mcp branch October 17, 2026 14:55
@maple-review-bot

Copy link
Copy Markdown

Maple: after this shipped

✅ Shipped clean. Nothing this change touches got worse in the hour after it deployed.

Deployed to maple-api (pr-1509) at 2026-10-17 14:55 UTC as c2bbc23, the first version after the merge (the merge commit itself never reported). Compared the 60 minutes before and after.

Operation Calls/h Errors p95
POST /mcp 182 → 128 0.0% → 0.0% 1014 → 587 ms
POST /mcp 182 → 128 0.0% → 0.0% 1913 → 1977 ms
GET /mcp 0 → 7 0.0% → 0.0% 0 → 97 ms
GET /mcp 0 → 7 0.0% → 0.0% 0 → 1265 ms
POST /internal/triage/classify 12 → 6 0.0% → 0.0% 1641 → 1212 ms
POST /internal/triage/classify 12 → 6 0.0% → 0.0% 3246 → 1400 ms

Maple looks once, an hour after the first deploy that carries the merge.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant