From d7063d44e425972ba6780c61046b4f7368909234 Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Thu, 19 Nov 2026 13:47:05 +0200 Subject: [PATCH 1/5] docs(quick-start): match the v0.75 clean-install flow Walked the Quick Start end to end on main (fresh data dir): CLI and Web UI add, scan, review, approve, a real Claude Code call and the mcp-remote bridge. Corrections: - upstream list / review / approve transcripts now match the CLI (Needs review, review show, review approve --yes, streamable-http, Online); security approve stays as the alias. - Web UI add: + -> Server opens the Add Server page (Catalog / Paste / Import / Manual), trust mode defaults to Scan, the button is Add to MCPProxy; approval is Review & approve -> Approve server (N of N). - Add a 'Via the CLI' route and a 'mcpproxy connect' tip. - Say that a client connected with mcpproxy connect (a client credential) cannot add servers through upstream_servers. Co-Authored-By: Claude Opus 5.5 --- docs/getting-started/quick-start.mdx | 107 ++++++++++++++++++++------- 1 file changed, 79 insertions(+), 28 deletions(-) diff --git a/docs/getting-started/quick-start.mdx b/docs/getting-started/quick-start.mdx index 41af3021e..3c0f71565 100644 --- a/docs/getting-started/quick-start.mdx +++ b/docs/getting-started/quick-start.mdx @@ -170,6 +170,15 @@ claude mcp list +:::tip Let MCPProxy write the entry +`mcpproxy connect claude-code` (also `cursor`, `codex`, `claude-desktop`, +`vscode`, `copilot`, `gemini`, `opencode`, `windsurf`; `mcpproxy connect --list` +shows them all) adds the entry for you, backs up the client's config first, and +prints the next step. It writes a per-client credential +(`mcp_cli_โ€ฆ`) instead of your admin API key; see +[Connect Clients](/features/connect-clients). +::: + :::tip Multiple Clients You can connect multiple AI clients to the same MCPProxy instance simultaneously. All clients share the same upstream servers and configuration. ::: @@ -193,21 +202,44 @@ Your AI agent will use the `upstream_servers` tool to add the server to your MCP - **Enable/disable servers:** *"Disable the filesystem server"* - **List available tools:** *"What tools are available from context7?"* +:::note Clients connected with `mcpproxy connect` cannot add servers +This works for a client that reaches MCPProxy without a key, like the +`claude mcp add` command above, or with the instance API key. A client +registered by `mcpproxy connect` or the Web UI's Connect wizard uses a +per-client credential, and credentials cannot add, change or remove +servers: `upstream_servers` is not listed for them, and the agent gets +`tool 'upstream_servers' not found`. Add the server from the CLI or the +Web UI instead (below). +::: + :::tip Chat-Based Management You can manage your entire MCPProxy setup through natural conversation with your AI agent - no need to switch between different interfaces! ::: +### Via the CLI + +```bash +mcpproxy upstream add context7 https://mcp.context7.com/mcp +``` + +The command prints the review steps that follow (`review show`, +`security report`, `review approve`). A local command works the same way after +`--`, for example `mcpproxy upstream add time -- uvx mcp-server-time`. + ### Via Web UI -1. Open the Web UI (see [step 2](#2-open-the-web-ui)) and click **Add Server** in - the top bar. The dialog is titled **Add New Server**. -2. Under **Server Type**, pick **HTTP/HTTPS (Remote)**. The **URL** field only - appears once you do - the default, **stdio (Local Command)**, asks for a - command instead. -3. **Server Name**: `context7` - **URL**: `https://mcp.context7.com/mcp` -4. Leave **Trust Mode** on **Manual**: *"At add time the server is quarantined - until you approve it โ€” the secure default."* -5. Click **Add Server**. +1. Open the Web UI (see [step 2](#2-open-the-web-ui)), click **+** in the top + bar and choose **Server**. The **Add Server** page opens on its **Catalog** + tab; **Paste** takes a URL or command, **Import** an existing client config. +2. Open the **Manual** tab and, under **Server Type**, pick **HTTP/HTTPS + (Remote)**. The **URL** field only appears once you do - the default, + **stdio (Local Command)**, asks for a command instead. +3. **Name**: `context7` - **URL**: `https://mcp.context7.com/mcp` +4. Leave **Trust mode** unset. **Scan** is marked *current default*: the server + is quarantined and scanned on add, and an unset trust mode keeps it + quarantined until you approve it. **Manual** additionally holds every later + tool change for your review. +5. Click **Add to MCPProxy**. You land on the server's page. ### Via Configuration File @@ -242,7 +274,7 @@ A server you add by editing this file for the first time is **held for review** However you added it, the server is now **quarantined** - its tools are withheld from your AI agent until you approve them. This is the point of MCPProxy's security model, and nothing works until you pass this gate. The transcripts below -follow the Web UI path, so they show only `context7`; if you took the +follow the Web UI or CLI path, so they show only `context7`; if you took the configuration-file route, `filesystem` is listed alongside it and needs the same approval. @@ -251,21 +283,38 @@ mcpproxy upstream list ``` ``` - NAME PROTOCOL TOOLS STATUS ACTION -๐Ÿ”’ context7 http 0 Quarantined for review Approve in Web UI + NAME PROTOCOL TOOLS STATUS ACTION +๐Ÿ”’ context7 streamable-http 0 Needs review review show context7 ``` -Note the `0` tools: they exist, but are not exposed yet. +Note the `0` tools: they exist, but are not exposed yet. The `ACTION` column +names the next command. ### Review before approving Open the server's page in the Web UI. It shows the badge **Quarantined for -review**, an **Awaiting manual review** banner, and the buttons **View report** -and **Approve**. The **Security** tab holds the offline scan that ran on add - -for `context7` it reports `Risk Score 0/100`, "2 tool definitions exported for -analysis", and **No findings**. +review**, an **Awaiting manual review** banner with the scan summary (`clean`, +`Risk score 0/100`), and the buttons **View report** and **Review & approve**. +**Review & approve** opens the **Review** tab: the scan line, the tools by tier, +and each tool's definition with an **Allow this tool** checkbox. Only read-only +tools with a clean scan start checked. + +From the CLI, `mcpproxy review show context7` lists the captured tools and the +scan verdict: -The same report from the CLI (abbreviated - the real output also carries a +``` +Server: context7 +Readiness: quarantined (approval is separate from connection and discovery) +Scan: clean ยท risk 0/100 ยท covers all 2 tools +TOOL TIER APPROVAL SCAN DESCRIPTION +query-docs read approved clean Retrieves and queries up-to-date documentation and code examples from Context7 for any programming library or framework. +resolve-library-id read approved clean Resolves a package/product name to a Context7-compatible library ID and returns matching libraries. +``` + +The tools already read `approved` because the clean scan pre-approved them; +they stay hidden until the server itself is approved. + +The full report (abbreviated - the real output also carries a `Scan ID`, a `Scanned` timestamp, a per-scanner `Scanner timing` block, and the `Path` the tool definitions were exported to): @@ -280,7 +329,7 @@ Scanners: 1 run, 0 failed of 1 Scan Context Source: tool_definitions_only - Protocol: http + Protocol: streamable-http Docker isolation: false Tools analyzed: 2 @@ -293,28 +342,30 @@ Scan Context ### Approve -Click **Approve** on the server page - it applies immediately, with no -confirmation dialog - or from the CLI: +On the **Review** tab, click **Approve server (2 of 2 tools)** - it applies +immediately, with no confirmation dialog - or from the CLI: ```bash -mcpproxy security approve context7 +mcpproxy review approve context7 --yes ``` ``` -Server "context7" approved. +Allowing 2 of 2 tools; blocking none +Approved server context7: 2 tools approved, 0 blocked, 0 still pending, 0 changed ``` -The header flips to `Connected (2 tools)` and **Admin state** to **Enabled**. -The Tools tab does not refill on its own: use **Actions** โ†’ **Refresh**, or -reload the page, to see it go from `Tools (0)` to `Tools (2)`. +`mcpproxy security approve context7` is an alias. + +The header flips to `Connected (2 tools)`, **Admin state** to **Enabled**, and +the tab to `Tools (2)`. The Review tab confirms *"context7 is approved"*. ```bash mcpproxy upstream list ``` ``` - NAME PROTOCOL TOOLS STATUS ACTION -โœ… context7 http 2 Connected (2 tools) - + NAME PROTOCOL TOOLS STATUS ACTION +โœ… context7 streamable-http 2 Online - ``` :::info Undo any of this From b6eada91894515c1b875cf0f6511235260c19e5b Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Thu, 19 Nov 2026 14:10:47 +0200 Subject: [PATCH 2/5] =?UTF-8?q?docs(quick-start):=20review=20r1=20?= =?UTF-8?q?=E2=80=94=20CLI-path=20protocol,=20management=5Ftools=20nuance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- docs/getting-started/quick-start.mdx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/getting-started/quick-start.mdx b/docs/getting-started/quick-start.mdx index 3c0f71565..290efeed0 100644 --- a/docs/getting-started/quick-start.mdx +++ b/docs/getting-started/quick-start.mdx @@ -207,8 +207,9 @@ This works for a client that reaches MCPProxy without a key, like the `claude mcp add` command above, or with the instance API key. A client registered by `mcpproxy connect` or the Web UI's Connect wizard uses a per-client credential, and credentials cannot add, change or remove -servers: `upstream_servers` is not listed for them, and the agent gets -`tool 'upstream_servers' not found`. Add the server from the CLI or the +servers. By default `upstream_servers` is not listed for them at all, and the +agent gets `tool 'upstream_servers' not found`; under a profile that sets +`management_tools: true` it is listed, but only for `list` and `tail_log`. Add the server from the CLI or the Web UI instead (below). ::: @@ -274,7 +275,9 @@ A server you add by editing this file for the first time is **held for review** However you added it, the server is now **quarantined** - its tools are withheld from your AI agent until you approve them. This is the point of MCPProxy's security model, and nothing works until you pass this gate. The transcripts below -follow the Web UI or CLI path, so they show only `context7`; if you took the +follow the CLI path (`upstream add`), so they show only `context7` with +protocol `streamable-http`; a Web UI add stores the protocol as `http`, and +`upstream list` and the report then show `http`. If you took the configuration-file route, `filesystem` is listed alongside it and needs the same approval. From 8fabe020ce7b394cf7bbc47462916a5111e7bc46 Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Thu, 19 Nov 2026 14:16:32 +0200 Subject: [PATCH 3/5] =?UTF-8?q?docs(quick-start):=20review=20r2=20?= =?UTF-8?q?=E2=80=94=20name=20every=20route=20that=20stores=20http?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- docs/getting-started/quick-start.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/getting-started/quick-start.mdx b/docs/getting-started/quick-start.mdx index 290efeed0..105a3c277 100644 --- a/docs/getting-started/quick-start.mdx +++ b/docs/getting-started/quick-start.mdx @@ -276,8 +276,10 @@ However you added it, the server is now **quarantined** - its tools are withheld from your AI agent until you approve them. This is the point of MCPProxy's security model, and nothing works until you pass this gate. The transcripts below follow the CLI path (`upstream add`), so they show only `context7` with -protocol `streamable-http`; a Web UI add stores the protocol as `http`, and -`upstream list` and the report then show `http`. If you took the +protocol `streamable-http`. The other routes in step 4 (the Web UI, the +configuration file, and an agent asked for HTTP as in the prompt above) store +the protocol as `http`, so `upstream list` and the report show `http` there. +If you took the configuration-file route, `filesystem` is listed alongside it and needs the same approval. From 7e766c2117539ee325e4a5f301674f0285e587d8 Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Thu, 19 Nov 2026 17:44:18 +0200 Subject: [PATCH 4/5] test(server): shut down the socket E2E servers so the leak guard passes TestE2E_TrayToCore_UnixSocket, TestE2E_DualListener_Concurrent and TestE2E_SocketPermissions started a Server and deliberately never shut it down. Each one left its runtime, upstream manager and network-recovery watcher running, so the TestMain guard from #1936 failed the E2E job (`-run TestE2E`) with "3 upstream.Manager network-recovery watcher(s) still running". #1936's sweep ran with `-skip E2E` and never saw them. stopSocketE2EServer shuts the server down, cancels its context and waits for Start to return. It is deferred after the socketE2EMutex unlock, so it runs while the mutex is held, before the next socket test starts. Verified: the guard fails with the three tests on the old file and passes with this change; the CI E2E command passes. --- internal/server/socket_e2e_test.go | 58 +++++++++++++++++++----------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/internal/server/socket_e2e_test.go b/internal/server/socket_e2e_test.go index b7e0928e4..fff0efa6b 100644 --- a/internal/server/socket_e2e_test.go +++ b/internal/server/socket_e2e_test.go @@ -24,6 +24,32 @@ import ( // socketE2EMutex ensures socket E2E tests run sequentially to avoid shutdown race conditions var socketE2EMutex sync.Mutex +// socketE2EServerStopTimeout bounds how long a socket E2E test waits for +// Server.Start to return after its server was shut down. +const socketE2EServerStopTimeout = 45 * time.Second + +// stopSocketE2EServer shuts down a server a socket E2E test started with +// srv.Start(ctx) in a goroutine that sends Start's result on done. Defer it +// right after starting the server, AFTER the socketE2EMutex unlock defer, so +// it runs first: the server (its runtime, upstream manager and that manager's +// network-recovery watcher) is gone before the next socket test takes the +// mutex and before the package leak guard in leak_guard_main_test.go looks. +// +// Shutdown runs before cancel: Start's own context watcher then finds the +// server already shut down and returns without a second shutdown. +func stopSocketE2EServer(t *testing.T, srv *Server, cancel context.CancelFunc, done <-chan error) { + t.Helper() + if err := srv.Shutdown(); err != nil { + t.Logf("socket E2E server shutdown: %v", err) + } + cancel() + select { + case <-done: + case <-time.After(socketE2EServerStopTimeout): + t.Errorf("socket E2E server did not stop within %s", socketE2EServerStopTimeout) + } +} + // TestEndToEnd_TrayToCore_UnixSocket tests the complete flow: // 1. Core server creates Unix socket listener // 2. Simulated tray client connects via socket @@ -74,16 +100,13 @@ func TestE2E_TrayToCore_UnixSocket(t *testing.T) { require.NoError(t, err) require.NotNil(t, srv) - // Start server in background + // Start server in background; stopped before the socket mutex is released. ctx, cancel := context.WithCancel(context.Background()) - // Note: Not using defer cancel() to avoid race condition panic during shutdown - _ = cancel - - serverReady := make(chan error, 1) + serverDone := make(chan error, 1) go func() { - err := srv.Start(ctx) - serverReady <- err + serverDone <- srv.Start(ctx) }() + defer stopSocketE2EServer(t, srv, cancel, serverDone) // Wait for server to be ready require.Eventually(t, func() bool { @@ -214,13 +237,8 @@ func TestE2E_TrayToCore_UnixSocket(t *testing.T) { assert.Contains(t, line, "SSE connection established") }) - // Cleanup - // Note: Server shutdown is handled by avoiding cancel() call above - // The test framework will clean up when the test exits. - _ = serverReady - // Socket file will be cleaned up when tmpDir is removed by test framework or system cleanup - t.Log("Test completed successfully - server shutdown handled by test framework") + t.Log("Test completed successfully") } // TestEndToEnd_DualListener_Concurrent tests concurrent requests over both TCP and socket @@ -262,12 +280,11 @@ func TestE2E_DualListener_Concurrent(t *testing.T) { require.NoError(t, err) ctx, cancel := context.WithCancel(context.Background()) - // Note: Not using defer cancel() to avoid race condition panic during shutdown - _ = cancel - + serverDone := make(chan error, 1) go func() { - _ = srv.Start(ctx) + serverDone <- srv.Start(ctx) }() + defer stopSocketE2EServer(t, srv, cancel, serverDone) require.Eventually(t, func() bool { return srv.IsReady() @@ -390,12 +407,11 @@ func TestE2E_SocketPermissions(t *testing.T) { require.NoError(t, err) ctx, cancel := context.WithCancel(context.Background()) - // Note: Not using defer cancel() to avoid race condition panic during shutdown - _ = cancel - + serverDone := make(chan error, 1) go func() { - _ = srv.Start(ctx) + serverDone <- srv.Start(ctx) }() + defer stopSocketE2EServer(t, srv, cancel, serverDone) require.Eventually(t, func() bool { return srv.IsReady() From 9e1d695bb01f03941e67393d426fd524f4c22d8e Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Thu, 19 Nov 2026 17:51:25 +0200 Subject: [PATCH 5/5] test(server): use #1941's socket E2E teardown verbatim so the two PRs merge cleanly #1941 makes the same shutdown fix in socket_e2e_test.go. Taking its file byte-for-byte means whichever PR lands second merges without a conflict. The CI E2E command still passes with the leak guard. --- internal/server/socket_e2e_test.go | 71 +++++++++++++++--------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/internal/server/socket_e2e_test.go b/internal/server/socket_e2e_test.go index fff0efa6b..702ec9c15 100644 --- a/internal/server/socket_e2e_test.go +++ b/internal/server/socket_e2e_test.go @@ -24,32 +24,6 @@ import ( // socketE2EMutex ensures socket E2E tests run sequentially to avoid shutdown race conditions var socketE2EMutex sync.Mutex -// socketE2EServerStopTimeout bounds how long a socket E2E test waits for -// Server.Start to return after its server was shut down. -const socketE2EServerStopTimeout = 45 * time.Second - -// stopSocketE2EServer shuts down a server a socket E2E test started with -// srv.Start(ctx) in a goroutine that sends Start's result on done. Defer it -// right after starting the server, AFTER the socketE2EMutex unlock defer, so -// it runs first: the server (its runtime, upstream manager and that manager's -// network-recovery watcher) is gone before the next socket test takes the -// mutex and before the package leak guard in leak_guard_main_test.go looks. -// -// Shutdown runs before cancel: Start's own context watcher then finds the -// server already shut down and returns without a second shutdown. -func stopSocketE2EServer(t *testing.T, srv *Server, cancel context.CancelFunc, done <-chan error) { - t.Helper() - if err := srv.Shutdown(); err != nil { - t.Logf("socket E2E server shutdown: %v", err) - } - cancel() - select { - case <-done: - case <-time.After(socketE2EServerStopTimeout): - t.Errorf("socket E2E server did not stop within %s", socketE2EServerStopTimeout) - } -} - // TestEndToEnd_TrayToCore_UnixSocket tests the complete flow: // 1. Core server creates Unix socket listener // 2. Simulated tray client connects via socket @@ -100,13 +74,22 @@ func TestE2E_TrayToCore_UnixSocket(t *testing.T) { require.NoError(t, err) require.NotNil(t, srv) - // Start server in background; stopped before the socket mutex is released. + // Start server in background ctx, cancel := context.WithCancel(context.Background()) - serverDone := make(chan error, 1) + // Shut the server down before the deferred socketE2EMutex unlock (defers + // run last-in first-out), so its upstream manager's network-recovery + // watcher does not outlive the test (TestMain leak guard). Shutdown runs + // first, so the context-cancel shutdown path finds it done and skips. + defer func() { + _ = srv.Shutdown() + cancel() + }() + + serverReady := make(chan error, 1) go func() { - serverDone <- srv.Start(ctx) + err := srv.Start(ctx) + serverReady <- err }() - defer stopSocketE2EServer(t, srv, cancel, serverDone) // Wait for server to be ready require.Eventually(t, func() bool { @@ -237,6 +220,8 @@ func TestE2E_TrayToCore_UnixSocket(t *testing.T) { assert.Contains(t, line, "SSE connection established") }) + _ = serverReady + // Socket file will be cleaned up when tmpDir is removed by test framework or system cleanup t.Log("Test completed successfully") } @@ -280,11 +265,18 @@ func TestE2E_DualListener_Concurrent(t *testing.T) { require.NoError(t, err) ctx, cancel := context.WithCancel(context.Background()) - serverDone := make(chan error, 1) + // Shut the server down before the deferred socketE2EMutex unlock (defers + // run last-in first-out), so its upstream manager's network-recovery + // watcher does not outlive the test (TestMain leak guard). Shutdown runs + // first, so the context-cancel shutdown path finds it done and skips. + defer func() { + _ = srv.Shutdown() + cancel() + }() + go func() { - serverDone <- srv.Start(ctx) + _ = srv.Start(ctx) }() - defer stopSocketE2EServer(t, srv, cancel, serverDone) require.Eventually(t, func() bool { return srv.IsReady() @@ -407,11 +399,18 @@ func TestE2E_SocketPermissions(t *testing.T) { require.NoError(t, err) ctx, cancel := context.WithCancel(context.Background()) - serverDone := make(chan error, 1) + // Shut the server down before the deferred socketE2EMutex unlock (defers + // run last-in first-out), so its upstream manager's network-recovery + // watcher does not outlive the test (TestMain leak guard). Shutdown runs + // first, so the context-cancel shutdown path finds it done and skips. + defer func() { + _ = srv.Shutdown() + cancel() + }() + go func() { - serverDone <- srv.Start(ctx) + _ = srv.Start(ctx) }() - defer stopSocketE2EServer(t, srv, cancel, serverDone) require.Eventually(t, func() bool { return srv.IsReady()