We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It appears that the most basic version of starting/stopping an MCP server leaves a handle or reference open which prevents node from exiting.
I've observed that if I process.stdin.destroy() then I can unblock MCP and get the whatever handles it is using to close.
process.stdin.destroy()
Versions: node: v23.2.0 @modelcontextprotocol/sdk: 1.0.4
v23.2.0
1.0.4
import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; const server = new Server( { name: 'foo/bar', version: '0.0.1', }, { capabilities: { resources: {}, tools: {}, }, }, ); async function main() { const transport = new StdioServerTransport(); server.connect(transport); await server.close(); await transport.close(); console.warn('Will I hang forever here? Unfortunately, yes.'); // Destroying stdin prevents the hang, but it's ugly: // process.stdin.destroy(); } main();
The uncleaned handles appear to be added in server.connect(transport); since it will exit cleanly if I comment that line.
server.connect(transport);
The text was updated successfully, but these errors were encountered:
Merge pull request modelcontextprotocol#113 from gavinaboulhosn/featu…
db1b5cb
…re/completions Implement MCP Completion Support in Prompts and Resources Tabs
Successfully merging a pull request may close this issue.
Uh oh!
There was an error while loading. Please reload this page.
It appears that the most basic version of starting/stopping an MCP server leaves a handle or reference open which prevents node from exiting.
I've observed that if I
process.stdin.destroy()
then I can unblock MCP and get the whatever handles it is using to close.Versions:
node:
v23.2.0
@modelcontextprotocol/sdk:
1.0.4
The uncleaned handles appear to be added in
server.connect(transport);
since it will exit cleanly if I comment that line.The text was updated successfully, but these errors were encountered: