Skip to content
Open
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
59f1e9f
fix(stdio): add stdin close/end listeners to prevent zombie processes
ElliotDrel May 2, 2026
a7dc3bb
style: run prettier on FastMCP.ts
ElliotDrel May 2, 2026
27e5d4b
fix: address Copilot review — idempotency, listener cleanup, and stdi…
ElliotDrel May 2, 2026
8ee2261
fix: resolve ESLint sort-objects and no-unused-vars in stdio test
ElliotDrel May 2, 2026
46b8c62
fix(lint): remove unused params from stdinOffSpy mockImplementation
ElliotDrel May 2, 2026
9863deb
fix(lint): apply prettier formatting to stdio test file
ElliotDrel May 2, 2026
d190692
fix(test): hoist vi.mock to module level to fix Vitest hoisting issue
ElliotDrel May 2, 2026
7b995fb
fix(test): use fake timers to skip FastMCPSession capability retry loop
ElliotDrel May 2, 2026
b643fe9
fix(test): use regular function in vi.fn mock so new StdioServerTrans…
ElliotDrel May 2, 2026
80e614d
test: add integration test for stdin-close zombie prevention
ElliotDrel May 2, 2026
9edc18c
style: fix prettier formatting in stdio integration test
ElliotDrel May 3, 2026
838b14e
fix(lint): fix perfectionist ordering in stdio integration test
ElliotDrel May 3, 2026
5350f15
fix(test): increase timeout for tsx cold-download in CI (60s ready, 9…
ElliotDrel May 3, 2026
2f7f8b8
fix(test): add tsx devDep, use installed binary instead of npx cold-d…
ElliotDrel May 3, 2026
a4b43d3
fix: update pnpm-lock.yaml after adding tsx devDependency
ElliotDrel May 3, 2026
2f7750a
fix(test): use temp .ts file instead of --eval so ESM imports resolve…
ElliotDrel May 3, 2026
e8d8f58
style: fix prettier formatting in integration test
ElliotDrel May 3, 2026
258b9d1
fix(lint): sort named imports, add comment to empty catch blocks
ElliotDrel May 3, 2026
582d869
revert: remove integration test and tsx devDep
ElliotDrel May 3, 2026
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
9 changes: 9 additions & 0 deletions src/FastMCP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2620,6 +2620,15 @@ export class FastMCP<

await session.connect(transport);

// Belt-and-suspenders: detect when the MCP client closes its end of
// the stdin pipe and shut down the transport so the process doesn't
// linger as a zombie/orphan. The upstream SDK fix (PR #2003) handles
// this inside StdioServerTransport itself, but adding the listener here
// means older SDK versions are also protected.
const onStdinClose = () => { transport.close().catch(() => {}); };
process.stdin.on("close", onStdinClose);
process.stdin.on("end", onStdinClose);
Comment thread
ElliotDrel marked this conversation as resolved.
Outdated
Comment thread
ElliotDrel marked this conversation as resolved.
Comment thread
ElliotDrel marked this conversation as resolved.

this.#sessions.push(session);

session.once("error", () => {
Expand Down
Loading