Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions pkgs/mcpx/docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
- [Modes](modes.md)
- [mcpx as a consumer](consumer.md)
- [Running mcpx in a container](container.md)
- [Coverage: the book against the binary](coverage.md)
- [Declared but never read](declared-but-unread.md)
- [Dependencies](dependencies.md)
- [Deploying this book](deploying.md)
- [Elicitation: a design](elicitation.md)
- [The script environment](environment.md)
- [Examples](examples.md)
- [exec and artifacts](exec.md)
- [FAQ](faq.md)
- [Finding the repository without git](git-discovery.md)
- [Glossary](glossary.md)
- [The home-page example: copy it or run it in the page](home-example.md)
- [The /v1 HTTP API](http-api.md)
- [Ideas](ideas.md)
Expand All @@ -38,6 +41,7 @@
- [Plugins](plugins.md)
- [Proposals](proposals.md)
- [Protocol: every revision, both directions](protocol.md)
- [Public Go client for /v1 (`pkg/client`)](public-client.md)
- [Quick start](quick-start.md)
- [Release runbook](release-runbook.md)
- [Reaching a daemon on another machine](remote.md)
Expand All @@ -49,6 +53,10 @@
- [mcpx](story.md)
- [mcpx Development Strategies & Lessons Learned](work-strategies.md)
- [Audit](<>)
- [Testing mcpx](testing.md)
- [mcpx test inventory (deliverable 1 of #1960)](testing/inventory.md)
- [mcpx fuzz and seed policy (#1960)](testing/fuzz-and-seed-policy.md)
- [mcpx feature↔integration-test inventory (for #1978)](testing/feature-inventory.md)
- [Audit: features (end to end)](audit/features.md)
- [Audit: the MCP specification (area `spec`)](audit/spec.md)
- [Audit: mcpx's own surface](audit/surface.md)
Expand Down Expand Up @@ -96,6 +104,7 @@
- [0004 — Scope-resolved roots: spawn cwd, `${mcpx.root}` substitution, initialize workspace](decisions/0004-scope-resolved-roots.md)
- [0005 — Release pipeline, version single-sourcing, and the module path](decisions/0005-release-pipeline.md)
- [0006 — TTLs renew by touch-on-read, bounded by a maxAge ceiling](decisions/0006-ttl-touch-on-read.md)
- [0007 — Elicitation state binds no user identity (refuse-identity)](decisions/0007-elicitation-identity.md)
- [The home-page example component](home-example/README.md)
- [docs/spec](spec/README.md)
- [What the specification asks of a client](spec/client-obligations.md)
Expand Down
36 changes: 33 additions & 3 deletions pkgs/mcpx/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ mcpx completion bash # also: zsh, fish
The Nix package installs both for you: the man page to
`share/man/man1/mcpx.1`, and completions for all three shells.

One more surface from the same declarations: `mcpx help agents`
prints the agent documentation (`AGENTS.md`) embedded in the
binary, so the instructions an agent reads are the ones the
binary it is driving was built with.

<a id="cli-arguments"></a>

## CLI arguments
Expand Down Expand Up @@ -188,11 +193,36 @@ grouping `mcpx help` presents, and what each group is for:
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **running** | doing the work: `run`, `exec`, `scripts`, `skills`, `recipes`, `prompt`, `proxy`, `embeddings`, `feedback` |
| **discovery** | finding out what exists before paying for its schemas: `ls`, `catalog`, `types`, `search`, `call`, `batch`, `client`, `schema`, `prompts`, `resources`, `openapi` |
| **daemon** | the daemon's own lifecycle: `status`, `daemons`, `refresh`, `reload`, `upgrade`, `restart`, `stop`, `supervise`, `daemon`, `serve` |
| **configuration** | shaping mcpx itself: `config`, `settings`, `servers`, `secrets`, `init`, `registry`, `api`, `adapter`, plus `help`, `man` and `completion` |
| **inspection** | looking at what happened: `diagnose`, `elicit`, `doctor`, `tui`, `explore`, `dashboard`, `interactions`, `log`, `stats` |
| **daemon** | the daemon's own lifecycle: `status`, `daemons`, `refresh`, `reload`, `upgrade`, `restart`, `stop`, `supervise`, `daemon`, `serve`, `cache`, `stdio-proxy` |
| **configuration** | shaping mcpx itself: `config`, `settings`, `servers`, `secrets`, `init`, `registry`, `api`, `adapter`, `plugin`, plus `help`, `man` and `completion` |
| **inspection** | looking at what happened: `diagnose`, `elicit`, `doctor`, `tui`, `explore`, `dashboard`, `interactions`, `log`, `stats`, `hook`, `want` |
| **operations** | one generated command per `/v1` operation (for example `mcpx artifact list`) — these exist the moment an operation is declared, with flags from its parameters |

For any one command, `mcpx help <command>` is the reference: it
is printed from the same declaration the table is generated
from, so the two cannot disagree.

### The verb sets

Several commands are families: one name, a verb as the first
argument. The generated table lists each family once; the verbs
are declared with it and printed by `mcpx help <command>`.

| command | verbs | what the family does |
| ---------- | -------------------------------------------------- | -------------------- |
| `adapter` | `list`, `check`, `call`, `tools`, `serve`, `import`, `add`, `remove` | command-line programs declared as MCP tools: show them, check the programs are installed, call one tool, print the tool definitions an MCP host would see, serve one as a namespace, generate a declaration (`import` — from shell completions, a man page or `--help`, in that order), or write and remove declarations through the daemon |
| `api` | `list`, `tools`, `call`, `add`, `remove` | HTTP services described by an OpenAPI document (`--spec`), as tools — the same shapes as `adapter`, over a document instead of a program |
| `servers` | `list`, `show`, `add`, `remove` | the configured MCP servers, changed live without restarting anything |
| `registry` | `search`, `show`, `add` | find a server in a public registry, inspect what would be added, add it |
| `secrets` | `list`, `set`, `unset`, `requests`, `request`, `decline` | the in-memory secret store: what is held, what servers have asked for, and answering or declining a request. In memory only — nothing here is written to disk |
| `settings` | `list`, `get`, `set`, `unset` | read and change any setting, from anywhere — see [Configuration](./configuration.md) |
| `skills` | `list`, `install` | the agent skills embedded in the binary, managed by `mcpx skills`: list them, or install them into an agent's configuration (`--agent <name>`, `--to <dir>`) |
| `cache` | `prune`, `remove` (a bare `mcpx cache` lists) | the shared cache: list its entries, prune them by policy, or remove one entry by kind and key |
| `plugin` | `list` | the plugins discovered under `paths.plugins`, each one an MCP server |
| `stats` | `calls`, `servers`, `errors`, `sessions`, `volume`, `slowest` | one aggregation of the log per mode word: counts, per-server totals, errors, sessions, bytes, and the slowest individual calls |

The daemon-operations group is the same idea, generated: one
command per `/v1` operation (`artifact`, `ask`, `task`,
`session`, and the rest), each with the operation's own verbs —
`mcpx help <command>` prints them, and [parity.md](./parity.md)
maps every one to its route.
2 changes: 1 addition & 1 deletion pkgs/mcpx/docs/compare/matrix-mcpx.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ code cited in it and editing its cells, then change the commit above.
each upstream negotiated. It does not report whether mcpx implements a feature
correctly, and nothing generates that side yet.

Columns. **srv→<rev>**: a host of that revision connected to mcpx.
Columns. **srv→&lt;rev&gt;**: a host of that revision connected to mcpx.
**cli→legacy**: mcpx connected to an upstream speaking 2025-03-26 to
2025-11-25 (mcpx offers 2025-11-25). **cli→modern**: mcpx connected to a
2026-07-28 upstream. The register column links the area file holding the
Expand Down
4 changes: 2 additions & 2 deletions pkgs/mcpx/docs/compare/register/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m
drops the clause because sessions are gone. mcpx's `auth` type `query` exists to put a static credential in the URL
(`Resolved.Query`); that is legitimate for API keys but would violate the query-string MUST if it ever carried an
OAuth access token.
- **Sources.** `2025-03-26/basic/authorization.mdx:270` "Authorization: Bearer <access-token>"; `2025-03-26/basic/authorization.mdx:276` "2. Access tokens **MUST NOT** be included in the URI query string"; `2026-07-28/basic/authorization/index.mdx:262` "1. MCP client **MUST** use the Authorization request header field defined in"; `internal/pool/pool.go:379` "Headers: p.cfg.Headers,"
- **Sources.** `2025-03-26/basic/authorization.mdx:270` "Authorization: Bearer &lt;access-token&gt;"; `2025-03-26/basic/authorization.mdx:276` "2. Access tokens **MUST NOT** be included in the URI query string"; `2026-07-28/basic/authorization/index.mdx:262` "1. MCP client **MUST** use the Authorization request header field defined in"; `internal/pool/pool.go:379` "Headers: p.cfg.Headers,"

## AUTH-04 PKCE required; refuse AS without `code_challenge_methods_supported`

Expand Down Expand Up @@ -397,7 +397,7 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m
- **Effort.** M for a bearer token; L for a full OAuth resource server (AUTH-06).
- **Risk.** High: remote code execution for anything that reaches the port.
- **Detail.** If mcpx adds a 401 to `/mcp`, opencode v1 will read it as "needs OAuth": it moves the server to
`needs_auth` and toasts "Run: opencode mcp auth <name>", partly by matching "OAuth"/"registration"/"client_id" in error
`needs_auth` and toasts "Run: opencode mcp auth &lt;name&gt;", partly by matching "OAuth"/"registration"/"client_id" in error
text. Users would need `oauth: false` and a static header in opencode's config.
- **Sources.** `2024-11-05/basic/transports.mdx:57` "3. Servers **SHOULD** implement proper authentication for all connections"; `2026-07-28/basic/transports/streamable-http.mdx:65` "Servers **SHOULD** implement proper authentication"; `internal/cli/root.go:202` "the API is unauthenticated"; `v1:packages/opencode/src/mcp/index.ts:317`

Expand Down
4 changes: 2 additions & 2 deletions pkgs/mcpx/docs/compare/register/code-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m
register's AUTH-25 and AUTH-24.
- **Sources.** `.lootbox/src/lib/constants.ts:78` `export const DEFAULT_PERMISSION_FLAGS: readonly string[] =
["--allow-net"];`; `.lootbox/src/lib/get_config.ts:485`; `internal/runner/runner.go:47` "The default is wide open.";
`ASSESSMENT.md:73` "deno run --allow-all --reload=http://localhost:PORT/client.ts --no-check=remote <tmpfile>"
`ASSESSMENT.md:73` "deno run --allow-all --reload=http://localhost:PORT/client.ts --no-check=remote &lt;tmpfile&gt;"

## CODE-09 Cloudflare blocks or proxies all outbound network

Expand Down Expand Up @@ -560,7 +560,7 @@ input.entry.tool.timeout` (`v1:packages/opencode/src/tool/code-mode.ts:154-158`)
for writes, which also need a permission.
- **Sources.** `.lootbox/src/lib/lootbox-cli/exec.ts:40` `ws.send(JSON.stringify({ script, id }));`;
`.lootbox/src/lib/execute_llm_script.ts:20`; `nix:configuration.nix:742` `WorkingDirectory =
"/Users/drewry.pope/.config/nix";`
"/Users/<user>/.config/nix";`

## CODE-22 Caller chooses local or remote execution

Expand Down
8 changes: 4 additions & 4 deletions pkgs/mcpx/docs/compare/register/plugin-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m
or setup function."
- **Detail.** v2 validates with Effect Schema `Struct({id: String, effect|setup: function})`; `id` is mandatory and
duplicate ids fail (`v2:packages/core/src/plugin/supervisor.ts:108`).
- **Sources.** `v1:packages/plugin/src/index.ts:74` "export type Plugin = (input: PluginInput, options?: PluginOptions) => Promise<Hooks>"; `v2:packages/core/src/plugin/module.ts:60`; `v2:packages/core/src/plugin/module.ts:111`; `v2:packages/plugin/src/promise/plugin.ts:58`; `v2:packages/plugin/src/promise/plugin.ts:60`
- **Sources.** `v1:packages/plugin/src/index.ts:74` "export type Plugin = (input: PluginInput, options?: PluginOptions) => Promise&lt;Hooks&gt;"; `v2:packages/core/src/plugin/module.ts:60`; `v2:packages/core/src/plugin/module.ts:111`; `v2:packages/plugin/src/promise/plugin.ts:58`; `v2:packages/plugin/src/promise/plugin.ts:60`

## PLG-03 v1 legacy loader calls every export of a plugin file

Expand Down Expand Up @@ -176,7 +176,7 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m
- **Effort.** S.
- **Risk.** Low: module-level state (mcpx's `sessions` cache, the chosen daemon) resets on every v2 reload.
- **Detail.** v2's Bun source loader scans imports with `Bun.Transpiler` to decide what to watch.
- **Sources.** `v1:packages/plugin/src/index.ts:223` "dispose?: () => Promise<void>"; `v2:packages/plugin/src/promise/plugin.ts:60`; `v2:packages/core/src/plugin/module.ts:22`; `v2:packages/plugin/src/source.bun.ts:27`
- **Sources.** `v1:packages/plugin/src/index.ts:223` "dispose?: () => Promise&lt;void&gt;"; `v2:packages/plugin/src/promise/plugin.ts:60`; `v2:packages/core/src/plugin/module.ts:22`; `v2:packages/plugin/src/source.bun.ts:27`

## PLG-09 Plugin instance per directory vs per Location

Expand Down Expand Up @@ -296,7 +296,7 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m
- **Detail.** v1 request preparation re-joins extra system entries into one message when a plugin pushes more than one
(`v1:packages/opencode/src/session/llm/request.ts:74`). The v2 analogue is `session.hook("context")`, whose `system` is
`Array<SystemPart>` (`{type: "text", text}`): the shape mcpx pushes, on a different key (PLG-17).
- **Sources.** `v1:packages/plugin/src/index.ts:291`; `v1:packages/opencode/src/session/llm/request.ts:69`; `v1:packages/opencode/src/agent/agent.ts:381`; `plugin/opencode/mcpx-session.ts:745` "const parts = (output as any)?.parts"; `v2:packages/plugin/src/promise/session.ts:28` "system: Array<SystemPart>"
- **Sources.** `v1:packages/plugin/src/index.ts:291`; `v1:packages/opencode/src/session/llm/request.ts:69`; `v1:packages/opencode/src/agent/agent.ts:381`; `plugin/opencode/mcpx-session.ts:745` "const parts = (output as any)?.parts"; `v2:packages/plugin/src/promise/session.ts:28` "system: Array&lt;SystemPart&gt;"

## PLG-17 v2 `session.hook("context")` edits system, messages, tools

Expand Down Expand Up @@ -463,7 +463,7 @@ options: {namespace, codemode, permission, pinned}, description, input, output,
- **Detail.** `docs/opencode-plugin.md:272` lists "a tool with a permission prompt (server plugin, v1 and v2)"; v2's tool
context has no `ask`. v2 plugin tools are gated only by wholly-disabling permission rules on
`options.permission ?? name`.
- **Sources.** `v1:packages/plugin/src/tool.ts:19` "ask(input: AskInput): Promise<void>"; `v1:packages/opencode/src/tool/registry.ts:150`; `v2:packages/schema/src/tool.ts:14`; `v2:packages/core/src/tool.ts:225`; `docs/opencode-plugin.md:272`
- **Sources.** `v1:packages/plugin/src/tool.ts:19` "ask(input: AskInput): Promise&lt;void&gt;"; `v1:packages/opencode/src/tool/registry.ts:150`; `v2:packages/schema/src/tool.ts:14`; `v2:packages/core/src/tool.ts:225`; `docs/opencode-plugin.md:272`

## PLG-29 Toast from a server plugin

Expand Down
21 changes: 21 additions & 0 deletions pkgs/mcpx/docs/compendium.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,27 @@
"role": "not-compendium",
"lines": 197,
"note": "the docs site home page (id: mcpx-home): level-1 site content (#1878), rendered by the generator chosen in #1939 \u2014 not a compendium (level-3) chapter"
},
{
"path": "docs/coverage.md",
"chapter": "maintaining-these-docs",
"role": "chapter-source",
"lines": 213,
"note": "the mechanical coverage proof: the binary's dumped surface set against the book, dimension by dimension (bookwright coverage run, 2026-11-23)"
},
{
"path": "docs/deploying.md",
"chapter": "maintaining-these-docs",
"role": "chapter-source",
"lines": 95,
"note": "how this book is deployed: the repository's single Pages site, the four books it carries, and the build gates (bookwright coverage run, 2026-11-23)"
},
{
"path": "docs/glossary.md",
"chapter": "maintaining-these-docs",
"role": "chapter-source",
"lines": 126,
"note": "the book's vocabulary in one place: reader reference apparatus, kept with the docs-maintenance chapter (bookwright coverage run, 2026-11-23)"
}
]
}
2 changes: 1 addition & 1 deletion pkgs/mcpx/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ skipped launcher phases).
| `script.checkOnError` | enum | `fail` | client | no | `--script-check-on-error` | `MCPX_SCRIPT_CHECK_ON_ERROR` | what to do when script checking finds an error |
| `script.checkOnUnsupported` | enum | `warn` | client | no | `--script-check-on-unsupported` | `MCPX_SCRIPT_CHECK_ON_UNSUPPORTED` | what to do when the selected runtime cannot check the script |
| `script.cwd` | enum | `caller` | client | no | `--script-cwd` | `MCPX_SCRIPT_CWD` | where a script runs: caller, script, config or workdir |
| `script.devshell` | string | `host` | client | no | `--script-devshell` | `MCPX_SCRIPT_DEVSHELL` | environment the script runs inside: host, or flake:<ref> for a Nix flake devshell |
| `script.devshell` | string | `host` | client | no | `--script-devshell` | `MCPX_SCRIPT_DEVSHELL` | environment the script runs inside: host, or `flake:<ref>` for a Nix flake devshell |
| `script.env` | list | *(empty)* | client | no | `--script-env`, `--env` | `MCPX_SCRIPT_ENV` | KEY=VALUE pairs added to the script's environment |
| `script.imports` | enum | `report` | client | no | `--script-imports` | `MCPX_SCRIPT_IMPORTS` | resolve the script's import graph before running it |
| `script.importsCrossProject` | enum | `isolate` | client | no | `--script-imports-cross-project` | `MCPX_SCRIPT_IMPORTS_CROSS_PROJECT` | how to handle a file edge into another project's manifest |
Expand Down
Loading