mcp-relay
by nikkiarae
README.md
# mcp-relay
**Give your AI assistant one local connection to GitHub, Notion, HeroUI, and your other tools.**
You could ask, “Find the open GitHub issues for this feature and compare them
with our Notion plan.” Your AI app starts mcp-relay on your computer. The relay
finds the relevant tools and runs the assistant's script in a Docker sandbox.
[Quick start](#quick-start) · [Edit your connections](#edit-your-connections) ·
[View logs](#view-logs) · [Client setup](docs/clients.md)
## Quick start
1. **Build the relay.** From this checkout, with Node.js **22.20+** and pnpm
**11.10.0**, run:
```sh
pnpm install --frozen-lockfile && pnpm build
```
2. **Choose your connections.** Copy [`.mcp.config.example`](.mcp.config.example)
to `.mcp.config` in the same folder. It comes with a public documentation
server enabled so you can try it right away.
3. **Connect your AI app.** Run `setup` from the relay folder. It prints a
ready-to-use entry with the full paths to Node and the relay filled in.
- **Codex:** run `node dist/cli.js setup --client codex`, then run the
`codex mcp add` command it prints.
- **Claude Code:** run `node dist/cli.js setup --client claude`, then run
the `claude mcp add` command it prints.
- **LM Studio, Claude Desktop, or another app:** run `node dist/cli.js setup`
and paste the printed entry into the app's MCP settings.
[Where each app keeps them](docs/clients.md)
Restart the app and try:
> Use mcp-relay to find a tool that searches developer documentation.
### Enable tool execution
Tool discovery works as soon as your app connects. To run tools, start Docker
and build the sandbox image from the relay folder.
```sh
docker build -t mcp-relay-sandbox ./sandbox
```
The relay starts and removes containers for each run. Try asking, “Use
mcp-relay to look up how to connect a local MCP server and summarize the steps.”
## Edit your connections
Add or paste entries into `mcpServers` in `.mcp.config`. Set `enabled` to
`false` to keep an entry turned off. Restart the AI app after editing the file.
```json
{
"mcpServers": {
"notion": {
"url": "https://mcp.notion.com/mcp",
"auth": "oauth"
}
}
}
```
When a server with `"auth": "oauth"` needs sign-in, the relay opens your browser.
Once you approve, the server's tools become available in the current session.
If the browser can't launch, look for the sign-in link in your AI app's MCP
server logs. The relay saves the sign-in locally and reuses it across projects.
This works with servers that support dynamic OAuth client registration.
The [starter config](.mcp.config.example) includes three optional connections.
| Connection | What to do |
| --- | --- |
| GitHub | Enable the entry and set `GITHUB_PERSONAL_ACCESS_TOKEN` in the environment your AI app passes to the relay. [GitHub setup](https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-claude.md) |
| Notion | Enable the entry, restart your AI app, and approve the browser sign-in. [Notion setup](https://developers.notion.com/guides/mcp/get-started-with-mcp) |
| HeroUI | Enable the entry and restart the app. The relay launches the HeroUI React documentation server with `npx`. [HeroUI setup](https://heroui.com/en/docs/react/getting-started/mcp-server) |
Remote entries use `url` and can include `headers`. Local entries use
`command` and can include `args`, `cwd`, and `env`. Use `${ENV_VAR}` references
for credentials in config files. Browser sign-ins are stored with owner-only
permissions in `~/.config/mcp-relay/auth/`, or under `$XDG_CONFIG_HOME` if set.
### Project settings
A `.mcp.config` in your app's project or its nearest parent takes precedence over
the copy in the relay checkout. Existing `.mcp-relay.json` project files and
`~/.config/mcp-relay/config.json` user settings are supported. Entries in
`.mcp.config` can override user entries with the same name.
- `enable` selects connections from the user config. `disable` turns off named
connections in either file.
- `toolFilters` applies per-server `allowTools` and `denyTools` patterns to both
discovery and execution.
- `sandbox.timeoutMs` changes the 30-second run limit. `sandbox.poolSize`
controls how many containers are kept ready. It defaults to one and accepts
`0` through `4`.
## View logs
Open `~/.config/mcp-relay/logs/` in Finder or your file manager. If you set
`XDG_CONFIG_HOME`, open `$XDG_CONFIG_HOME/mcp-relay/logs/`.
| File | What you’ll see |
| --- | --- |
| `sandbox-YYYY-MM-DD.jsonl` | One record per run with captured `console.log` output, runtime, and the outcome or error. A timed-out run can have empty output. |
| `YYYY-MM-DD.jsonl` | One record per upstream tool call with the server, tool, duration, and outcome. The app's MCP server log also gets these records. |
Files use UTC dates. The relay removes known credentials from sandbox output.
Console output can contain private data your assistant prints.
Sandbox containers keep no Docker logs, so the relay's run output appears only
in these files. For `mcp-relay-…` containers, `docker logs` and the logs view in
Docker Desktop or OrbStack show “configured logging driver does not support
reading.” That's expected.
## Development
```sh
pnpm lint
pnpm typecheck
pnpm test
```
Run `MCP_RELAY_DOCKER_TEST=1 pnpm test` to include the Docker integration tests.
[MIT license](LICENSE)
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues