Add support for MCP servers over Unix domain sockets and named pipes#268488
Merged
4 commits merged intomicrosoft:mainfrom Sep 26, 2025
bwateratmsft:bmw/mcpOverUDS3
Merged
Add support for MCP servers over Unix domain sockets and named pipes#2684884 commits merged intomicrosoft:mainfrom bwateratmsft:bmw/mcpOverUDS3
4 commits merged intomicrosoft:mainfrom
bwateratmsft:bmw/mcpOverUDS3
Conversation
Contributor
There was a problem hiding this comment.
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 |
Contributor
Author
|
Not sure what I'm supposed to do about the failing check for |
connor4312
reviewed
Sep 26, 2025
Member
connor4312
left a comment
There was a problem hiding this comment.
A few nits but overall good
2aaf297
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.