A TypeScript library that provides proxy implementations for communication between transport layers of MCP.
Currently supports stdio proxy with Server-Sent Events (SSE) for bidirectional communication.
Wherever you have to put the command to run your MCP server, add the following command:
npx -y @indusbit/mcp-proxy stdioBy default, it connects to http://localhost:4000/sse.
MCP_SERVER_URL: The URL for the SSE connectionMCP_LOG_FILE: Path to a log file for debugging (if not set, logging is disabled)
After cloning the repository, install dependencies:
npm installTo start the stdio proxy, set the MCP_SERVER_URL environment variable to the base URL of the SSE server:
MCP_SERVER_URL=http://localhost:3000/sse npx . stdioYou can also set the MCP_LOG_FILE environment variable to a path to a log file for debugging:
MCP_SERVER_URL=http://localhost:3000/sse MCP_LOG_FILE=./logs/stdio.log npx stdioWhen settign the MCP_LOG_FILE environment variable in an MCP client (like claude), don't forget to provide it a full path.
The stdio proxy establishes a bidirectional communication channel between standard input/output and a server using Server-Sent Events (SSE):
- Connects to an SSE endpoint specified by
MCP_SERVER_URL(defaults to "http://localhost:4000/sse") - Receives a messaging endpoint from the server via an "endpoint" event
- Forwards messages from stdin to the server via HTTP POST requests
- Forwards messages from the server to stdout
The following environment variables can be used to configure the proxies:
MCP_SERVER_URL: The base URL for the SSE connection (default: "http://localhost:4000/sse")MCP_LOG_FILE: Path to a log file for debugging (if not set, logging is disabled)
npm run buildMIT