-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Add support for MCP servers over Unix domain sockets and named pipes #268488
New issue
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for MCP (Model Context Protocol) servers over Unix domain sockets and named pipes, providing a more secure alternative to localhost HTTP for local MCP servers while still supporting StreamableHTTP scenarios.
Key changes:
- Extends the MCP HTTP handling to support Unix domain sockets (
unix://) and named pipes (pipe://) schemes - Introduces a Node.js-specific HTTP handler that uses the undici library for socket-based connections
- Adds the undici dependency to handle low-level HTTP over Unix sockets and named pipes
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/workbench/api/node/extHostMcpNode.ts | Implements Node.js-specific MCP HTTP handler with Unix socket and named pipe support using undici |
| src/vs/workbench/api/common/extHostMcp.ts | Refactors base MCP HTTP handler to be extensible and adds common interfaces for fetch operations |
| package.json | Adds undici dependency for Node.js HTTP over Unix sockets functionality |
|
Not sure what I'm supposed to do about the failing check for |
connor4312
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits but overall good
2aaf297
Fixes #268487.
This PR adds support for doing StreamableHTTP MCP servers over Unix domain sockets and named pipes. For local MCP servers, this is generally more secure than standard localhost HTTP. Standard IO servers are still preferable for local MCP servers, but some scenarios are better served by StreambleHTTP--for example, an MCP server can be hosted in the extension host process by an extension using this approach.
/cc @connor4312
Below is some sample extension code. In practice, a random pipe/socket name should be used, and permissions enforced as well, but this shows the gist.