Skip to content

Commit 2146860

Browse files
authored
docs: add task-based setup and troubleshooting guides (#1736)
## Problem and change Readers can find individual feature references but lack a complete path for sharing one MCP setup across clients or diagnosing a tool that an agent cannot use. Add two task-based guides: **Reuse one MCP setup in two AI clients** (Claude Code and Codex CLI) and **Find out why an agent cannot use a tool**. Each includes prerequisites, concrete commands, expected results, recovery steps and a completion check in Activity. Add a small Guides landing page, sidebar navigation, and links from the homepage and Quick Start. Include the new section in the shared HTML/LLM publication list. The guides distinguish client authentication from upstream authentication, operator visibility from client scope, and scan evidence from an approval decision. Validation stamps explicitly distinguish protocol-session testing from actual AI-client UI runs. ## Validation - `npm --prefix website run build`: passed, including postbuild verification of all 132 published LLM links, full export, metadata, sitemap and robots. - `go test ./cmd/release-gate ./internal/connect -count=1`: passed. - Released MCPProxy v0.71.1 in isolated scratch storage on port 19876: added Context7 in manual quarantine, fetched/reviewed definitions and scan, explicitly approved selected tools, confirmed preflight ready. - Two independent test client credentials and MCP sessions discovered and called the real Context7 resolver. Activity showed distinct client identities, arguments, successful responses and invalid-argument failures. - Reproduced tool disable/preflight exit 11, re-enable/ready, unknown tool exit 12, and successful retry. Verified client-view CLI and `activity show --include-response` against the released binary. - Browser inspection confirmed all three pages render and navigation works. - Independent fresh-context review: **VERDICT: PASS**, with no remaining actionable findings after correcting the client-view command and adding `--include-response`. No production daemon settings or AI-client configuration files were changed during validation. No end-to-end Claude Code/Codex UI run is claimed. ## Deployed preview [Guides preview](https://ba04d0ac.mcpproxy-docs.pages.dev/guides) verified live: all 132 exported documentation routes return successful responses after canonical redirects; all three new routes have descriptions and canonical URLs and appear in the sitemap and LLM exports.
1 parent 2605d28 commit 2146860

7 files changed

Lines changed: 288 additions & 0 deletions

File tree

‎docs/getting-started/quick-start.mdx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ reviewed, approved, discovered and called - end to end.
410410

411411
## Next Steps
412412

413+
- [Reuse this setup in a second AI client](/guides/two-clients-one-setup)
414+
- [Diagnose a missing or failing tool](/guides/diagnose-unavailable-tool)
415+
413416
- Learn about [configuration options](/configuration/config-file)
414417
- Set up [upstream servers](/configuration/upstream-servers)
415418
- Explore [CLI commands](/cli/command-reference)
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
title: Find out why an agent cannot use a tool
3+
sidebar_label: Diagnose an unavailable tool
4+
description: Trace a missing or failing MCP tool through client connection, server state, review, access policy, discovery and Activity, then verify the fix.
5+
---
6+
7+
# Find out why an agent cannot use a tool
8+
9+
Your client may be connected while a particular tool is unavailable. Work from the first failing check below, change only the cause you identify, and repeat the original call. You are done when the agent's retry succeeds and Activity records that result.
10+
11+
## Before you start
12+
13+
Use **MCPProxy v0.71.1 or later** and run operator commands on the machine running the proxy. Commands below use `context7:resolve-library-id` as an example; replace it with your exact `server:tool` ID. If you use a custom data directory, pass the same `--config` and `--data-dir` options as your daemon.
14+
15+
Keep the original error text and approximate time. Do not share administrator URLs, credentials, private tool arguments or full diagnostic dumps in public issues.
16+
17+
## 1. Can the client reach the right proxy?
18+
19+
```bash
20+
mcpproxy status
21+
```
22+
23+
**Expected:** `Running`, the intended listen address, and the routing mode you expect. Treat the Web UI URL printed by diagnostics as private. If the proxy is stopped, start it using your normal tray/service setup; do not start a second instance on an occupied port.
24+
25+
Open the client's MCP status view (`/mcp` in Claude Code or Codex) and compare its endpoint with **Clients → Endpoint & mode** in MCPProxy.
26+
27+
| What you see | What to do |
28+
| --- | --- |
29+
| Connection refused | Check the running instance and port. On another computer or container, `localhost` refers to that environment, not your proxy's host. |
30+
| `401` from MCPProxy | Check the client's credential. Use [Connect Clients](/features/connect-clients) to reconnect an expired/revoked client; keep `require_mcp_auth` enabled if you rely on it. |
31+
| Connected to the wrong proxy | Correct the client entry and restart the client. Check project-level overrides as well as user-level configuration. |
32+
| Connected, only routing tools visible | This is expected in `retrieve_tools` mode. Continue below. In direct or code-execution mode, follow that mode's [calling pattern](/features/routing-modes). |
33+
34+
An upstream `401` during a tool call is a different problem: fix that server's authentication in step 4, not the client's MCPProxy credential.
35+
36+
## 2. Ask for an exact availability diagnosis
37+
38+
```bash
39+
mcpproxy upstream list
40+
mcpproxy tools preflight context7:resolve-library-id
41+
```
42+
43+
Preflight reads local proxy state; it does **not** contact the upstream or guarantee that a later call will succeed. A nonzero exit code is a diagnostic result, not a reason to reset configuration.
44+
45+
| Result / reason | Next action |
46+
| --- | --- |
47+
| `ready` (exit `0`) | Continue to discovery and the real call in step 4. |
48+
| `server_initializing` or another retryable reason (exit `10`) | Read the action/detail; allow a short retry with `--wait 10s`. If it persists, inspect the server's connection error and logs. |
49+
| `server_quarantined`, `tool_pending_approval`, `tool_changed` (usually exit `11`) | Inspect the held definitions in step 3. |
50+
| Disabled server or tool; configuration policy denial | Confirm whether the restriction is intentional. Use the server/Tools view to identify it before enabling anything. |
51+
| `oauth_required` or an upstream authentication problem | Authenticate the upstream through its server page. See [OAuth authentication](/features/oauth-authentication). |
52+
| `not_found` (exit `12`) | Verify the exact name and server entry. An agent-visible `not_found` can also mean its access scope hides the tool. |
53+
54+
For connection errors, inspect the server page and `mcpproxy upstream logs context7`. See [preflight reason and exit-code details](/features/tools-preflight).
55+
56+
### Operator-ready does not always mean client-ready
57+
58+
An operator's default preflight sees more than a restricted client. Inspect the client's actual access:
59+
60+
```bash
61+
mcpproxy tools list --client claude-code
62+
```
63+
64+
Replace `claude-code` with the connected client's ID. Find the row with server `context7` and name `resolve-library-id` and read the **ACCESS** and **REASON** columns. The client view applies to the global list; do not combine it with `--server`. Check the client's binding in **Clients**, its profile's server/tool policy, and any token restrictions. If the restriction is intentional, use an authorized client/profile; do not widen access just to make the error disappear.
65+
66+
A tool outside a restricted agent's scope can appear as `not_found` without disclosing that it exists. See [Profiles](/features/profiles) and [Agent tokens](/features/agent-tokens).
67+
68+
## 3. Resolve a review hold deliberately
69+
70+
```bash
71+
mcpproxy review list
72+
mcpproxy review show context7 --full
73+
```
74+
75+
If definitions have not been captured, use `mcpproxy review fetch context7`, then inspect them. Read `mcpproxy security report context7`; if no scan exists, run `mcpproxy security scan context7` first.
76+
77+
- **New server:** review the server source and the tools you intend to allow. Approval can leave unselected tools blocked.
78+
- **Changed tool:** inspect the definition diff, including schemas and safety hints. A clean scan does not approve the changed contract.
79+
- **Failed or dangerous scan:** investigate the report. Do not use `--force`, disable quarantine, or switch to automatic trust as a troubleshooting shortcut.
80+
81+
Only after accepting the specific tool, run:
82+
83+
```bash
84+
mcpproxy review approve context7 --tools resolve-library-id
85+
```
86+
87+
Read the confirmation prompt. On a quarantined server, this allows that selected tool and blocks the others; on an already trusted server it approves the selected pending/changed tool. If the reviewed definitions changed in the meantime, fetch and inspect the new review before trying again.
88+
89+
If a tool was deliberately blocked earlier, approving it again is not the same as enabling it. Inspect its state in the Tools view and enable only what your policy permits. See [Review commands](/cli/review-commands).
90+
91+
Repeat preflight. If the reason changes, follow the new reason instead of repeating approval.
92+
93+
## 4. Separate discovery from a failed call
94+
95+
For `retrieve_tools` mode, ask the agent:
96+
97+
> Use MCPProxy retrieve_tools to find context7:resolve-library-id. Use the exact returned name, current schema and call_with tool. Resolve "Vue Router" with query "How do I configure a basic Vue Router route?". Do not use a shell or web search instead. If the call fails, report the tool error rather than guessing a result.
98+
99+
If retrieval returns no match despite client access being allowed, try a short query describing the tool's operation. Check that discovery has completed and the server's Tools view lists the expected tool. If the agent does not attempt MCPProxy at all, use [Agent instructions](/features/agent-instructions). In other routing modes, use their [documented call surface](/features/routing-modes).
100+
101+
If a call was attempted, inspect Activity:
102+
103+
```bash
104+
mcpproxy activity list --server context7 --tool resolve-library-id --from=-15m
105+
```
106+
107+
Open the relevant ID with `mcpproxy activity show <id> --include-response` or in the Web UI. Match time, client/session, arguments and result—not just the tool name.
108+
109+
| Evidence | Remedy |
110+
| --- | --- |
111+
| Invalid or missing arguments | Use the returned/current input schema. For the example resolver, both `libraryName` and `query` are required. |
112+
| Upstream authentication error | Refresh that upstream's OAuth login or configured key; this is separate from client-to-proxy authentication. |
113+
| Rate limit, timeout or network error | Follow the upstream's retry guidance; inspect connection status and logs. Avoid an unbounded retry loop. |
114+
| Policy or review refusal | Return to the specific access/review check above. |
115+
| No matching upstream call | The agent may not have called it, or it may have failed before dispatch. Check the client's tool transcript and unfiltered recent Activity for internal calls or policy decisions. |
116+
117+
For broader Activity filters and request IDs, see [Activity commands](/cli/activity-commands).
118+
119+
## 5. Prove the recovery
120+
121+
Repeat the **same original request in the same client**, with the intended profile and credential. Verify:
122+
123+
1. Preflight no longer reports the original blocker.
124+
2. The agent makes the intended tool call and receives a successful result.
125+
3. Activity contains that retry with matching arguments, client/session and status.
126+
127+
If it still fails, save the sanitized error, MCPProxy version, timestamp/request ID, routing mode and preflight reason when [reporting an issue](https://github.com/smart-mcp-proxy/mcpproxy-go/issues). A ready preflight alone is not proof of a successful recovery.
128+
129+
*Validation: 22 October 2026, MCPProxy v0.71.1 on macOS. Quarantine, approval, transient initialization, tool disable/re-enable, unknown ID, invalid arguments and successful retry were checked in an isolated instance. Maintained by the MCPProxy maintainers.*

‎docs/guides/index.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: Guides
3+
slug: /guides
4+
description: Complete a task with MCPProxy, from sharing one MCP setup across AI clients to diagnosing an unavailable tool.
5+
---
6+
7+
# What do you want to do?
8+
9+
These guides take you from a specific problem to a result you can verify.
10+
New to MCPProxy? [Install it first](/getting-started/installation), then follow the [Quick Start](/getting-started/quick-start).
11+
12+
| Your task | What you will finish with |
13+
| --- | --- |
14+
| [Reuse one MCP setup in two AI clients](/guides/two-clients-one-setup) | Claude Code and Codex using the same upstream, with a successful call from each recorded in Activity. |
15+
| [Find out why an agent cannot use a tool](/guides/diagnose-unavailable-tool) | A diagnosed connection, approval, access or call failure, followed by a verified retry. |
16+
17+
## Choose the right reference
18+
19+
- **How tools reach the agent:** [Routing modes](/features/routing-modes) explains discovery, direct tools and code execution. The two-client guide uses the default `retrieve_tools` mode.
20+
- **What a client can access:** [Profiles](/features/profiles) and [agent tokens](/features/agent-tokens) cover access restrictions.
21+
- **What is held for review:** [Security quarantine](/features/security-quarantine) explains server admission and tool changes.
22+
- **Exact flags and fields:** use the [CLI](/cli/command-reference), [configuration](/configuration/config-file) and [REST API](/api/rest-api) references.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
title: Reuse one MCP setup in two AI clients
3+
sidebar_label: One setup, two clients
4+
description: Connect Claude Code and Codex to one local MCPProxy instance, review a documentation upstream once, and verify a real tool call from each client.
5+
---
6+
7+
# Reuse one MCP setup in two AI clients
8+
9+
Configure a documentation server once in MCPProxy, then use it from **Claude Code** and **Codex CLI** on the same computer. You are done when both clients have called the same upstream tool and you can find both successful calls in Activity.
10+
11+
## Before you start
12+
13+
- Install **MCPProxy v0.71.1 or later** and both clients. Sign in to each client as required by its provider.
14+
- Start one local MCPProxy instance using the [installation instructions](/getting-started/installation) or the tray app. If it is already running, do not start another.
15+
- Open its Web UI from the tray menu. Terminal users can run `mcpproxy status --web-url` and open the returned URL privately: it contains an administrator credential.
16+
- Use the default **`retrieve_tools` routing mode**. Check **Clients → Endpoint & mode**; see [routing modes](/features/routing-modes) if your instance uses another mode.
17+
- This guide uses the remote [Context7 documentation server](https://context7.com/docs/resources/all-clients). It receives your library query. Use only public example text; access requirements and rate limits are controlled by Context7.
18+
19+
Keep the listener on loopback (`127.0.0.1`). This is one person's local setup, not a shared team deployment. Sharing upstream configuration does **not** create per-user isolation. For team access, follow [Deploying for a team](/operations/deploying-for-a-team).
20+
21+
## 1. Add the upstream once
22+
23+
In a terminal on the machine running MCPProxy:
24+
25+
```bash
26+
mcpproxy upstream add context7 https://mcp.context7.com/mcp --trust-mode manual
27+
mcpproxy review fetch context7
28+
mcpproxy review show context7 --full
29+
```
30+
31+
**Expected:** the server is quarantined and its captured definitions include `resolve-library-id` and `query-docs`. Fetching definitions does not approve them. If `context7` already exists, inspect that entry instead of adding a duplicate.
32+
33+
Inspect the URL, descriptions, input schemas and read-only annotations. Tool definitions are supplied by the upstream; a clean scan is evidence for your decision, not a guarantee of safety.
34+
35+
```bash
36+
mcpproxy security report context7
37+
```
38+
39+
If a scan is still running, wait and read the report again. If no report exists, run `mcpproxy security scan context7`, then read the report. Resolve failed scans or findings before continuing; do not bypass the gate with `--force`.
40+
41+
After you have reviewed and accepted those two tools:
42+
43+
```bash
44+
mcpproxy review approve context7 --tools resolve-library-id,query-docs
45+
mcpproxy tools preflight context7:resolve-library-id --wait 10s
46+
```
47+
48+
Read the approval prompt before confirming it. **Expected:** both selected tools are approved, then preflight reports `ready` (exit `0`). A brief `server_initializing` state after approval is normal; retry preflight once connection completes. If approval reports a stale review, inspect the new definitions before trying again.
49+
50+
If Context7 requires a key or returns a quota error, follow its current access instructions and store the credential on the **upstream entry in MCPProxy**, not separately in both AI clients. See [upstream authentication](/configuration/upstream-servers). The upstream's credential is different from a client's credential for MCPProxy.
51+
52+
## 2. Connect Claude Code
53+
54+
```bash
55+
mcpproxy connect claude-code
56+
```
57+
58+
This writes a per-client credential into Claude Code's configuration and backs up an existing file. It does not give the client the instance administrator API key. If an entry already exists, use **Clients → Connect** in the Web UI to inspect the replacement preview before confirming it; do not blindly add `--force`.
59+
60+
Restart Claude Code and open `/mcp`. Confirm that **mcpproxy** is connected. Project-level settings can override a user-level entry; if the wrong endpoint appears, check the client's [configuration scopes](https://code.claude.com/docs/en/mcp#mcp-installation-scopes).
61+
62+
**Expected:** Claude Code connects to MCPProxy's `/mcp` endpoint. It does not need its own direct Context7 entry.
63+
64+
## 3. Connect Codex CLI
65+
66+
```bash
67+
mcpproxy connect codex
68+
```
69+
70+
Restart Codex CLI, then open `/mcp` to check the connection. The Connect flow writes to `~/.codex/config.toml`; see [Codex MCP configuration](https://learn.chatgpt.com/docs/extend/mcp?surface=cli).
71+
72+
:::note Keep the generated credential private
73+
For Codex, Connect currently puts the per-client credential in the endpoint URL's `apikey` query parameter. Do not paste the generated URL into screenshots, issues or shared configuration. The [Connect Clients reference](/features/connect-clients#codex-credential-limitation) describes a manual environment-header alternative.
74+
:::
75+
76+
New client credentials default to **All servers, switchable**. Existing clients retain their binding when reconnected. If you need a narrower profile, use the [Connect Clients profile options](/features/connect-clients#using-client-credentials). Enable `require_mcp_auth` before relying on a restricted profile so an anonymous connection cannot bypass it.
77+
78+
**Expected:** both clients point to the same proxy, with separate client credentials. No second copy of the upstream configuration is needed.
79+
80+
## 4. Make one real call from each client
81+
82+
Start a fresh conversation in Claude Code and send:
83+
84+
> Use MCPProxy, not a shell command or web search. First use retrieve_tools to find context7's library ID resolver. Then call context7:resolve-library-id for libraryName "Vue Router" and query "How do I configure a basic Vue Router route?". Show the returned library ID. Do not change any files.
85+
86+
Approve the client's tool-use prompt if it asks. Repeat the same request in Codex.
87+
88+
**Expected tool sequence in each client:**
89+
90+
1. `retrieve_tools` finds `context7:resolve-library-id` and its current argument schema.
91+
2. The agent uses the returned `call_with` tool (normally `call_tool_read`) to invoke that exact name with `libraryName` and `query`.
92+
3. Context7 returns actual library matches. Their IDs and contents can change; do not compare against a hard-coded ID.
93+
94+
In discovery mode, seeing only MCPProxy's small set of routing tools in `/mcp` is normal. The upstream tools appear through retrieval. If the agent chooses another route, use the [agent-instructions snippet](/features/agent-instructions) and repeat the explicit request.
95+
96+
## 5. Verify both calls in Activity
97+
98+
```bash
99+
mcpproxy activity list --server context7 --tool resolve-library-id --type tool_call --from=-15m
100+
```
101+
102+
Open the two matching rows in the Web UI's **Activity** view, or run `mcpproxy activity show <id> --include-response` with each returned ID. Check the timestamp, arguments, successful result, and client/session attribution. With Connect credentials, the client identifiers should distinguish `claude-code` from `codex`; self-reported client names alone are advisory.
103+
104+
**Completion check:** one successful upstream call from each client, using the same `context7` entry. A connected badge or a plausible answer without the corresponding tool activity does not prove this workflow succeeded.
105+
106+
## If it does not work
107+
108+
| Symptom | Next check |
109+
| --- | --- |
110+
| Client cannot connect, or gets `401` | Confirm MCPProxy is running and the client's endpoint matches it. Reconnect that client to replace an expired/revoked credential; do not disable authentication as a fix. |
111+
| Connected, but the resolver is missing | Run preflight again; inspect quarantine, tool approval and the client's profile. |
112+
| Resolver appears, but the call fails | Inspect its Activity entry for invalid arguments, upstream authentication or rate limits. |
113+
114+
Follow [Find out why an agent cannot use a tool](/guides/diagnose-unavailable-tool) for the full diagnosis path.
115+
116+
## Next steps and cleanup
117+
118+
- Choose a [routing mode](/features/routing-modes) once the two-client baseline works.
119+
- Disconnect only the client entry you no longer want with `mcpproxy disconnect claude-code` or `mcpproxy disconnect codex`. See [client credential lifecycle](/features/connect-clients#using-client-credentials) for revocation; removing a config entry and revoking its credential are distinct actions.
120+
- To stop using the example upstream while keeping its configuration, run `mcpproxy upstream disable context7`.
121+
122+
*Validation: 22 October 2026, MCPProxy v0.71.1 on macOS. Upstream review, discovery, calls from two independent MCP sessions and Activity were checked against the released daemon. Client connection instructions were checked against Connect's configuration tests and the linked client references; this is not a claim of an end-to-end UI test of every client release. Maintained by the MCPProxy maintainers.*

0 commit comments

Comments
 (0)