Crates.io | mcp-proxy-tool |
lib.rs | mcp-proxy-tool |
version | 0.1.0 |
created_at | 2025-07-30 20:49:54.517108+00 |
updated_at | 2025-07-30 20:49:54.517108+00 |
description | Cross-platform MCP (Model Context Protocol) proxy tool |
homepage | https://github.com/awakecoding/mcp-proxy-tool |
repository | https://github.com/awakecoding/mcp-proxy-tool |
max_upload_size | |
id | 1774064 |
size | 165,576 |
A high-performance MCP (Model Context Protocol) proxy tool written in Rust that enables connections to HTTP-based, STDIO-based, and named pipe-based MCP servers. This tool acts as a bridge, converting between different MCP transport protocols and making MCP servers accessible through a unified interface.
Download the latest release for your platform from the GitHub Releases page.
Option 1: Direct Download
mcp-proxy-tool-windows-x64.zip
(Intel/AMD) or mcp-proxy-tool-windows-arm64.zip
(ARM64)Option 2: Winget (Coming Soon)
winget install awakecoding.mcp-proxy-tool
Option 1: Direct Download
mcp-proxy-tool-macos-x64.zip
(Intel) or mcp-proxy-tool-macos-arm64.zip
(Apple Silicon)unzip mcp-proxy-tool-*.zip
sudo mv mcp-proxy-tool /usr/local/bin/
Option 2: Homebrew (Coming Soon)
brew tap awakecoding/tap
brew install mcp-proxy-tool
Direct Download
mcp-proxy-tool-linux-x64.zip
(x86_64) or mcp-proxy-tool-linux-arm64.zip
(ARM64)unzip mcp-proxy-tool-*.zip
sudo mv mcp-proxy-tool /usr/local/bin/
Prerequisites: Rust (latest stable version)
git clone https://github.com/awakecoding/mcp-proxy-tool.git
cd mcp-proxy-tool
cargo build --release
The compiled binary will be available at target/release/mcp-proxy-tool
.
cargo install mcp-proxy-tool
Usage: mcp-proxy-tool [-u <url>] [-c <command>] [-a <args>] [-p <pipe>] [-t <timeout>] [-v]
Options:
-u, --url URL of the remote HTTP-based MCP server to proxy requests to
-c, --command command to execute for STDIO-based MCP server
-a, --args arguments for the STDIO-based MCP server command
-p, --pipe path to named pipe for named pipe-based MCP server
-t, --timeout timeout in seconds for HTTP requests (ignored for STDIO and named pipe)
-v, --verbose enable verbose logging
--help, help display usage information
Connect to a remote HTTP-based MCP server:
# Connect to Microsoft Learn MCP server
./target/release/mcp-proxy-tool -u https://learn.microsoft.com/api/mcp
# With verbose logging and custom timeout
./target/release/mcp-proxy-tool -u https://learn.microsoft.com/api/mcp -v -t 60
Launch and connect to a local executable MCP server:
# Connect to a Python MCP server
./target/release/mcp-proxy-tool -c python3 -a mcp_server.py
# Connect to a Node.js MCP server with arguments
./target/release/mcp-proxy-tool -c node -a "server.js --config config.json"
# With verbose logging
./target/release/mcp-proxy-tool -c python3 -a mcp_server.py -v
Connect to an MCP server over named pipes (cross-platform):
Unix/Linux/macOS:
# Connect to a Unix domain socket
./target/release/mcp-proxy-tool -p /tmp/mcp_server.sock
# Connect to a FIFO named pipe
./target/release/mcp-proxy-tool -p /var/run/mcp/server.pipe -v
Windows:
# Connect to a Windows named pipe (short form)
mcp-proxy-tool.exe -p mcp_server
# Connect to a Windows named pipe (full path)
mcp-proxy-tool.exe -p \\.\pipe\mcp_server -v
PowerShell Examples:
# List tools from Windows named pipe MCP server
'{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | .\mcp-proxy-tool.exe -p mcp_server
# Call tool with verbose logging
'{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"example","arguments":{"text":"Hello Windows!"}}}' | .\mcp-proxy-tool.exe -p \\.\pipe\mcp_server -v
# Use default Microsoft Learn MCP server
echo '{"method": "tools/list", "params": {}}' | ./target/debug/mcp-proxy-tool
# Use custom MCP server with verbose logging
echo '{"method": "tools/list", "params": {}}' | ./target/debug/mcp-proxy-tool --url "https://your-server.com/mcp" --verbose
# Set custom timeout
./target/debug/mcp-proxy-tool --timeout 60 --verbose
# Search Microsoft Learn documentation
echo '{"method": "tools/call", "params": {"name": "microsoft_docs_search", "arguments": {"question": "Azure Functions"}}}' | ./target/debug/mcp-proxy-tool
# Initialize connection
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | ./target/release/mcp-proxy-tool -u https://learn.microsoft.com/api/mcp
# List available tools
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | ./target/release/mcp-proxy-tool -u https://learn.microsoft.com/api/mcp
# Call a tool
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"microsoft_docs_search","arguments":{"question":"How to use Azure Functions?"}}}' | ./target/release/mcp-proxy-tool -u https://learn.microsoft.com/api/mcp
# List tools from Python MCP server
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | ./target/release/mcp-proxy-tool -c python3 -a echo_server.py
# Call tool via STDIO transport
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"echo","arguments":{"text":"Hello STDIO!"}}}' | ./target/release/mcp-proxy-tool -c python3 -a echo_server.py
# List tools from named pipe MCP server
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | ./target/release/mcp-proxy-tool -p /tmp/mcp_server.sock
# Call tool via named pipe transport
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"pipe_echo","arguments":{"message":"Hello Named Pipe!"}}}' | ./target/release/mcp-proxy-tool -p /tmp/mcp_server.sock -v
Windows named pipes use a different path format than Unix:
pipename
(automatically converted to \\.\pipe\pipename
)\\.\pipe\pipename
(explicit Windows named pipe path)Command Prompt:
REM List tools from Windows named pipe MCP server
echo {"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}} | mcp-proxy-tool.exe -p mcp_server
REM Call tool with full pipe path
echo {"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"example","arguments":{"text":"Hello Windows!"}}} | mcp-proxy-tool.exe -p \\.\pipe\mcp_server -v
PowerShell:
# List tools from Windows named pipe MCP server
'{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | .\mcp-proxy-tool.exe -p mcp_server
# Call tool with verbose logging
'{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"example","arguments":{"text":"Hello Windows!"}}}' | .\mcp-proxy-tool.exe -p \\.\pipe\mcp_server -v
Example Python server for Windows (requires pywin32
):
import win32pipe
import win32file
import json
import threading
def handle_client(pipe):
while True:
try:
# Read request
result, data = win32file.ReadFile(pipe, 4096)
request = json.loads(data.decode('utf-8').strip())
# Process request (example)
if request.get('method') == 'tools/list':
response = {
"jsonrpc": "2.0",
"id": request.get('id'),
"result": {"tools": [{"name": "echo", "description": "Echo tool"}]}
}
else:
response = {
"jsonrpc": "2.0",
"id": request.get('id'),
"error": {"code": -32601, "message": "Method not found"}
}
# Send response
win32file.WriteFile(pipe, (json.dumps(response) + '\n').encode('utf-8'))
except Exception as e:
print(f"Error: {e}")
break
win32file.CloseHandle(pipe)
def main():
pipe_name = r'\\.\pipe\mcp_server'
while True:
pipe = win32pipe.CreateNamedPipe(
pipe_name,
win32pipe.PIPE_ACCESS_DUPLEX,
win32pipe.PIPE_TYPE_MESSAGE | win32pipe.PIPE_READMODE_MESSAGE | win32pipe.PIPE_WAIT,
1, 65536, 65536, 0, None
)
win32pipe.ConnectNamedPipe(pipe, None)
# Handle client in thread
thread = threading.Thread(target=handle_client, args=(pipe,))
thread.start()
if __name__ == "__main__":
main()
Feature | Unix/Linux/macOS | Windows |
---|---|---|
Path Format | /path/to/socket |
pipename or \\.\pipe\pipename |
Connection Type | Unix Domain Socket | Windows Named Pipe |
Permissions | File system permissions | Windows security descriptors |
Performance | Very high (kernel bypass) | High (optimized IPC) |
Auto-cleanup | OS handles cleanup | OS handles cleanup |
\\.\pipe\name
)You can configure multiple proxy instances in your .vscode/mcp.json
:
{
"servers": {
"microsoft-learn-proxy": {
"type": "stdio",
"command": "/path/to/mcp-proxy-tool",
"args": ["--url", "https://learn.microsoft.com/api/mcp", "--verbose"]
},
"custom-mcp-proxy": {
"type": "stdio",
"command": "/path/to/mcp-proxy-tool",
"args": ["--url", "https://your-custom-server.com/mcp", "--timeout", "60"]
}
}
}
# Start MCP Inspector and connect to your proxy
mcp-inspector
# Then in the web interface, add a server:
# - Command: /path/to/mcp-proxy-tool
# - Args: --url https://your-server.com/mcp --verbose
Input:
{
"method": "tools/list",
"params": {}
}
Output:
{
"request": {
"method": "tools/list",
"params": {}
},
"response": {
"id": 1,
"jsonrpc": "2.0",
"result": {
"tools": [
{
"description": "Search official Microsoft/Azure documentation to find the most relevant and trustworthy content for a user's query. This tool returns up to 10 high-quality content chunks (each max 500 tokens), extracted from Microsoft Learn and other official sources. Each result includes the article title, URL, and a self-contained content excerpt optimized for fast retrieval and reasoning. Always use this tool to quickly ground your answers in accurate, first-party Microsoft/Azure knowledge.",
"inputSchema": {
"description": "Search official Microsoft/Azure documentation to find the most relevant and trustworthy content for a user's query. This tool returns up to 10 high-quality content chunks (each max 500 tokens), extracted from Microsoft Learn and other official sources. Each result includes the article title, URL, and a self-contained content excerpt optimized for fast retrieval and reasoning. Always use this tool to quickly ground your answers in accurate, first-party Microsoft/Azure knowledge.",
"properties": {
"question": {
"description": "a question or topic about Microsoft/Azure products, services, platforms, developer tools, frameworks, or APIs",
"type": "string"
}
},
"required": [
"question"
],
"title": "microsoft_docs_search",
"type": "object"
},
"name": "microsoft_docs_search"
}
]
}
}
}
Input:
{
"method": "tools/call",
"params": {
"name": "microsoft_docs_search",
"arguments": {
"question": "Azure CLI create container app"
}
}
}
Output (truncated for brevity):
{
"request": {
"method": "tools/call",
"params": {
"arguments": {
"question": "Azure CLI create container app"
},
"name": "microsoft_docs_search"
}
},
"response": {
"id": 1,
"jsonrpc": "2.0",
"result": {
"content": [
{
"text": "[{\"title\":\"az containerapp create\",\"content\":\"### Command\\naz containerapp create\\n\\n### Summary\\nCreate a container app.\\n\\n### Required Parameters\\n\\n--name -n\\nThe name of the Containerapp. A name must consist of lower case alphanumeric characters or '-', start with a letter, end with an alphanumeric character, cannot have '--', and must be less than 32 characters.\\n\\n--resource-group -g\\nName of resource group. You can configure the default group using `az configure --defaults group=<name>`.\\n\\n### Optional Parameters\\n\\n--allow-insecure\\nAllow insecure connections for ingress traffic...\"},{\"title\":\"Use Azure Functions in Azure Container Apps (azure-cli)\",\"content\":\"# Use Azure Functions in Azure Container Apps (azure-cli)\\n## Create a Functions App\\nTo sign in to Azure from the CLI, run the following command and follow the prompts to complete the authentication process...\"},{\"title\":\"Tutorial: Deploy your first container app\",\"content\":\"# Tutorial: Deploy your first container app\\nThe Azure Container Apps service enables you to run microservices and containerized applications on a serverless platform...\"}]",
"type": "text"
}
],
"isError": false
}
}
}
You can also pipe input from files:
cat request.json | ./mcp-proxy-tool > response.json
#!/bin/bash
# Example script to interact with Microsoft Learn Docs
echo "Listing available tools..."
echo '{"method": "tools/list", "params": {}}' | ./target/debug/mcp-proxy-tool
echo "Searching Azure CLI documentation..."
echo '{"method": "tools/call", "params": {"name": "microsoft_docs_search", "arguments": {"question": "Azure CLI create container app"}}}' | ./target/debug/mcp-proxy-tool
echo "Searching .NET documentation..."
echo '{"method": "tools/call", "params": {"name": "microsoft_docs_search", "arguments": {"question": "C# async await best practices"}}}' | ./target/debug/mcp-proxy-tool
# Search for specific Azure service information
echo '{"method": "tools/call", "params": {"name": "microsoft_docs_search", "arguments": {"question": "Azure Container Apps environment"}}}' | ./target/debug/mcp-proxy-tool
# Find Azure CLI command documentation
echo '{"method": "tools/call", "params": {"name": "microsoft_docs_search", "arguments": {"question": "az containerapp create command"}}}' | ./target/debug/mcp-proxy-tool
# Search for development guidance
echo '{"method": "tools/call", "params": {"name": "microsoft_docs_search", "arguments": {"question": "Azure Functions deployment best practices"}}}' | ./target/debug/mcp-proxy-tool
# Find API documentation
echo '{"method": "tools/call", "params": {"name": "microsoft_docs_search", "arguments": {"question": "Azure REST API container apps"}}}' | ./target/debug/mcp-proxy-tool
Currently, the MCP server URL is hardcoded to https://learn.microsoft.com/api/mcp
. Future versions will support configurable endpoints via:
The tool provides detailed error messages for common issues:
Error messages are written to stderr, while successful responses go to stdout.
All responses follow this structure:
{
"request": {
"method": "string",
"params": "object"
},
"response": {
"jsonrpc": "2.0",
"id": 1,
"result": "object"
}
}
When connecting to the Microsoft Learn Docs MCP server:
tools/list
- List available documentation search toolstools/call
- Execute documentation searches with the microsoft_docs_search
tool:
question
(required) - Your question or topic about Microsoft/Azure products, services, platforms, developer tools, frameworks, or APIsresources/list
- List available documentation resources (if supported)resources/read
- Read specific documentation content (if supported)cargo test
# Unix/Linux/macOS
cargo build
# Windows (Command Prompt)
cargo build
# Windows (PowerShell)
cargo build
# Unix/Linux/macOS
cargo build --release
# Windows (Command Prompt)
cargo build --release
# Windows (PowerShell)
cargo build --release
# Build for Windows (Intel/AMD and ARM64)
cargo build --release --target x86_64-pc-windows-msvc
cargo build --release --target aarch64-pc-windows-msvc
# Build for Linux (x86_64 and ARM64)
cargo build --release --target x86_64-unknown-linux-gnu
cargo build --release --target aarch64-unknown-linux-gnu
# Build for macOS (Intel and Apple Silicon)
cargo build --release --target x86_64-apple-darwin
cargo build --release --target aarch64-apple-darwin
The MCP proxy tool supports three different transport mechanisms:
-u
option)-c
and -a
options)-p
option)\\.\pipe\name
)initialize
- Handled locally by proxynotifications/initialized
- Handled locallytools/list
- Forwarded to target servertools/call
- Forwarded to target servertokio
- Async runtimereqwest
- HTTP client (for HTTP transport)serde_json
- JSON serializationanyhow
- Error handlingargh
- Lightweight CLI parsing[Add your license information here]
https://learn.microsoft.com/api/mcp
microsoft_docs_search
(case-sensitive)question
parameter, not query
or other parameter namesFor verbose logging, you can modify the source to enable debug output or use environment variables like RUST_LOG=debug
.