This server provides a way to proxy command-line tools (like Expo) through an MCP (Model Context Protocol) interface, making them accessible to AI assistants like Claude in tools like Cursor. It captures command output, allows interaction with running processes, and maintains a log history.
You can install and run the MCP Command Proxy in several ways:
Using npx (simplest method):
npx mcp-command-proxy --prefix "ExpoServer" --command "expo start" --port 8383
Install and build from source:
# Install dependencies
pnpm install
# Build the project
pnpm build
# Run directly
pnpm start -- --prefix "MyServer" --command "expo start"
Install globally:
pnpm install -g
mcp-command-proxy --prefix "MyServer" --command "expo start"
When running the command proxy, you can provide several options:
mcp-command-proxy --prefix "ExpoServer" --command "expo start" --port 8383 --buffer-size 500
--prefix, -p
: Name/prefix for the server (default: "CommandProxy")--command, -c
: Command to run (required)--buffer-size, -b
: Number of log lines to keep in memory (default: 300)--port
: Port for HTTP server (default: 8080)--help, -h
: Show helpnpx mcp-command-proxy --prefix "ExpoServer" --command "expo start" --port 8383
http://localhost:8383/sse
You can also use the server programmatically in your own Node.js applications:
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();
The server implements these MCP tools:
Returns the most recent logs from the buffer.
Parameters:
limit
(optional): Number of logs to return (default: 100)types
(optional): Types of logs to include (stdout, stderr, system) (default: all)Sends a key press to the running process.
Parameters:
key
: Key to send (e.g. "enter", "a", "1", "space")Returns the current status of the process.
Parameters: None
You can add the following instruction to your .cursorrules
file to help your AI assistant use the MCP server effectively:
You can use MCP getRecentLogs tool to get the most recent logs from Expo server. And if needed, you can send key presses to the running process using sendKeyPress tool.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "ExpoServer" '{"type":"sse","url":"http://localhost:8383/sse"}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"ExpoServer": {
"type": "sse",
"url": "http://localhost:8383/sse"
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"ExpoServer": {
"type": "sse",
"url": "http://localhost:8383/sse"
}
}
}
3. Restart Claude Desktop for the changes to take effect