> ## Documentation Index
> Fetch the complete documentation index at: https://docs.themcp.company/llms.txt
> Use this file to discover all available pages before exploring further.

# Stdio proxy (CLI)

> Zero-code monitoring of any MCP server over stdio

The `mcp-tap` CLI binary sits between any MCP client and server over stdio, transparently intercepting JSON-RPC messages without modifying them.

## Usage

```bash theme={null}
mcp-tap --api-key tap_abc123 -- npx -y @modelcontextprotocol/server-github
```

```bash theme={null}
mcp-tap --api-key tap_abc123 --endpoint https://custom.endpoint/api/v1/events -- python my_server.py
```

With AARM receipt signing:

```bash theme={null}
mcp-tap --api-key tap_abc123 --signing-key ./private-key.pem -- node server.js
```

## CLI flags

| Flag                   | Required | Description                                      |
| ---------------------- | -------- | ------------------------------------------------ |
| `--api-key <key>`      | Yes      | Project API key                                  |
| `--endpoint <url>`     | No       | Custom event ingestion endpoint                  |
| `--signing-key <path>` | No       | Path to Ed25519 private key PEM for AARM signing |

Everything after `--` is treated as the MCP server command.

## How it works

<Steps>
  <Step title="Spawn">
    Spawns the MCP server as a child process.
  </Step>

  <Step title="Forward">
    Forwards stdin from the client to the server, stdout from the server to the client.
  </Step>

  <Step title="Parse">
    Parses JSON-RPC messages on both pipes.
  </Step>

  <Step title="Emit tool events">
    For `tools/call` requests: records the request, matches it with the response, and emits a `tool_call` event with `source: "mcp_proxy"`.
  </Step>

  <Step title="Emit lifecycle events">
    For other MCP lifecycle methods (e.g., `initialize`, `tools/list`): emits an `mcp_lifecycle` event.
  </Step>
</Steps>

## Python module

The proxy also works as a Python module:

```bash theme={null}
python -m mcp_tap --api-key tap_abc123 -- python my_server.py
```
