# exec_mcp

HTTP → MCP bridge. A small FastAPI server that lets non-MCP callers (a shell script,
`curl`, browser JS) invoke tools on any local MCP server over plain HTTP — without
speaking the MCP protocol themselves.

## Run

```bash
./run.sh
```

`run.sh` creates a local `.venv`, installs `requirements.txt`, and starts
`mcp_tool_executor.py` on `http://localhost:8122` (`/docs` for the OpenAPI UI).

## API

`POST /execTool`

```json
{ "tool": "mcp__8124_dom__get_current_date", "params": {} }
```

Response: `{ "success": true, "result": "..." }`.

The tool name encodes the **target** MCP server's port:

```
mcp__<port>_<anything>__<real_tool_name>
```

The executor parses out `<port>`, connects to `http://localhost:<port>/mcp`, and calls
`<real_tool_name>` there. One executor can therefore reach many MCP servers. Sessions are
pooled and reused, with a single automatic retry on a broken connection.
