Provides an MCP proxy for running and monitoring CLI commands, with log streaming and key press forwarding.
Configuration
View docs{
"mcpServers": {
"hormold-mcp-command-proxy": {
"url": "http://localhost:8383/sse"
}
}
}You can run a command proxy server that lets you control and observe CLI commands from clients, with real-time output, log history, and the ability to send key presses back to the running process. This MCP server is especially useful for interactive toolchains like Expo development, where you want to manage long-running commands from a remote client while keeping visibility into logs and interactivity.
Set up your MCP client to connect to the server you run, and you’ll be able to execute CLI commands through the MCP proxy as if you were running them directly in your terminal. For Expo-style workflows, you start the command on the server and then access its live output and log history from the client. You can view recent logs, send key presses (for interactive programs), and check the current status of the running process. When you configure the client, point it to the server’s SSE endpoint and give it a recognizable name so you can switch between multiple servers easily.
Prerequisites: ensure you have Node.js 18 or newer installed on your machine. You will also use a modern package manager such as pnpm or npm.
Install dependencies and build the project, then start the server. Run these commands in order:
pnpm install
pnpm build
# Run directly for a specific server configuration
pnpm start -- --prefix "ExpoServer" --command "expo start" --port 8383
# Or install globally and run the MCP proxy with a specific server
pnpm install -g
mcp-command-proxy --prefix "ExpoServer" --command "expo start" --port 8383
"],The MCP server can be configured to expose an HTTP/SSE endpoint for clients to connect. Use a local URL such as http://localhost:8383/sse when you start the server with a specific prefix. For Expo development, a typical setup involves exposing an SSE endpoint, and optionally running a separate local command proxy for the Expo process.
You can also run the server programmatically to customize behavior. For example, you can create a server instance by providing a prefix, a command to run, a log buffer size, and a port, then start and later stop the server as needed.
{
"type": "stdio",
"name": "expo_proxy",
"command": "expo",
"args": ["start"],
"bufferSize": 500,
"port": 8080
}
```
```json
{
"type": "http",
"name": "expo_proxy_http",
"url": "http://localhost:8080/sse",
"args": []
}Running Expo Start with an explicit port and prefix to avoid conflicts:
mcp-command-proxy -p "ExpoServer" -c "expo start" -b 500
# Programmatic usage example
import { createServer } from 'mcp-command-proxy';
const server = await createServer({
prefix: 'ExpoServer',
command: 'expo start',
bufferSize: 500,
port: 8080
});
// To stop the server later
server.stop();Limit access to the MCP SSE endpoint to trusted clients. If you expose the server over a network, ensure you use secure channels and appropriate authentication as needed by your environment.
For interactive CLI tools, the server forwards key presses from the client to the running process, enabling you to interact with prompts and other interactive features as if you were typing directly in the terminal.
If you don’t see live output or logs in the client, verify that the server process is running and that the correct port and SSE URL are configured in the client. Check that the log buffer size is sufficient for your needs and, if needed, increase it to retain more history.
If a command finishes quickly and you expected long-running behavior, confirm your command includes any necessary flags or environment setup. Remember that some interactive commands require a running PTY session to render prompts correctly.
Returns the most recent logs from the running command, with options to filter by log types and limit.
Sends a key press to the running process to simulate user input.
Provides the current status of the running command (e.g., running, finished, error).