mcplexer

mcplexer

Directory-scoped MCP routing and tool control

Route, scope, and secure every AI tool call based on your working directory. Like direnv for MCP. Local-first. Auditable. Open source.

~/mcplexer
$ mcplexer setup
daemon started on :3333
claude desktop config updated
dashboard http://localhost:3333
restart Claude Desktop to connect.
tool call routed through mcplexer
[12:34:15] tool call: github__create_issue
cwd: ~/projects/app workspace: frontend
route: allow (rule: "github-write", priority: 10)
approval: approved (2.1s)
status: success (284ms)
[12:34:15] audit: logged #1847
Open Source
Local First
Zero Cloud
Pure Go

Built for security-conscious teams

Full control over what AI tools can do on your machine. Directory-scoped policies, human-in-the-loop approvals, complete audit trail.

Open Source

MIT licensed. Pure Go, single binary, zero CGO. Build from source or go install. Runs anywhere Go compiles to.

direnv for MCP

Workspaces bind to directory trees. In stdio mode, your actual CWD determines which policies apply — tamper-proof, inherited from the parent process.

Tool Approvals

Per-route approval requirements. Pending requests stream via SSE to the dashboard. Configurable timeouts, resolution tracking, self-approval prevention.

Self-Configurable via MCP

Run mcplexer control-server to expose 19 MCP tools. Create workspaces, routes, and servers from Claude or any MCP client. Read-only mode available.

OAuth 2.0 + PKCE

Built-in OAuth flows with PKCE. Provider templates for GitHub, Linear, Google, and more. Automatic token refresh. Credentials injected into downstream env vars.

Full Audit Trail

Every tool call logged with workspace, matched route, auth scope, latency. Parameter redaction via per-scope hints. SSE streaming and query API.

Your CWD is your security context

In stdio mode, mcplexer reads your actual working directory from the OS no client can fake it. The most specific matching workspace wins. Route rules evaluate deny-first through the workspace ancestor chain.

~/projects/frontend
$ cd ~/projects/frontend
workspace: frontend (most specific match)
allowgithub__*, slack__send_message
denyaws__*, docker__*, *__delete_*
approve*__create_*
auth: github-personal (oauth2, auto-injected)
~/projects/infra
$ cd ~/projects/infra
workspace: infra (different directory, different rules)
allowaws__*, docker__*
denygithub__create_*, slack__*
approveaws__delete_*, docker__rm_*
auth: aws-prod (env, encrypted with age)

Route rules match by path glob specificity, then tool pattern specificity, then priority. Deny stops the chain. No match falls back to the workspace default policy.

Four ways to configure

Desktop app for quick setup. YAML for version control. Web UI for visual management. MCP tools for AI-native configuration.

desktop app
$ mcplexer setup
daemon started
config updated

Native app with tray icon, one-click setup. Auto-starts daemon and configures Claude Desktop.

yaml config
workspaces:
- name: frontend
root_path: ~/projects/app
default_policy: deny

Checked into git. Seeded on startup. YAML-sourced items auto-pruned when removed from file.

web ui + rest api
$ curl -X POST \
localhost:8080/api/v1/routes \
-d '{"name":"allow-github",...}'

Full CRUD on all entities. Real-time dashboard with SSE. API-created items persist across YAML reloads.

mcp control server
$ mcplexer control-server
# 19 MCP tools exposed
# list_servers, create_route...

Configure mcplexer from Claude or any MCP client. Read-only mode available for safe introspection.

Up and running in three steps

01

Install

Download the app or go install. Single binary, no dependencies.

02

Setup

Run mcplexer setup — it starts the daemon, configures Claude Desktop, and opens the dashboard. One command.

03

Control

Manage everything from the dashboard, REST API, MCP control server, or YAML config.

And everything else

Local First

No cloud, no telemetry. SQLite database, age-encrypted secrets, everything on your machine.

Stdio + Unix Socket

Stdio for single client, Unix socket for multi-client. CWD injection bridge for Claude Desktop.

Live Dashboard

Real-time metrics, session tracking, approval queue, audit stream. Full web UI for management.

Process Lifecycle

Downstream process management with restart policies, idle timeouts, instance pooling per auth scope.

age Encryption

Secrets encrypted at rest with filippo.io/age. Auto-generated keys. Managed via CLI or control server.

Dry Run

Test routing decisions without execution. CLI or API. See exactly which rule matches and why.

Ready to take control?

Install mcplexer in seconds. Open source, local-first.

go install github.com/revitteth/mcplexer@latest