Skip to content

Commit ff73289

Browse files
authored
Add MCP service bridge for connected-site actions (#56)
## Summary - add MCP service-binding routes for connected-site action discovery and execution - reuse the existing connected-site grant/catalog/input validation and signed delegation path - bind execution to the live MCP grant principal without exposing or storing a long-lived agent credential - normalize telemetry for the new service routes ## Validation - `npm run check` — 212 files, 0 errors/warnings/hints - `npm run test:d1:core` — 245/245 passing - `git diff --check`
1 parent 8bab97e commit ff73289

3 files changed

Lines changed: 244 additions & 161 deletions

File tree

‎scripts/orbit-slice1-tests.ts‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,34 @@ let firstCredentialToken = '';
11361136
return headers;
11371137
};
11381138

1139+
const noServiceSiteCatalog = await postJson(
1140+
`/v1/mcp/grants/${encodeURIComponent(full.grantId)}/connected-sites/actions`,
1141+
{},
1142+
{},
1143+
NOW + 1_025,
1144+
);
1145+
assert.equal(noServiceSiteCatalog.status, 401);
1146+
1147+
const siteCatalog = await postJson(
1148+
`/v1/mcp/grants/${encodeURIComponent(full.grantId)}/connected-sites/actions`,
1149+
{},
1150+
mcpServiceHeaders(),
1151+
NOW + 1_026,
1152+
);
1153+
assert.equal(siteCatalog.status, 200, await siteCatalog.clone().text());
1154+
const siteCatalogBody = await siteCatalog.json() as { sites: unknown[] };
1155+
assert.ok(Array.isArray(siteCatalogBody.sites));
1156+
1157+
const missingConnectedSite = await postJson(
1158+
`/v1/mcp/grants/${encodeURIComponent(full.grantId)}/connected-sites/not-a-site-grant/actions`,
1159+
{ operationId: 'rota.listeyiOku', input: {}, idempotencyKey: 'mcp-connected-site-missing' },
1160+
mcpServiceHeaders(),
1161+
NOW + 1_027,
1162+
);
1163+
assert.equal(missingConnectedSite.status, 404, await missingConnectedSite.clone().text());
1164+
const missingConnectedSiteBody = await missingConnectedSite.json() as { error: { code: string } };
1165+
assert.equal(missingConnectedSiteBody.error.code, 'connected_site_not_found');
1166+
11391167
const noService = await postJson(
11401168
`/v1/mcp/grants/${encodeURIComponent(full.grantId)}/records`,
11411169
mcpWritePostBody,

0 commit comments

Comments
 (0)