Command Proxy MCP server

Proxy server for CLI commands that captures terminal output in a circular buffer, enabling remote execution, log retrieval, and process management for command-line applications like Expo development tools.
Back to servers
Setup instructions
Provider
Hormold
Release date
Mar 09, 2025
Language
TypeScript
Package
Stats
524 downloads
9 stars

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.

Installation

Prerequisites

  • Node.js 18+
  • TypeScript
  • pnpm (recommended) or npm

Setup Options

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"

Usage

Basic Command Options

When running the command proxy, you can provide several options:

mcp-command-proxy --prefix "ExpoServer" --command "expo start" --port 8383 --buffer-size 500

Available Options

  • --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 help

Using with Cursor (Expo Example)

  1. Navigate to your Expo project directory
  2. Start the MCP command proxy:
    npx mcp-command-proxy --prefix "ExpoServer" --command "expo start" --port 8383
    
  3. In Cursor, go to Settings → MCP → +Add new MCP server
  4. Configure the server:
    • Name: "ExpoServer"
    • Type: "SSE"
    • URL: http://localhost:8383/sse
  5. Click "Save"

Programmatic Usage

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();

MCP Integration Features

The server implements these MCP tools:

getRecentLogs

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)

sendKeyPress

Sends a key press to the running process.

Parameters:

  • key: Key to send (e.g. "enter", "a", "1", "space")

getProcessStatus

Returns the current status of the process.

Parameters: None

Enhancing AI Assistant Capabilities

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.

Common Use Cases

  • Expo Development: Run and interact with Expo while collecting logs
  • Build Processes: Monitor builds and analyze logs in real-time
  • Long-running Services: Maintain recent log history for troubleshooting
  • Remote Command Execution: Execute and monitor commands from remote clients

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later