Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
1f8d206
chore: upgrade rmcp to v1.5
its-mash Apr 20, 2026
d16d50d
feat(core,storage): schema for FeatureSet resolver v2 (forward-compat)
its-mash Apr 20, 2026
76c6638
feat(gateway): FeatureSetResolver v2 + SessionRootsRegistry (shadow m…
its-mash Apr 20, 2026
ecf6bb8
feat: FeatureSet resolver v2 — authoritative + UI + migration 003
its-mash Apr 20, 2026
5416d86
test: remove obsolete client_grants database tests
its-mash Apr 20, 2026
8c740a5
feat(gateway,desktop): mcpmux_* self-management meta tools with nativ…
its-mash Apr 21, 2026
382c374
feat(meta-tools): audit log + master switch + grants UI + E2E spec
its-mash Apr 21, 2026
b4ba091
feat(ui): premium Active FeatureSet + empty-state Clients page onboar…
its-mash Apr 21, 2026
ce1d384
fix(ui): split one-click vs copy-paste install in Clients onboarding
its-mash Apr 21, 2026
7dcd554
fix(ui): Clients onboarding — single generic 3-step card, always shown
its-mash Apr 21, 2026
c08d9fe
fix(ConnectIDEs): per-IDE correct instructions + popover opens upward
its-mash Apr 21, 2026
c8c3f1c
feat(ui): Contribute / Request affordances across the app
its-mash Apr 21, 2026
5846a98
feat(routing): workspace-root-driven FeatureSet resolution
its-mash Apr 25, 2026
c2f02f6
fix(gateway): route to resolved space + accept URL client_ids in meta…
its-mash Apr 25, 2026
ac33136
fix(gateway): wire approval publisher on auto-start + focus window on…
its-mash Apr 25, 2026
02bd7b9
fix(gateway,ui): collapse describe tools, fire list_changed on Connec…
its-mash Apr 27, 2026
42bfbf9
fix(gateway): drop mcpmux_describe_workspace meta tool
its-mash Apr 27, 2026
a313ffd
fix(meta-tools): scope to caller's resolved Space + drop stale pin/ac…
its-mash Apr 27, 2026
98bceb8
feat(routing): per-client grants, multi-FS bindings, capability-branc…
its-mash Apr 28, 2026
af600c8
fix(routing): close root-fetch race + Starter editability + binding a…
its-mash Apr 29, 2026
f08e8ec
fix(oauth): drop duplicate RFC 8707 resource param
its-mash Apr 29, 2026
c9a18b7
fix(notifier): lazy-GC dead sessions on every fanout / per-peer push
its-mash Apr 29, 2026
a83e288
fix(notifier): tag every list_changed push with session_id + client_id
its-mash Apr 29, 2026
deab680
fix(handler): single-flight on-demand probe per session
its-mash Apr 29, 2026
985e6a4
fix(oauth,services): port #152 — DCR redirect URI tolerance + clippy
crimsonsunset May 19, 2026
7bf4cb1
docs(planning): add plan for dynamic MCP toggle meta tools
crimsonsunset May 19, 2026
5e04746
docs: add macOS build-from-source and app swap guide
crimsonsunset May 19, 2026
e72b64e
feat(gateway): add SessionOverrideRegistry and list-path composition
crimsonsunset May 19, 2026
f29543a
feat(meta-tools): add mcpmux_list_servers read tool (Phase 2)
crimsonsunset May 19, 2026
0905d38
feat(meta-tools): add session-scope enable/disable server tools (Phas…
crimsonsunset May 19, 2026
b29d5e8
feat(meta-tools): add workspace-scope enable/disable server tools (Ph…
crimsonsunset May 19, 2026
b590b0b
feat(meta-tools): session override UI and settings toggle (Phase 5)
crimsonsunset May 19, 2026
5730b25
docs(meta-tools): close Phase 5 with README and planning reconciliation
crimsonsunset May 19, 2026
726492e
feat(ui): add rename/edit for spaces, feature sets, and workspace bin…
crimsonsunset May 19, 2026
11814c4
feat(ui): link dashboard stat cards to detail pages
crimsonsunset May 19, 2026
da91fd9
docs: rename build-from-source-macos.md to run-from-source-macos.md
crimsonsunset May 19, 2026
2edcd29
docs(run-from-source): document pnpm dev watch flow
crimsonsunset May 19, 2026
5269a18
fix(gateway): apply session overrides in call_tool authorization
crimsonsunset May 22, 2026
d519a79
fix(gateway): forward structuredContent in proxied tool results
crimsonsunset May 23, 2026
7d762a8
docs(planning): add server account clones implementation plan
crimsonsunset May 23, 2026
55d0758
feat(server-clone): Phase 1 — Core clone API + storage
crimsonsunset May 23, 2026
94decc8
feat(server-clone): Phase 2 — Clone wizard UI
crimsonsunset May 23, 2026
a45d34c
feat(server-clone): Phase 3 — Meta-tool + docs surfacing
crimsonsunset May 23, 2026
c090948
feat(server-clone): Phase 4 — Validation + edge cases
crimsonsunset May 23, 2026
b7016de
chore(fmt): apply cargo fmt after validate sweep
crimsonsunset May 23, 2026
308963b
fix(desktop): restore custom titlebar window dragging
crimsonsunset May 23, 2026
36a4922
feat(desktop): add copy-all to server log viewer
crimsonsunset May 23, 2026
8ff352b
feat(desktop): expand/collapse all servers and disable on error
crimsonsunset May 23, 2026
b641acd
feat(desktop): My Servers search, filters popover, and shared UI prim…
crimsonsunset May 25, 2026
6215633
feat(desktop): add server count summary and smarter hover tooltips
crimsonsunset May 25, 2026
6b70c0f
feat(servers): add per-install display name override
crimsonsunset May 25, 2026
cc50654
feat(servers): smarter OAuth startup and sticky My Servers toolbar
crimsonsunset May 25, 2026
d3940bb
docs(planning): tool-level session pin meta tool
crimsonsunset May 25, 2026
9e4c3cd
docs(planning): web admin mode for remote UI access
crimsonsunset May 25, 2026
2052bcc
feat(servers): replace enable/disable buttons with labeled toggle
crimsonsunset May 25, 2026
f767e79
docs(planning): add meta-gateway invoke model for agent tool discovery
crimsonsunset May 25, 2026
4978d70
feat(gateway): Phase A — Meta invoke core
crimsonsunset May 25, 2026
4d11112
feat(gateway): Phase B — Result shaping on invoke
crimsonsunset May 25, 2026
270921d
feat(gateway): Phase C — FeatureSet invoke ACL + surfaced tools
crimsonsunset May 25, 2026
ed8a5fb
fix(gateway): upsert workspace binding in bind_current_workspace
crimsonsunset May 25, 2026
993f378
docs(planning): add meta-gateway invoke manual QA runbook
crimsonsunset May 25, 2026
c505b07
docs(planning): reconcile meta-gateway invoke QA progress
crimsonsunset May 25, 2026
433e7bd
fix(gateway): make invoke result truncation opt-in via filter
crimsonsunset May 25, 2026
01b60e3
docs(planning): record Phase 5 QA pass and PR #155
crimsonsunset May 25, 2026
3bc4dc9
test(gateway): cover invoke filter shaping with unit and e2e tests
crimsonsunset May 25, 2026
22d92c3
fix(gateway): allow direct call_tool for surfaced backend tools
crimsonsunset May 25, 2026
5508c5e
docs(planning): complete meta-gateway invoke manual QA sign-off
crimsonsunset May 25, 2026
6884742
docs(planning): sync meta-gateway invoke status with QA sign-off
crimsonsunset May 25, 2026
85113e7
fix(gateway): improve meta-tool DX for ACL, schema batch, and max_bytes
crimsonsunset May 25, 2026
b7626fb
docs(planning): sign off meta-gateway invoke targeted retest
crimsonsunset May 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
blank_issues_enabled: false
blank_issues_enabled: true
contact_links:
- name: Questions & Help
url: https://github.com/mcpmux/mcp-mux/discussions/categories/q-a
about: Ask questions and get help in GitHub Discussions
- name: Feature Ideas
url: https://github.com/mcpmux/mcp-mux/discussions/categories/ideas
about: Share and discuss feature ideas
- name: Contribute a Server Definition (PR)
url: https://github.com/mcpmux/mcp-servers/blob/main/CONTRIBUTING.md
about: Server definitions live in the mcp-servers repo and land via PR — read the guide
- name: Request a Server
url: https://github.com/mcpmux/mcp-servers/issues/new?template=request-server.yml
about: Ask the community to add an MCP server to the registry
- name: Report a Server Definition Bug
url: https://github.com/mcpmux/mcp-servers/issues/new?template=bug-report.yml
about: Found a broken or incorrect server in the registry? Report it here
131 changes: 131 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# AGENTS.md

Guidance for coding agents working inside the `mcp-mux` repo — the McpMux desktop app and local gateway. Complements [`README.md`](README.md) and [`CONTRIBUTING.md`](CONTRIBUTING.md); when anything here conflicts with an explicit user instruction in the current session, the user wins.

## Project Overview

McpMux is a Tauri 2 desktop app (Rust + React 19) with a local Axum HTTP gateway on `localhost:45818`. It lets users configure MCP servers once and connect every AI client (Cursor, Claude Desktop, VS Code, Windsurf) through a single endpoint, with credentials encrypted in the OS keychain instead of plain-text JSON files.

A more detailed map of the workspace lives in [`CLAUDE.md`](CLAUDE.md) at the repo root — read it for the crate layout, frontend architecture, and cross-project context. This file captures the minimum an agent needs to make safe, useful changes here.

## Workspace Layout

```
mcp-mux/
├── apps/desktop/ # Tauri shell — React frontend (src/) + Rust Tauri commands (src-tauri/)
├── crates/
│ ├── mcpmux-core/ # Domain entities, repository traits, service layer, EventBus
│ ├── mcpmux-gateway/ # Axum gateway — routing, OAuth refresh, FeatureSet filtering
│ ├── mcpmux-storage/ # SQLite + AES-256-GCM field encryption + OS keychain
│ └── mcpmux-mcp/ # MCP protocol client wrapper (rmcp SDK)
├── packages/ui/ # Shared UI components (`@mcpmux/ui`)
├── schemas/ # JSON Schemas surfaced in the Monaco editor
└── tests/ # Rust integration, TS unit (vitest), desktop E2E (WDIO), web E2E (playwright)
```

## Build & Dev Commands

Run everything from `mcp-mux/`:

| Command | What it does |
|---------|--------------|
| `pnpm setup` | First-time dev environment setup (PowerShell on Windows). |
| `pnpm dev` | Tauri desktop dev mode (Rust + React hot-reload). |
| `pnpm dev:web` | Web UI only via Vite — no Rust, no Tauri shell. |
| `pnpm build` | Production Tauri build for the current platform. |
| `pnpm validate` | Full correctness gate — runs the items below in sequence. |
| `pnpm lint` | ESLint (recursive) + `cargo clippy --workspace -- -D warnings`. |
| `pnpm lint:fix` | Auto-fix lint issues. |
| `pnpm format` | `prettier --write .` + `cargo fmt --all`. |
| `pnpm format:check` | Formatting check (no writes). |
| `pnpm typecheck` | Recursive TypeScript typecheck. |

**Before claiming a change is done**, run `pnpm validate` (or the relevant subset) — it mirrors what CI enforces.

## Testing

| Command | Scope |
|---------|-------|
| `pnpm test` | Rust + TypeScript, everything. |
| `pnpm test:rust` | `cargo nextest run --workspace`. |
| `pnpm test:rust:unit` | `cargo nextest run --workspace --lib`. |
| `pnpm test:rust:int` | `cargo nextest run -p tests` — integration crate in `tests/rust`. |
| `pnpm test:rust:doc` | `cargo test --workspace --doc`. |
| `pnpm test:ts` | Vitest run (`tests/ts/vitest.config.ts`). |
| `pnpm test:ts:watch` | Vitest watch. |
| `pnpm test:e2e` | Desktop E2E via WebDriver IO — requires `MCPMUX_REGISTRY_URL`. |
| `pnpm test:e2e:file -- tests/e2e/specs/foo.ts` | One WDIO spec file. |
| `pnpm test:e2e:grep -- "test name"` | WDIO tests matching a name. |
| `pnpm test:e2e:web` | Playwright on the web UI. |
| `pnpm test:coverage` | `cargo llvm-cov` + Vitest coverage. |

Prefer narrow commands over `pnpm test` while iterating — the full suite is slow.

## Code Style

- **Rust:** 100-char max width, 4-space indent. Clippy runs with `avoid-breaking-exported-api = false`; all warnings are denied in CI.
- **TypeScript / JSX:** Prettier — single quotes, 2-space indent, 100-char width, trailing commas (es5), Tailwind CSS plugin for class ordering.
- **Path aliases:** `@/` → `apps/desktop/src/`; `@mcpmux/ui` → `packages/ui`.
- **No emojis in code or commits** unless the user explicitly asks for them.
- **Comments:** only when the *why* is non-obvious. Identifiers should explain the *what*.

## Commit & PR Guidelines

- Commits must be **signed off** (DCO): `git commit -s -m "..."`. CI rejects unsigned commits.
- Prefer conventional-style subjects — releases use release-please for semantic versioning.
- PRs follow [`.github/pull_request_template.md`](.github/pull_request_template.md): describe the change, how you tested, and check the `pnpm test` / `pnpm lint` / `pnpm typecheck` boxes.
- Don't bypass hooks (`--no-verify`) or DCO signing unless explicitly told to.

## Platform Gotchas

### Child-process flags

Anything that spawns a child process (stdio MCP servers, installers, etc.) **must** go through `mcpmux_gateway::pool::transport::configure_child_process_platform()`. That helper applies:

- **Windows:** `CREATE_NO_WINDOW` (`0x08000000`) — release builds use `windows_subsystem = "windows"`, so without this the OS briefly flashes a console window when a child starts.
- **Unix:** `process_group(0)` — stops SIGINT/SIGTSTP from the parent terminal from tearing down the child.

`tokio::process::Command` already exposes `creation_flags()` (Windows) and `process_group()` (Unix). **Do not** import `std::os::*::process::CommandExt` — those traits are unused with Tokio's `Command` and trigger clippy.

### Cross-platform CI

- The pre-commit hook runs `cargo clippy --workspace -- -D warnings` on your dev machine.
- `#[cfg(unix)]` only compiles on Unix; `#[cfg(windows)]` only on Windows. CI is Linux, so Windows-gated code is **not** linted in CI, and Unix-gated code is not linted on a Windows dev box.
- When you touch platform-conditional code, check the *other* platform compiles before pushing — CI won't catch a Windows-only clippy regression.

### Secret handling

- Never log tokens, API keys, headers with auth material, or raw OAuth responses. Use the existing sanitised-log helpers in `mcpmux-gateway`.
- Credentials encrypt at rest via AES-256-GCM in SQLite plus DPAPI (Windows) / OS keychain (macOS, Linux). Don't add new code paths that persist secrets any other way.
- Secrets should be wiped from memory after use via `zeroize`.
- The gateway binds to `127.0.0.1`. Don't bind to `0.0.0.0` or expose it on the network.

## Frontend Notes

- Entry point: `apps/desktop/src/main.tsx` → `App.tsx`.
- Global state: a single Zustand store at `src/stores/appStore.ts`.
- Key hooks: `useServerManager` (server CRUD), `useSpaces` (workspace switching), `useDomainEvents` (Rust-side EventBus listener), `useDataSync`.
- UI: React 19, Tailwind CSS, Lucide icons, Monaco Editor for JSON config surfaces.
- Open external URLs through `openExternal` in `apps/desktop/src/lib/contribute.ts` — it routes through the Tauri opener plugin so links open in the user's default browser, not the webview.
- For UI changes, launch `pnpm dev` and exercise the feature in the running app before reporting done — typecheck and tests verify correctness, not UX regressions.

## Rust Architecture Cues

- Cross-layer communication goes through the `EventBus` in `mcpmux-core`. Prefer emitting a domain event over reaching across module boundaries directly.
- Storage is behind repository traits — don't call SQLx or SQLite APIs directly from gateway or app code; add or use a repo method.
- Services are wired up via the `ApplicationServices` builders in `mcpmux-core`. New services should follow the same DI pattern.

## MCP Specification

The full MCP spec is vendored at `../modelcontextprotocol/docs/specification/`. Default to the latest stable version (`2025-11-25`) and **read the relevant section before** implementing or modifying protocol behaviour (transports, lifecycle, capability negotiation, OAuth flows, tools / resources / prompts). For features targeting a specific protocol version, use that version's folder.

## Server Definitions

Server catalog entries live in the separate [`mcp-servers`](https://github.com/mcpmux/mcp-servers) repo — **not here**. If a task involves adding, editing, or fixing a server definition, switch to that repo and follow its `AGENTS.md`.

## Things Not To Do

- Don't add backwards-compatibility shims, deprecated aliases, or `// removed` placeholder comments when removing code — delete it cleanly.
- Don't introduce new fallbacks or input validation for states that are already framework-guaranteed. Trust internal invariants; validate only at the boundary (user input, external APIs).
- Don't edit generated files: `CHANGELOG.md`, release-please manifests, `bundle/*.json` in sibling repos, `packages/ui/dist`.
- Don't commit screenshots, videos, or large binaries to the repo — link out instead.
9 changes: 5 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ os_pipe = "1"

# MCP Protocol
# NOTE: Never use local path dependency - E:\one-mcp\rust-sdk is for source lookup only
rmcp = { version = "0.17.0", features = [
rmcp = { version = "1.5", features = [
"client",
"server",
"transport-io",
Expand Down
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Lightweight and cross-platform — built in Rust with Tauri 2, McpMux uses minim
}
```

**3.** Done. Every tool from every server is available in every client, right now.
**3.** Done. Connected clients see a small fixed meta-tool surface (~12 `mcpmux_*` tools). Backend tools are discovered via **`mcpmux_search_tools`** → **`mcpmux_get_tool_schema`** → **`mcpmux_invoke_tool`**, keeping context windows lean. Optionally surface individual hot-path tools into `tools/list` per FeatureSet.

McpMux routes calls to the right server, refreshes OAuth tokens automatically, and keeps credentials encrypted in your OS keychain — you never think about it again.

Expand Down Expand Up @@ -109,10 +109,37 @@ Create isolated Spaces — each with their own servers, credentials, and permiss

### Control What Each Client Can Do

Not every AI client should have the same power. Create Feature Sets — permission bundles that control exactly which tools, prompts, and resources a client can access. Build a "Read Only" set for cautious workflows, a "React Development" set with just GitHub and Filesystem, or a "Full Stack Dev" set with everything. Assign them per-client so each tool only goes where you want it.
Not every AI client should have the same power. Create Feature Sets — permission bundles that control exactly which tools a client can **invoke** (search + invoke ACL). In the editor, the **checkbox** includes a tool in that ACL; the **Surface** button (optional, per row) promotes an included tool into the client's `tools/list` for one-hop hot paths. Build a "Read Only" set for cautious workflows, a "React Development" set with just GitHub and Filesystem, or a "Full Stack Dev" set with everything. Assign them per-client so each tool only goes where you want it.

![Feature Sets — granular per-server tool selection](docs/screenshots/featureset-detail.png)

### Self-Management Meta Tools (mcpmux_*)

Connected AI clients see a fixed ~12-tool meta surface instead of every backend tool definition. FeatureSets define what is **invokable**; optional **surfaced** tools (0–N per set) can be promoted into `tools/list` for one-hop hot paths. Workspace bindings pin stable per-folder toolsets; session enable/disable gates server activity without bloating context.

McpMux exposes a built-in `mcpmux_*` tool namespace for search → schema → invoke workflows:

1. Call **`mcpmux_list_servers`** — server-level manifest with per-server status: `enabled_via_binding`, `enabled_via_session`, `disabled_via_session`, or `inactive`.
2. Call **`mcpmux_enable_server`** or **`mcpmux_disable_server`** — toggle servers on or off for the session or workspace.
3. Call **`mcpmux_search_tools`** — find invokable tools by query (respects FeatureSet ACL).
4. Call **`mcpmux_get_tool_schema`** — load parameter schemas before invoking.
5. Call **`mcpmux_invoke_tool`** — invoke any permitted backend tool through one entry point.

| Tool | Type | Purpose |
| ---- | ---- | ------- |
| `mcpmux_list_all_tools` | read | Full tool roster in the resolved Space (diagnostic) |
| `mcpmux_list_feature_sets` | read | FeatureSets available in the resolved Space |
| `mcpmux_list_servers` | read | Server-level manifest with status |
| `mcpmux_search_tools` | read | Search invokable tools with optional schema detail |
| `mcpmux_get_tool_schema` | read | Load input schemas before invoke |
| `mcpmux_invoke_tool` | read | Invoke a backend tool by server_id + tool name |
| `mcpmux_enable_server` | write | Enable a server (session or workspace scope) |
| `mcpmux_disable_server` | write | Disable a server (session or workspace scope) |
| `mcpmux_create_feature_set` | write | Create a custom FeatureSet (optional `surfaced_tools[]`) |
| `mcpmux_bind_current_workspace` | write | Bind the session's workspace root to FeatureSets |

In the desktop app: **Settings → Self-management tools** toggles the whole namespace and optional approval for session-scope overrides. **Workspaces → live folder inspector → Active session overrides** shows per-session enabled/disabled servers and lets you clear overrides with one click.

### See and Manage Every Connected Client

Cursor, VS Code, Windsurf, Claude Code — see every AI client connected to your gateway in real time. Click any client to manage its workspace, grant or revoke feature sets, and see exactly which tools it can access. New clients authenticate via OAuth with a one-click approval flow.
Expand Down
Loading
Loading