Title: mcpx docs: level-2 page map, and the configuration, modes and transport pages · Issue #1848 · developing-today/code · GitHub
Open Graph Title: mcpx docs: level-2 page map, and the configuration, modes and transport pages · Issue #1848 · developing-today/code
X Title: mcpx docs: level-2 page map, and the configuration, modes and transport pages · Issue #1848 · developing-today/code
Description: Relocated from dezren39/darwin-nix#146 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/ni...
Open Graph Description: Relocated from dezren39/darwin-nix#146 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue referenc...
X Description: Relocated from dezren39/darwin-nix#146 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue refe...
Opengraph URL: https://github.com/developing-today/code/issues/1848
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcpx docs: level-2 page map, and the configuration, modes and transport pages","articleBody":"Relocated from dezren39/nix#146 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix numbering).\n\nParent: #94\n\n## Summary\n\nLevel 2 is the layer a person reads right after installing mcpx. The notes set its bar: \"basically a more normal set of docs\", and \"new person might assume this is all there is and wont be upset\". So level 2 has to be complete by itself. Every page answers its question in full. A link to the compendium can offer history or a deeper \"why\", but never the rest of the answer.\n\nThis issue does two things:\n\n1. **The page map.** It maps all 30 items the notes list to a page and an anchor, and records for each one the repo material to draw on, the issue that writes it (#146 to #149), and which parts come from the generated reference (#144).\n2. **Content for the first seven items:** common config, server config, client config, env vars, client modes, transport options and server modes.\n\nWhile reading the code for this, I found three places where current docs or behaviour contradict each other. The pages must not copy them (see \"Findings\" below).\n\n## Original notes\n\nSource-notes lines 1, 2, 7 and 49-82. Lines 49-59 are this issue's content, and lines 53-82 as a whole are the page map. The lines in between are quoted in sibling issues.\n\n> - documentation\n> - make a book using whatever is the most common and simple modern choice\n> - 3 main things, not book sections jsut like levels of detail-\n> - the 'ok i just installed this thing what even is it' layer\n> - basically a more normal set of docs\n> - new person might assume this is all there is and wont be upset\n> - a page or section in a page for\n> - common config\n> - server config\n> - client config\n> - env vars\n> - client modes\n> - transport options\n> - server modes\n> - abstract interfaces\n> - client interfaces\n> - cli\n> - cli arguments\n> - cli commands\n> - mcp\n> - mcp sdk\n> - mcp compatibility\n> - binary\n> - script\n> - /v1\n> - /v1 sdk\n> - plugins\n> - plugin compatibility\n> - plugin interface & config\n> - opencode v1 plugin\n> - opencode v2 plugin\n> - vibeMcp\n> - \"so why'd you get rid of all the mcp and then make one, do you like mcp or not\"\n> - \"i mean, opencodemode is right there\"\n> - \"is it safe?\", no.\n> - \"but why would you..\"\n> - \"but can i get some examples?\"\n\n## Current state (what mcpx does today, with file refs)\n\nPaths are relative to `pkgs/mcpx/` on `main` (`d0b7e01`); re-checked at `05c78b2` in the 2026-09-30 issues pass, and drifted line numbers re-cited.\n\n| topic | where it is documented today | shape |\n| --- | --- | --- |\n| sources, precedence, scope, hot, reaching settings | `docs/configuration.md` \"Where a value can come from\", \"Scope: who reads it\", \"Hot\", \"Reaching them\" | prose, good; reusable nearly as-is |\n| every setting | `docs/configuration.md` \"Every setting\" | hand-regenerated table; `internal/settings/docs_test.go` fails on a missing path or `MCPX_*` name |\n| the server block | `internal/config/config.go:24-157`; story.md \"Sharing and scope\", \"Profiles and aliases\", \"Remote servers without a shim\"; `docs/configuration.md` \"Servers\" | no single page describes the whole shape |\n| config file search | `internal/config/config.go:528-590` | only in code. The man page FILES section (`internal/cli/manual.go`, `ManPage`) lists 2 of the 9 locations |\n| client ladder | story.md \"Running without a daemon\", \"One daemon, many clients\"; `docs/exec.md` \"Where a script runs\" | prose |\n| transports | `docs/protocol.md` §5; story.md \"What each transport costs\", \"Server-sent events, not WebSockets\"; `docs/dependencies.md` \"Network\" | spread over four files |\n| mcpx as MCP server | story.md \"mcpx speaks MCP\"; `docs/protocol.md` §2, §5 | prose |\n\nCommands used below that are in `Commands()` (`internal/cli/manual.go`): `config`, `settings`, `servers`, `init`, `ls`, `status`, `daemon`, `daemons`, `stop`, `exec`, `run`, `tui`, `explore`. Two commands this issue has to mention are dispatched (`cmd/mcpx/main.go:119-161`) but missing from `Commands()`: `serve` and `registry`. #147 covers that gap.\n\n### Findings the pages must not copy\n\n1. **The file key is `mcpServers`, not `servers`.** `Config.MCPServers` is `json:\"mcpServers\"` (`config.go:161`). The package comment explains the choice: it is \"the same `mcpServers` object that Claude Desktop, Claude Code, Codex and most other MCP hosts already use\", and mcpx's own options go under a per-server `\"mcpx\"` key that other hosts ignore (`config.go:3-6`). \"servers\" is the name of the CLI command and the `/v1` resource (`mcpx servers`, `/v1/servers`). The page has to show both names and say which one goes where.\n2. **`mcpx init` writes a starter config that does not do what its comments say.** `starterConfig` (`internal/cli/commands.go:1379-1407`) sets `\"mode\": \"shared\"` and `\"mode\": \"session\"` (`:1390`, `:1400`; still true at `05c78b2`). `mode` was split into `sharing` and `scope` (story.md \"Sharing and scope\": \"A single `mode` setting used to answer both questions at once ... They are now separate\"). `Extras` has no `mode` field (`config.go:90-128`), and the loader's `json.Unmarshal` (`config.go:695`) drops unknown fields. So the chrome-devtools entry, which the comment describes as \"One browser per script run, up to 4 at once\", actually gets the defaults `shared`/`global`: one browser shared by everyone. That is the exact failure mcpx exists to prevent. This is a bug outside docs, filed as #159 item 2. It has to be fixed before the quick start (#157) tells anyone to run `mcpx init`. The top-level `mcpx help` text teaches the same dead key in its CONCURRENCY block (`internal/cli/root.go:597-604`, with a `pooled` value that does not exist). The pages must teach `sharing`/`scope` and copy neither.\n3. **The config search path is wider than anything documented.** `SearchPathFrom` (`config.go:542-579`) works like this:\n - If `MCPX_CONFIG` is set, that one file is used and nothing else is read.\n - Otherwise, at each directory from the working directory up to `/`, it checks `.config/mcpx/config.json`, `.mcpx.json`, `.mcpx/config.json` and **`.mcp.json`**.\n - Then it checks `$XDG_CONFIG_HOME/mcpx/config.json`, `~/.config/mcpx/config.json`, `~/.mcpx.json` and `/etc/mcpx/config.json`.\n - Files are merged per server name and the nearest one wins. `\"disabled\": true` drops a server inherited from a farther file. An explicit `--config` is used alone (`config.go:581-590`).\n\n `.mcp.json` is Claude Code's project file, which means mcpx picks up a project's Claude Code servers. That is useful, and nothing says so today. `paths.config` is declared in the registry but nothing reads it (#5).\n\nTwo smaller points the pages have to get right:\n\n- **Environment variables outside the registry.** Many `MCPX_*` names appear in non-test code (`internal`, `cmd`, `plugin`) and not in `docs/configuration.md`. This issue counted roughly 49. #172 counts 44 undeclared of 64 referenced, at `8001f23`, and owns the count and the allowlist (#181 collision 17), so the page uses #172's list. Some are registry aliases (`MCPX_LOG_LEVEL` and `MCPX_STATE_DIR` both appear in `internal/settings/registry.go`). The rest fall into five groups:\n - config selection: `MCPX_CONFIG`, `config.go:549`\n - caller identity: `MCPX_SESSION_ID` and `MCPX_PARENT_SESSION_ID`, set by the plugin at `plugin/opencode/mcpx-session.ts:670,713`\n - names the generated client reads: `MCPX_ENDPOINT`, `MCPX_SESSION`, `MCPX_SOCKET` (`internal/codegen/emit.go:252-268`), `MCPX_CONFIG_PATH` (`:411`), `MCPX_RUNTIME` (`:883`) and others. mcpx sets these for the scripts it runs. `MCPX_SESSION` is the run's session key: `--session`, else the harness's `MCPX_SESSION_ID`, else a fresh key (`internal/cli/commands.go:537-545`). It is derived from `MCPX_SESSION_ID`, not a misspelling of it (#159 item 13, struck).\n - plugin-only options: `MCPX_PLUGIN_DAEMON_TOOLS`, `_HEADLESS` and `MCPX_SOCKET`, in `plugin/opencode/README.md` \"Configuration\". These are allowlisted with reasons in `pluginEnvAllowed` (`internal/settings/consumed_test.go:188-200`). `MCPX_PLUGIN_REMEMBER` and `_ANNOTATE` were in this group until #171 made them the settings `plugin.remember` and `plugin.annotate`.\n - harness context the plugin injects: `MCPX_HARNESS*`, `MCPX_SESSION_*` and `MCPX_OPENCODE_*`\n\n An env-var page generated only from the registry would leave all of these out.\n- **Upstream \"sse\" is not the legacy SSE transport.** `POST /v1/servers` accepts `transport: stdio|http|sse` (`internal/api/ops_settings.go:100`). But the pool builds only two things: a stdio transport, or `mcpclient.NewHTTP` (`internal/pool/pool.go:368-380`). `NewHTTP` is Streamable HTTP whose replies may arrive as an SSE stream (`internal/mcpclient/http.go:18-23`, `:144`). I found no client for the deprecated 2024-11-05 HTTP+SSE transport, the one with a separate `GET` stream and an `endpoint` event. So in mcpx, \"SSE\" upstream means the SSE framing inside Streamable HTTP. The transport page must say this, not imply support for SSE-only servers (open question 5).\n\n## Part 1: the page map\n\n### Approaches: page granularity\n\n**Approach A (least recommended): one page per item, 30 pages.** Each item gets a URL of its own for free. But at least a third of the items are one or two paragraphs: \"mcp sdk\", \"/v1 sdk\", \"binary\", \"client config\", \"vibeMcp\", and each FAQ question. The result is a 30-entry sidebar, the same context repeated at the top of every thin page, and a cross-link every time two items touch (client modes vs transport options vs server modes are one topic seen from three sides). The agent twin (#120) inherits 30 tiny `.md` files that an agent has to fetch one by one. It also cuts against lines 50-51: a reader who lands on \"client modes\" alone gets a fragment, not \"a more normal set of docs\".\n\n**Approach B (middle): everything in one long manual page with 30 sections.** In its favour: Ctrl-F finds everything, the agent twin is a single file, and there is nothing to navigate. Against it: config alone is several screens, and the page mixes three audiences (script writers, MCP-host integrators, harness-plugin authors). Every regeneration of an embedded generated table churns one huge file, and a new person facing one enormous page reads it as \"this is a lot\" rather than \"this is all there is\". Most generators produce a single-page print view from a multi-page book for free (mdBook's `print.html`, for example; #117 picks the generator). So B's benefits are best taken as a byproduct of C rather than as the structure.\n\n**Approach C (recommended): about ten grouped pages, each item with a fixed anchor.** Every item keeps a URL of its own (`page#anchor`). Related items share a page so that each page is complete by itself. The print view gives B's benefits for free. Anchors are set explicitly rather than derived from headings, because headings like \"plugin interface & config\" and \"/v1\" slug badly and differently in each generator, and a renamed heading must not break links. Recommended because it is the only option that satisfies lines 50-51 (complete, unintimidating) and still gives the user's list one addressable place per item.\n\n### The map (Approach C)\n\nThe navigation order follows the notes. Open question 3 asks whether task order would be better.\n\n| # | Item (verbatim) | Page `#anchor` | Source material in the repo | Written by | Generated part (#144) |\n| --- | --- | --- | --- | --- | --- |\n| 53 | common config | `configuration#common-config` | `docs/configuration.md` \"Where a value can come from\", \"Scope\", \"Hot\", \"Reaching them\"; `config.go:528-590`; `manual.go` entries `config`, `settings`, `init` | #146 | link to the settings table; no copy |\n| 54 | server config | `configuration#server-config` | `config.go:24-157`; story.md \"Sharing and scope\", \"Profiles and aliases\", \"Remote servers without a shim\"; `docs/configuration.md` \"Servers\"; `manual.go` `servers` | #146 | open: a JSON Schema for the file (`pool.*` rows are generated) |\n| 55 | client config | `configuration#client-config` | `docs/configuration.md` \"Scope: who reads it\"; registry rows with scope `client` and `call` | #146 | the client- and call-scoped settings, filtered from the registry |\n| 56 | env vars | `configuration#env-vars` | `docs/configuration.md` \"variable\" column; the names listed in Findings above | #146 | registry names generated; the others hand-written until declared |\n| 57 | client modes | `modes#client-modes` | story.md \"Running without a daemon\", \"One daemon, many clients\"; `docs/exec.md` \"Where a script runs\"; `AGENTS.md` \"Profiles\" | #146 | - |\n| 58 | transport options | `modes#transport-options` | `docs/protocol.md` §5; story.md \"What each transport costs\", \"Server-sent events, not WebSockets\", \"Lossless reconnection\", \"Remote servers without a shim\"; `docs/dependencies.md` \"Network\" | #146 | - |\n| 59 | server modes | `modes#server-modes` | story.md \"mcpx speaks MCP\", \"Sharing and scope\"; `docs/protocol.md` §5 | #146 | - |\n| 60 | abstract interfaces | `interfaces#abstract-interfaces` | `internal/api/ops*.go`; `docs/parity.md` | #147 | the parity table |\n| 61 | client interfaces | `interfaces#client-interfaces` | `mcpx client`; `internal/codegen`; `plugin/opencode/mcpx/daemon.ts` `DaemonClient` | #147 | - |\n| 62 | cli | `cli#cli` | `AGENTS.md` \"The loop\"; `cmd/mcpx/main.go` | #147 | - |\n| 63 | cli arguments | `cli#cli-arguments` | `cmd/mcpx/main.go:61-104`; `internal/settings/bind.go` | #147 | per-command registry flags |\n| 64 | cli commands | `cli#cli-commands` | `internal/cli/manual.go` `Commands()` | #147 | yes: the whole command table |\n| 65 | mcp | `mcp#mcp` | story.md \"mcpx speaks MCP\"; `docs/protocol.md` §2-§4 | #147 | - |\n| 66 | mcp sdk | `mcp#mcp-sdk` | `docs/dependencies.md`; `go.mod` | #147 | - |\n| 67 | mcp compatibility | `mcp#mcp-compatibility` | `docs/protocol.md` §1, §6; `internal/mcpserver/revisions.go`; `GET /v1/protocol` | #147 | the revision matrix |\n| 68 | binary | `binary#binary` | `docs/dependencies.md`; `package.nix` | #147 | - |\n| 69 | script | `scripts#script` | `AGENTS.md` \"Scripts\", \"Script contract\"; story.md \"The script contract\", \"Named scripts\"; `docs/exec.md` | #147 | - |\n| 70 | /v1 | `http-api#v1` | `GET /v1/openapi.json` (`internal/api/openapi.go`); `docs/parity.md` | #147 | yes: rendered from the OpenAPI document |\n| 71 | /v1 sdk | `http-api#v1-sdk` | `DaemonClient`; `/v1/openapi.json` | #147 | - |\n| 72 | plugins | `plugins#plugins` | `plugin/opencode/README.md`; #80 | #148 | - |\n| 73 | plugin compatibility | `plugins#plugin-compatibility` | `docs/opencode-plugin.md` §1, §5; #48 | #148 | - |\n| 74 | plugin interface & config | `plugins#plugin-interface-and-config` | `plugin/opencode/README.md` \"Configuration\"; `docs/plugin-discovery.md`; `plugin.*` registry rows | #148 | `plugin.*` rows |\n| 75 | opencode v1 plugin | `plugins#opencode-v1-plugin` | `plugin/opencode/README.md`; `docs/opencode-plugin.md` §2, §3, §6 | #148 | - |\n| 76 | opencode v2 plugin | `plugins#opencode-v2-plugin` | `docs/opencode-plugin.md` §4; #47 | #148 | - |\n| 77 | vibeMcp | `plugins#vibemcp` (provisional; moves once its meaning is known) | nothing in the repo | #148 | - |\n| 78 | \"so why'd you get rid of all the mcp and then make one, do you like mcp or not\" | `faq#do-you-like-mcp` | story.md \"# Summary\", \"mcpx speaks MCP\" | #149 | - |\n| 79 | \"i mean, opencodemode is right there\" | `faq#opencode-code-mode` | `OPENCODE-V2.md` (with its 2026-09-29 corrections); `docs/opencode-plugin.md` §1 | #149 | - |\n| 80 | \"is it safe?\", no. | `faq#is-it-safe` | `AGENTS.md` \"Scripts\"; `internal/runner/runner.go:41-66` | #149 | - |\n| 81 | \"but why would you..\" | `faq#why` | `ASSESSMENT.md`; story.md opening walk | #149 | - |\n| 82 | \"but can i get some examples?\" | `faq#examples` | story.md walk; `mcpx recipes`; `.mcpx/scripts/`; `Examples` fields in `manual.go` | #149 | per-command examples |\n\nTotals: 10 pages and 30 anchors. `configuration` 4, `modes` 3, `interfaces` 2, `cli` 3, `mcp` 3, `binary` 1, `scripts` 1, `http-api` 2, `plugins` 6, `faq` 5. #148 may split `plugins` into an index plus an `opencode` page. The anchors stay the same either way.\n\n**Rule for generated content at level 2.** When a page needs reference data, such as the client-scoped settings on `configuration#client-config`, it embeds the relevant slice generated from the same source instead of just linking to the full reference. Linking would break \"this is all there is\". Embedding means #144 has to support filtered embeds (for example \"settings where scope = client\"), not only whole pages.\n\n## Part 2: content for the seven pages\n\n### `configuration#common-config`\n\n- **Where config lives.** List the search path from Finding 3 exactly, in order, including `.mcp.json` and `MCPX_CONFIG`. Show `mcpx config --path` (the nearest file), `--sources` (every file that contributed and which server each defined), `--defaults` (the built-in layer from `internal/defaults/defaults.json`) and `--schema [--plumbing]` (every setting with its flag and variable).\n- **Format.** JSONC, with comments allowed (`config.StripJSONC`). The top level holds `mcpServers`, the `pool` defaults block, and any registry setting at its dotted path. Open question 4 covers the top-level `runtime`/`permissions` keys.\n- **Precedence.** default \u003c file (nearest wins) \u003c env \u003c flag \u003c runtime (`docs/configuration.md` \"Where a value can come from\"). `mcpx settings get \u003cpath>` shows the winning value and what it displaced, which answers \"why is this not what my config says\".\n- **Scope and hot.** One paragraph each, reused from `docs/configuration.md`. Use the example that motivated scopes: a flag given to a command, for something the already-running daemon reads, used to be silently ignored.\n- **Changing settings.** `mcpx settings list|get|set|unset [--persist runtime|project|user]`, `mcpx settings list --daemon`, and the matching `/v1/settings` and `mcpx_settings_*` rows (the \"Reaching them\" table).\n- **Starting.** `mcpx init [--global]` writes `.mcpx.json` or `~/.config/mcpx/config.json`, but only once Finding 2 is fixed. Until then, the page shows a hand-written starter.\n- **`paths.config`.** Until #5 lands, the page states that the search path is fixed and that `MCPX_CONFIG` and `--config` are the only overrides. It must not advertise `paths.config`, `--paths-config` or `MCPX_PATHS_CONFIG`. `docs/configuration.md:336` lists them, and the settings guard's allowlist claims `MCPX_PATHS_CONFIG` is read, but nothing reads it (#159 item 19).\n\n### `configuration#server-config`\n\n- **Shape of one entry**, from `config.go:91-157`:\n - Stdio servers: `command`, `args`, `env`, `cwd`.\n - Remote servers: `url`, `transport`, `headers`.\n - Any server: `auth`, `protocol` (`legacy` | `modern` | `force-legacy` | `force-modern`), `aliasOf`.\n - The `mcpx` block: `sharing`, `scope`, `max`, `min`, `idleTimeout`, `callTimeout`, `startTimeout`, `namespace`, `disabled`, `logging`, `prelude`, `profiles`, `default`, `description`, `tools`, `excludeTools`.\n - Each entry needs one of `command`, `url` or `aliasOf` (`config.go:703-705`). A `url` with no `transport` means `http` (`:706-708`).\n- **The top-level `pool` block** sets defaults for every server's `mcpx` block. It uses the same names as the `pool.*` settings (`config.go:163-167`).\n- **Sharing × scope.** Two independent axes. Include the story.md table: `shared`/`exclusive`, and `global`/`repo`/`worktree`/`cwd`/`session`/`parent-session`/`pid`/`call`. Include the degrade rule: `session` without an id falls back to per-call isolation and logs once. Give a stateful and a stateless worked example; the chrome-devtools one from story.md is right, the one from `mcpx init` is not.\n- **Profiles and aliases**, including how the profile selection also limits the generated client.\n- **Adding servers live.** `mcpx servers add|remove|list`, and `mcpx registry add` (dispatched but not in `Commands()`; see #147). The same operations exist as `/v1/servers` and `mcpx_servers_*`. `daemon.watchConfig` reloads after hand edits within `daemon.reapInterval`. Servers whose definition did not change keep their process.\n- **Compatibility.** An existing `mcpServers` object pastes in unchanged, and other hosts ignore the `mcpx` key. The page also says that `.mcp.json` is picked up.\n- **Naming.** The namespace is the server name with non-identifier characters replaced (`fancy-name` becomes `fancy_name`, per `AGENTS.md`), unless `mcpx.namespace` overrides it.\n- **Not servers (yet).** `paths.adapters` and `paths.apis` produce MCP tools, not namespaces (#102, #83). The page links them but does not present them as a kind of server.\n\n### `configuration#client-config`\n\nThis interprets \"client config\" as the settings read by the process you run: the CLI and the scripts it launches (scope `client`), plus the per-request `call` scope. The page covers:\n\n- `daemon.endpoint`, `daemon.autostart`, `daemon.inline`, `autostart.*`, `output.*`, `logging.format`, `script.*`, `paths.*`, `http.requestTimeout`, `registry.*`, `doctor.timeout`, `events.reconnect`. This list is a generated embed.\n- How call-scoped settings travel with each request in `X-Mcpx-Settings`, and why only call-scoped ones are honoured from that header.\n- Why `mcpx settings list` (which is what the client resolves) and `mcpx settings list --daemon` can legitimately differ.\n\nA second reading, \"how to configure an MCP client (a host) to use mcpx\", belongs in `modes#server-modes`, with a one-line pointer from here (open question 2).\n\n### `configuration#env-vars`\n\n**Approaches.**\n\n- **A (least): a hand-written list.** It drifts. The 44 unlisted names #172 found show that it already has.\n- **B (middle): generate the registry part, hand-write the rest.** Complete today, but nothing stops a new unlisted name tomorrow.\n- **C (recommended): declare every externally meaningful non-setting variable once** (identity, script-facing, plugin-only, harness context), next to the registry, with a test that fails on any `MCPX_[A-Z_]+` literal in non-test code that is neither a setting nor declared. The whole page is then generated. This follows the pattern `docs/configuration.md` already describes for the plugin (\"a test pins them\"; since #171 that is `TestThePluginReadsNoUndeclaredSetting` plus `pluginEnvAllowed`). #172 owns the declaration and its test (#181 collision 17), and #144/#145 generate the page from it. This issue only needs the page to be complete.\n\nThe page groups variables by who sets them: you (settings), the host or harness (identity and context), and mcpx for your script (endpoint, runtime). It publishes derived names as they are, for example `MCPX_DAEMON_LEASE_T_T_L` (`docs/configuration.md:216`), unless #144 adds explicit names.\n\n### `modes#client-modes`\n\nThis is an interpretation, flagged as such (open question 1). \"Client mode\" is read as how a command reaches the servers. That is a ladder, which story.md \"Running without a daemon\" states:\n\n| rung | how | set by | notes |\n| --- | --- | --- | --- |\n| 1. socket | an existing local daemon | default | 0.17 ms per request with keep-alive |\n| 2. url | a named daemon elsewhere | `daemon.endpoint` = `http://host:port` or `unix:///path` | stops the ladder: no autostart, no local fallback (\"would silently answer from the wrong machine\") |\n| 3. spawn | start a daemon, then use it | `daemon.autostart` (default true); idles out after `autostart.idleExit` (4h) | about 23 ms, once |\n| 4. inline | servers inside this process | `daemon.inline` (default false) | nothing is kept warm; a browser dies with the command. Include the lifetime table from story.md |\n\nSettings that apply across every rung:\n\n- **Where a script runs:** `exec.where` = `auto|local|remote`, also `--local`/`--remote` (`docs/exec.md` \"Where a script runs\"). `--local` against a remote daemon is refused.\n- **Which servers are visible:** `--profile`, `--skip-default`, `--all-profiles`.\n- **Output shape:** `--json`, and `exec.output` = `text|structured|stream`.\n- **Interactive vs scripted:** `mcpx tui`, `mcpx explore`, and bare `mcpx`, which opens the TUI when there is a terminal and prints help otherwise (`cmd/mcpx/main.go:107-116`).\n\nSupervision: `mcpx daemon [--detached]` runs the daemon in the foreground. Installing it as a service is `status: proposed` in story.md \"Service installation\", and the page must say so.\n\n### `modes#transport-options`\n\nOne table for each direction, because \"transport\" means different things on the two sides of mcpx.\n\n**Upstream (mcpx talking to MCP servers):**\n\n| transport | config | notes |\n| --- | --- | --- |\n| stdio | `command` | the default |\n| Streamable HTTP | `url` (+ `transport: http`) | reply bodies may be SSE streams; `Mcp-Session-Id` is tracked and released with `DELETE` (story.md \"Remote servers without a shim\") |\n| legacy HTTP+SSE | none | not implemented (Findings); open question 5 |\n| protocol era | `protocol` | `docs/protocol.md` §1 |\n| OAuth | none | not performed (`docs/protocol.md` §6) |\n\n**Downstream (clients talking to mcpx):**\n\n| transport | who uses it | where | cost / notes |\n| --- | --- | --- | --- |\n| unix socket | CLI, plugin | state directory, mode 0600 | 0.17 ms keep-alive |\n| TCP loopback | generated script clients (`fetch` over a unix socket is not portable across the three runtimes) | `127.0.0.1`, ephemeral port, or `daemon.port` | 0.65 ms keep-alive |\n| TCP beyond loopback | remote clients via `daemon.endpoint` | `daemon.address` + `daemon.port` | the API is unauthenticated and a warning is printed once |\n| HTTP `/v1/*` | everything | every listener above | #147 |\n| MCP Streamable HTTP `/mcp` | MCP hosts | every listener above; `proto.mcpPath`, `proto.serveMCP` | no extra listener, by design (`docs/protocol.md` §5 \"Why not an extra listener\") |\n| MCP stdio | hosts that spawn their servers | `mcpx serve --transport stdio` (not in `Commands()`; #147) | `--transport http` was removed and fails naming `/mcp` instead (`internal/cli/serve.go:360-376`) |\n| SSE `GET /v1/events` | plugin, TUI, scripts, curl | every listener | `Last-Event-ID` / `?since=N`; `gap` events; SSE rather than WebSockets |\n| MCP `subscriptions/listen` | MCP clients | `/mcp` | only the four notification kinds the spec defines |\n\nInclude the spawn-versus-socket numbers and one sentence of why (story.md \"What each transport costs\"). State plainly that there is no tailnet-specific feature: remote access is `daemon.address` + `daemon.port` on the daemon and `daemon.endpoint` on clients.\n\n### `modes#server-modes`\n\n\"Server\" has three meanings in mcpx. Each subsection opens by saying which one it means.\n\n1. **mcpx as an MCP server.** There are two ways in:\n - The daemon's `/mcp`: Streamable HTTP, shares the daemon's pooled servers and lifetime, and is disabled with `proto.serveMCP=false`.\n - `mcpx serve --transport stdio`: a thin shim for hosts that can only spawn a process.\n\n Cover what the host sees: a deliberately small tool surface with `mcpx_exec` as the tool that matters (story.md \"mcpx speaks MCP\"), plus one generated `mcpx_\u003coperation>` tool per `/v1` operation (`docs/parity.md`). Include a copy-paste `mcpServers` snippet for putting mcpx into another host. That snippet is the second reading of \"client config\".\n2. **Modes of an upstream server.** Sharing and scope, `min`/`max`, and the idle timeout. How to read them: the SHARING and SCOPE columns in `mcpx ls`, and the KEY column in `mcpx status`.\n3. **Modes of the daemon process.** Autostarted and detached, foreground (`mcpx daemon`), inline, and the idle exits (`autostart.idleExit`, `daemon.idleExit`). Also `mcpx daemons` and `mcpx stop [--all]`, plus a pointer to #78 for state and cache behaviour.\n\n## Open questions\n\n1. **\"client modes\" and \"server modes\".** Is the ladder / three-meanings reading above what was meant? Other possible readings: the plugin's `backend` = `auto|v1|cli` (that is #148's), or human vs agent vs CI usage.\n2. **\"client config\".** Does it mean mcpx's client-scoped settings (drafted above), or configuring an MCP host to use mcpx (drafted under server modes)? Both are covered. Which one owns the anchor?\n3. **Navigation order.** The notes' order puts configuration first. Someone who has just installed mcpx arguably needs `scripts` and `cli` first. Keep the notes' order, or use task order?\n4. **Top-level `runtime` and `permissions`.** `Config` also has top-level `runtime` and `permissions` keys (`config.go:181-184`), and `docs/dependencies.md` teaches \"the `runtime` config key\". The registry names are `script.runtime` and `script.permissions`, with flag aliases `--runtime` and `--permissions` (`registry.go:175-189`). Which spelling do the docs teach, and are the top-level keys legacy?\n5. **Legacy SSE servers.** Does `transport: \"sse\"` work against an HTTP+SSE-only (2024-11-05) server? If not, should the enum reject it, or should mcpx implement the legacy transport? The page states whichever is true.\n6. **The starter config (Finding 2).** Fixed where, and by whom? The quick start depends on it.\n7. **Filtered embeds.** Can #144 provide filtered generated embeds (settings by scope, by prefix)? The \"level 2 is complete\" rule depends on it.\n\nDocs checks run in CI; see the testing trackers under #91 (CI pipeline #95, integration/environments #97).\n\n## Ease · Impact · Related\n\n**Ease** M (page map S; seven page drafts M) · **Impact** high: this is the backbone of level 2, and three of the pages correct things current docs get wrong · **Depends on / related:** #94, #5, #78, #83, #102, #88, #147, #148, #149, #144, #117, #120, #157, #152, #159 (Findings 2 and the env-var and `paths.config` points are filed there), #172 (owns the `MCPX_*` allowlist the env-var page is generated from)\n\nSecurity/auth deferred; see tracker.\n\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-28T22:02:20Z","url":"https://github.com/developing-today/code/issues/1848"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4c25e2a3-7a86-b618-5719-c422def74dc4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A500:14227A:2BFBF2:3B584A:6B0616E9 |
| html-safe-nonce | e12963decb8e8deb381acc1ce54e0421ef3b41e10430a056463c08db9ce14dc4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTAwOjE0MjI3QToyQkZCRjI6M0I1ODRBOjZCMDYxNkU5IiwidmlzaXRvcl9pZCI6IjE3ODU0MDg1NDgwMDkwMjMyMDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 841809439daa02be8cf4ec097c6c0040ea220fc7fa5cb9a1c330ba32443d83a3 |
| hovercard-subject-tag | issue:6088299343 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/1848/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b7e62b06e23fb0da884f946f3ab4f46738813fdc93fcc7ca5f08541a445d4d72/developing-today/code/issues/1848 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b7e62b06e23fb0da884f946f3ab4f46738813fdc93fcc7ca5f08541a445d4d72/developing-today/code/issues/1848 |
| og:image:alt | Relocated from dezren39/darwin-nix#146 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue referenc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width