Repository navigation
docs(mcpx): the FAQ and a runnable examples gallery (#1859) - #2454
Conversation
Level-2 faq page: the five questions from the notes as headings, verbatim, each at its fixed anchor (faq#do-you-like-mcp, faq#opencode-code-mode, faq#is-it-safe, faq#why, faq#examples), each answered in ~120 words in the notes' own 'we' voice and ending with one 'more' link. Code-mode facts use the OPENCODE-V2.md correction block and docs/opencode-plugin.md §1, never the stale body; security posture is described, not designed.
…atches (#1859) `examples/` holds four small scripts run against the deterministic fakemcp fixture: call one tool, search and describe inside the script, a stateful `open`/`state` pair, and a `// @param` recipe. `examples_test.go` builds the CLI and the fixture through internal/testsupport, isolates HOME, state, cache and config, sets MCPX_AUTOSTART_IDLE_EXIT=60s and runs `stop --all` on cleanup -- the e2e pattern -- so `go test ./...` in CI executes every example and compares stdout with its checked-in `.expected.txt`. `docs/examples.md` is the gallery derived from them: script, command, exact stdout per example, linked from `faq#examples`. Two corrections the examples directory forces: - `TestEveryDocumentationLinkResolves` now falls back to resolving a backticked path against the citing document when it is not at the module root, which is how the plugin skills write `examples/README.md`, and `examples/servers/` joins the foreign prefixes (the conformance clone). - `plugin/opencode/README.md` named `examples/screenshot-and-errors.ts` for the browser skill's example; it now names the real path.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🤖 Agent note · PR opened, parked for CI
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5956d05c86
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Run them from `pkgs/mcpx`. The first run writes `mcpx-client.ts` and its | ||
| declarations beside the script, which is how `mcpx run` works for any file; | ||
| the `.gitignore` in that directory keeps them out of git. |
There was a problem hiding this comment.
Document fixture setup before the runnable examples
For a reader following this page from a normal checkout, none of the advertised commands can produce the shown output because the demo server has not been configured. A repository-wide search found the fixture setup in examples/examples_test.go, where the test builds internal/testsupport/fakemcp and writes a temporary mcpServers.demo configuration; running an example directly does neither. Add instructions to build the fixture and configure its namespace before presenting the scripts as runnable as-is. Renaming the namespace to an existing server is insufficient because these examples require the fixture-specific tools and responses.
Useful? React with 👍 / 👎.
| subprocesses. `script.permissions` defaults to `all`, and the narrower profiles | ||
| (`net`, `read`, `read-net`, `strict`) apply only on Deno: bun and node run with | ||
| the user's own authority whatever you ask for. The daemon API is |
There was a problem hiding this comment.
Describe the permission profiles actually enforced
For users choosing a restricted runtime, this incorrectly says that Node and Bun silently run with full authority regardless of the requested profile. internal/runner/runtimes.go rejects a named profile when it has no flags for the selected runtime, and internal/defaults/defaults.json explicitly defines Node permission flags for read-net/readnet. The existing tests in internal/e2e/permissions_test.go cover both refusal of unsupported profiles and enforcement of Node's write restriction. Describe those behaviors instead so the safety guidance does not tell readers that supported restrictions are ineffective.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Disposition (2026-10-31, queue task 4761 / issue #3246): confirmed and fixed. The FAQ text was wrong exactly as flagged — node enforces readnet/read-net via --permission --allow-fs-read=*, and a named profile with no entry for the chosen runtime is refused with an error rather than run unenforced. Fix PR: #3263 rewrites the FAQ answer per-runtime against defaults.json + runtimes.go and adds a dated supersession note to decision 0003 §2 (which repeated the stale claim).
There was a problem hiding this comment.
Dispositioned: this finding was verified by triage (task 4746, issue #3246) and fixed in PR #3263, merged 2026-11-01 as 3186e25. The mcpx FAQ "is it safe?" answer now describes per-runtime enforcement accurately (node enforces readnet/read-net via --permission --allow-fs-read=*; net/read/strict are Deno-only; a named profile with no entry for the chosen runtime is refused with an error, never run unenforced), and docs/decisions/0003 section 2 carries a dated supersession note pointing at the corrected FAQ. No code changes were needed — defaults.json and runtimes.go were already correct; the docs were wrong.
|
🤖 Agent note · green and enqueued in the merge queue
|
|
🤖 Agent note · green, waiting on the known merge-queue stall
|
Closes #1859 (parent #94; triage task 2747 verdict CONFIRMED).
What this adds
pkgs/mcpx/docs/faq.md— the level-2 FAQ. The five questions from the notes are headings word for word (quotes,, no.and..included), each with its fixed anchor set explicitly (<a id="…">, the form that works on GitHub now and in mdBook later, as the page map requires):faq#do-you-like-mcp,faq#opencode-code-mode,faq#is-it-safe,faq#why,faq#examples. Each answer is ~120 words, in the notes' own "we" voice, and ends with exactly one "more" link into a page that exists today (story.md,opencode-plugin.md,AGENTS.md,ASSESSMENT.md,examples.md).Facts, and where they come from:
docs/story.md"Summary" and "mcpx speaks MCP".OPENCODE-V2.mdcorrection block anddocs/opencode-plugin.md§1 — v1 ships it behindOPENCODE_EXPERIMENTAL_CODE_MODE, both accept TypeScript — never the stale body.OPENCODE-V2.mditself is untouched; it belongs to the compendium tracker.AGENTS.md"Scripts" (this is the citation that replaces the issue's driftedinternal/runner/runner.go:41-66), plus the daemon's unauthenticated loopback/socket posture fromdocs/story.md"One daemon, many clients". "Is it safe?" starts with No. and describes the posture; it designs no security.ASSESSMENT.mdand the opening walk.pkgs/mcpx/examples/— four runnable scripts and the test that runs them, Approach C of the issue:call-a-tool.tsawait, one argument object, print the resultdiscover.tsObject.keys(tools.demo),describe(), then two calls in one scriptstateful.tsopenthenstatein one invocation, andlog()recipe-echo.ts// @paramrecipe, saved and run throughmcpx recipesexamples_test.gobuilds the CLI and thefakemcpfixture throughinternal/testsupport, gives each run its ownHOME,MCPX_STATE_DIR,MCPX_CACHE_DIRandMCPX_CONFIG, setsMCPX_AUTOSTART_IDLE_EXIT=60s, and runsmcpx stop --allon cleanup — the daemon-hygiene pattern frominternal/e2e(#52/#182). Each script is run from a temp copy (somcpx run's generatedmcpx-client.tsnever lands in the tree) and its stdout is compared with a checked-in.expected.txt, with a line diff on failure. Deterministic: the fixture server only, no Chrome, no network, no clock. Because it is a Go test inpkgs/mcpx, the existingmcpxworkflow'sgo test ./...executes it — no new workflow, and an example that rots fails the build.pkgs/mcpx/docs/examples.md— the gallery, derived from those files: per example the script, the command, and the exact stdout.faq#exampleslinks to it. Every fenced block was checked against the.tsand.expected.txtbytes.Two small corrections the directory forces
internal/defaults/links_test.go: a backticked path that is not at the module root is now also tried against the citing document. The plugin skills writeexamples/README.mdand mean the directory besideSKILL.md; before, those were skipped only because no top-levelexamples/existed.examples/servers/joinsforeignPrefixes— it is the cloned official conformance suite's layout, the same category asdocs/extensions/.plugin/opencode/README.mdnamedexamples/screenshot-and-errors.tsfor the browser skill's example; it names the real path now.Verification
Not run locally: the full
go test ./...(CI's job) andnix build(not triggered by a docs-only change).Not in this PR
faq#…anchors, so those pages can point at them when they land.docs/scripts.md(the other back-link the issue names) is mcpx docs interface pages A: interfaces, CLI, binary, scripts prose pages (split of #1851) #2108's page; the FAQ links toAGENTS.mdinstead of a page that is not there.OPENCODE-V2.md's stale body is left to the compendium tracker, per the issue's exclusion. Its correction block is what the FAQ cites.Queue task: 3069 (worker
repo-worker-code, OpenChamber scheduled lane).Need help on this PR? Tag
@codesmith-botwith what you need.