Skip to content

Commit 3f2c209

Browse files
ochafikclaude
andcommitted
pdf-server: flip interact to opt-in, enable only for --stdio
Rename disableInteract → enableInteract (default false) so existing library consumers get read-only mode without code changes. The CLI entry point passes enableInteract: true only when running with --stdio. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3f2906d commit 3f2c209

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

examples/pdf-server/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ async function main() {
141141
console.error(`[pdf-server] Ready (${urls.length} URL(s) configured)`);
142142

143143
if (stdio) {
144-
await startStdioServer(createServer);
144+
await startStdioServer(() => createServer({ enableInteract: true }));
145145
} else {
146-
await startStreamableHTTPServer(createServer);
146+
await startStreamableHTTPServer(() => createServer());
147147
}
148148
}
149149

examples/pdf-server/server.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -957,16 +957,16 @@ async function extractFormSchema(
957957

958958
export interface CreateServerOptions {
959959
/**
960-
* Disable the `interact` tool and related command-queue infrastructure.
961-
* Use this for distributed deployments where the command queue (in-memory)
962-
* cannot be shared across server instances.
963-
* When true, the server only exposes `list_pdfs` and `display_pdf` (read-only).
960+
* Enable the `interact` tool and related command-queue infrastructure
961+
* (in-memory command queue, `poll_pdf_commands`, `submit_page_data`).
962+
* Only suitable for single-instance deployments (e.g. stdio transport).
963+
* Defaults to false — server exposes only `list_pdfs` and `display_pdf` (read-only).
964964
*/
965-
disableInteract?: boolean;
965+
enableInteract?: boolean;
966966
}
967967

968968
export function createServer(options?: CreateServerOptions): McpServer {
969-
const disableInteract = options?.disableInteract ?? false;
969+
const disableInteract = !(options?.enableInteract ?? false);
970970
const server = new McpServer({ name: "PDF Server", version: "2.0.0" });
971971

972972
// Fetch roots on initialization and subscribe to changes

0 commit comments

Comments
 (0)