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
8 changes: 8 additions & 0 deletions .changeset/35778-mcp-skill-pointer-refusal-hint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@objectstack/mcp': patch
---

Clause-②: no
Metadata-protocol: none

The open MCP door's default `initialize` instructions now say where the usage guide is served: a `GET` on the MCP endpoint's path plus `/skill` (by default `/api/v1/mcp/skill`) returns the `SKILL.md` that carries the teaching text the tool descriptions no longer hold. A host's own instructions and a configured `instructions` text are unchanged. `run_action`'s description again says what a `no_confirmation_service` refusal leaves the caller: a person performs the action in the app, and the agent does not make the same change with another tool.
25 changes: 25 additions & 0 deletions packages/mcp/src/initialize-selection-rule-34686.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,28 @@ describe('[#34774] initialize instructions — the authoring contract line, and
expect(text.length).toBeLessThan(4096);
});
});

/**
* [#35778] The default text says where the usage guide is served: the teaching
* prose moved out of the tool descriptions into the served SKILL.md, so a
* client that never fetches it is pointed there. The route is anonymous and
* mounted beside the MCP endpoint, so the sentence rides every grant's default
* answer; a host's or the configured text stays whole (pinned above).
*/
describe('[#35778] initialize instructions — the default text points at the served SKILL.md', () => {
const POINTER = 'Usage guide (SKILL.md): GET this endpoint\'s path plus /skill (by default /api/v1/mcp/skill).';
const runtime = new MCPServerRuntime({ name: 't', version: '0.0.1-operator' });

it('is in the first paragraph for every grant, with and without an authoring registry', async () => {
for (const o of [
{},
{ grantedScopes: [MCP_OAUTH_SCOPE_DATA_READ] },
{ grantedScopes: [MCP_OAUTH_SCOPE_DATA_WRITE] },
{ grantedScopes: [MCP_OAUTH_SCOPE_METADATA_WRITE], authoring: {} },
{ grantedScopes: [MCP_OAUTH_SCOPE_DATA_READ], authoring: {} },
] as Opts[]) {
const text = await instructionsOf(runtime, makeBridge(), o);
expect(text.split('\n\n')[0], JSON.stringify(o)).toContain(POINTER);
}
});
});
16 changes: 16 additions & 0 deletions packages/mcp/src/mcp-action-confirmation-handoff-33690.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,3 +511,19 @@ describe('[#33712] Streamable HTTP: initialize batched with a tool call', () =>
expect(bridge.calls).toEqual([]);
});
});

/**
* [#35778] run_action's description says what the no-service refusal leaves
* the caller: a person performs the action in the app, and the agent does not
* make the same change through another tool. Door-neutral: it reads true on
* the stdio door and on Streamable HTTP.
*/
describe('[#35778] run_action names the next step on a no_confirmation_service refusal', () => {
it('its tools/list description carries the in-app clause', async () => {
const json = await call(makeBridge('none'), { jsonrpc: '2.0', id: 1, method: 'tools/list' });
const runAction = (json.result.tools as Array<{ name: string; description: string }>).find((t) => t.name === 'run_action');
expect(runAction?.description).toContain(
'On details.reason "no_confirmation_service" a person performs it in the app: do not make the same change with another tool.',
);
});
});
4 changes: 4 additions & 0 deletions packages/mcp/src/mcp-http-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4977,6 +4977,10 @@ export function registerActionTools(
'you are answered status "pending_confirmation" with a pendingId: do not retry, tell the user to approve ' +
'it. A refusal ACTION_CONFIRMATION_REQUIRED (declined, cancelled, timed out, or no confirmation service) ' +
'means nothing ran; do not retry unless the user asks. ' +
// [#35778] The no-service reason's next step, door-neutral: true
// whether or not the client could have confirmed in place.
'On details.reason "no_confirmation_service" a person performs it in the app: do not make the same change ' +
'with another tool. ' +
// [ADR-0151 D3 rule 3] An AI service account is refused, never handed off.
'Under an AI service account\'s own key the call is refused whatever it sends: hand the action to a ' +
'person, or its author declares ai.requiresConfirmation: false when it is safe unattended. ' +
Expand Down
10 changes: 9 additions & 1 deletion packages/mcp/src/mcp-server-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1794,9 +1794,17 @@ function hostInstructions(
* every grant (a `metadata:write`-only or `actions:execute`-only token lists
* no data tool) and with or without a build door mounted, so it never
* promises building to a deployment that has none.
* [#35778] It also says where the usage guide is: the teaching prose lives in
* the served SKILL.md, not in the tool descriptions, so a client that never
* fetches it is told where it went. The runtime dispatcher mounts the public
* `GET <prefix>/mcp/skill` beside `<prefix>/mcp`, from the same domain list,
* behind the same enable switch and for every grant (it is anonymous), so the
* sentence names it relative to this endpoint and gives the default prefix.
* The stdio default names no URL: a stdio server has no HTTP endpoint.
*/
const DEFAULT_HTTP_INSTRUCTIONS =
'ObjectStack MCP Server. The tools this connection lists depend on what its credential was granted.';
'ObjectStack MCP Server. The tools this connection lists depend on what its credential was granted. '
+ 'Usage guide (SKILL.md): GET this endpoint\'s path plus /skill (by default /api/v1/mcp/skill).';

/**
* [#34774] The authoring contract line (#34659 ruling D4 = A): the
Expand Down
Loading