Skip to content

Commit 0040403

Browse files
Jacob Joveclaude
authored andcommitted
test(mcp): cover superdoc_attach in protocol tool-list assertions
The collab feature added a superdoc_attach lifecycle tool; the protocol integration test predates it. Add superdoc_attach to EXPECTED_TOOLS and to the action-enum / session_id exclusion lists — like superdoc_open, attach creates a session rather than consuming one, so it carries no action enum and no required session_id. No other test changes: the full apps/mcp suite (incl. dist-bundle) passes as-is once the workspace is built per ci-mcp.yml (pnpm run build:superdoc before apps/mcp test). The transient '9 failing tests' seen locally were solely the missing build:superdoc step, not a code or bundler defect. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 35d0ec1 commit 0040403

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

apps/mcp/src/__tests__/protocol.test.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
66
const BLANK_DOCX = resolve(import.meta.dir, '../../../../shared/common/data/blank.docx');
77
const SERVER_ENTRY = resolve(import.meta.dir, '../index.ts');
88

9-
// 3 lifecycle + 10 intent tools from the generated catalog
9+
// 4 lifecycle + 10 intent tools from the generated catalog
1010
const EXPECTED_TOOLS = [
1111
// Lifecycle
1212
'superdoc_open',
13+
'superdoc_attach',
1314
'superdoc_save',
1415
'superdoc_close',
1516
// Intent tools (from catalog.json)
@@ -77,8 +78,10 @@ describe('MCP protocol integration', () => {
7778
const { tools } = await client.listTools();
7879

7980
// Multi-action intent tools should have an "action" property with an enum
81+
// superdoc_attach, like superdoc_open, is a session-creating lifecycle tool — no action enum.
8082
const multiActionTools = tools.filter(
81-
(t) => !['superdoc_open', 'superdoc_save', 'superdoc_close', 'superdoc_search'].includes(t.name),
83+
(t) =>
84+
!['superdoc_open', 'superdoc_attach', 'superdoc_save', 'superdoc_close', 'superdoc_search'].includes(t.name),
8285
);
8386

8487
for (const tool of multiActionTools) {
@@ -93,8 +96,11 @@ describe('MCP protocol integration', () => {
9396
await ready;
9497
const { tools } = await client.listTools();
9598

96-
// All intent tools (not lifecycle open) should require session_id
97-
const intentTools = tools.filter((t) => !['superdoc_open', 'superdoc_save', 'superdoc_close'].includes(t.name));
99+
// All intent tools (not session-creating lifecycle tools) should require session_id.
100+
// superdoc_open and superdoc_attach both produce a session_id rather than consuming one.
101+
const intentTools = tools.filter(
102+
(t) => !['superdoc_open', 'superdoc_attach', 'superdoc_save', 'superdoc_close'].includes(t.name),
103+
);
98104

99105
for (const tool of intentTools) {
100106
const schema = tool.inputSchema as { properties?: Record<string, unknown>; required?: string[] };

0 commit comments

Comments
 (0)