Skip to content

mcpx docs: an agent-markdown twin of every page, and the bot home page carries the install prompt #1947

Open

Description

@dezren39

Relocated from dezren39/darwin-nix#120 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).

Parent: #90

Summary

Every page of the docs site gets a machine-readable twin written for agents. On top of that, the site publishes llms.txt and llms-full.txt. The agent twin of the home page carries a one-shot install prompt: a procedure an agent can execute to install mcpx, verify it, and wire it into the harness it is running in. The same agent docs should also ship inside the binary, so an offline agent gets docs that match its version.

Original notes

  • documentation
    • make a book using whatever is the most common and simple modern choice
      • specialized agent markdown all pages
        • home page has install prompt built into the bot version

Current state

The conventions (llms.txt v2)

Fetched from llmstxt.org (v2, modified 2026-08-10):

  • /llms.txt is markdown in a fixed order:

    1. an H1 with the project name (the only required part);
    2. a blockquote summary;
    3. optional non-heading prose;
    4. H2 sections that are "file lists" of [name](url): notes.

    An ## Optional section by convention holds links an agent can skip. The file may sit at any path and covers the pages under it, e.g. /docs/llms.txt.

  • A clean markdown version of each page at the same URL, with .md appended (page.html.md) or replacing the extension (page.md). URLs without a file name use index.html.md / index.md.

  • Discovery: <link rel="alternate" type="text/markdown" href="...md"> in each page, and rel="describedby" pointing at the llms.txt that covers the page. These can also be sent as an HTTP Link: header, but GitHub Pages cannot set headers, so we use HTML <link> elements only.

  • llms-full.txt is not in the spec. It is a widely used convention: every page concatenated, used by Starlight, Docusaurus and Mintlify plugins.

  • No content negotiation. GitHub Pages is static: it cannot answer Accept: text/markdown with the markdown twin at the same URL, and it cannot set Link: headers. Agents have to be pointed at .md URLs explicitly (in llms.txt, the <link> element and the home page). Say so on the site, so nobody expects negotiation to work.

Caveat: Zensical's own analysis (ZAP 009) notes limited evidence that vendors' agents consume llms.txt. The per-page .md twin and the embedded docs are the parts that pay off regardless. llms.txt is cheap once the twin exists.

What "specialized" means

A raw copy of the markdown source is not enough. An agent page should:

  • Drop decoration: the video, copy buttons, the rotating prompt, <details> wrappers (expanded instead), badges, theme HTML.
  • Inline what the HTML page links or includes: the generated reference (🎨 Palette: Improve accessibility of editor search panel #144), i.e. settings, flags and env vars, command usage, as plain markdown tables or text, with {{#include}} and shortcodes already resolved. Zensical makes the same point: markdown must be an output of the pipeline, not a copy of the source.
  • Carry agent instructions:
    • a short header (what this page is for, what to run next, the one command that answers the page's question: mcpx help <cmd>, mcpx config --schema, mcpx types <ns>);
    • version-matched: "these docs describe mcpx vX.Y. If mcpx --version differs, prefer mcpx help."
  • Be sourced from AGENTS.md where it applies. It already is the agent-facing instruction file, so the site's agent pages for the loop, scripts and results should be derived from it or include it, not rewritten. There should be one agent-facing text, not two that drift.
  • Keep the version history (🎨 Palette: Add ARIA labels and live regions to search panel #150) flattened but present. Agents need "since vX" more than humans do.

The bot home page: the install prompt

/index.md and the top of /llms.txt carry a procedure an agent can execute end to end, written as numbered imperative steps with the exact commands and the checks between them:

  1. Detect OS and architecture, the available package managers (nix, brew, go, ...) and the harness it is running in (opencode, claude code, codex, ...).
  2. Pick the channel from the list in amd host fails at evaluation: no outputHashes for p2panda-core-0.7.1 #158: nix profile / flake, Homebrew, go install, release binary, curl <short> | sh. Prefer one that installs per-user and needs no root. Say which channel was chosen and why.
  3. Install, then verify: mcpx --version, mcpx doctor, and mcpx ls, which must list namespaces or say clearly that none are configured.
  4. Wire the harness plugin for the detected harness: opencode via the plugin files (today a copy; a package once amd host fails at evaluation: no outputHashes for p2panda-core-0.7.1 #158 exists), or others via Update Rust crate anyhow to 1.0.75 #48's adapters or mcpx as an MCP server. Then verify from inside the harness.
  5. Optionally move the user's existing MCP servers behind mcpx. After the agent shows the diff and gets confirmation, it comments out (never deletes) the user's existing MCP server entries in the harness config, so that the servers are reached through mcpx instead of loaded directly. This echoes the home page prompts in 🎨 Palette: Add aria-labels to buttons and inputs #155. Whether mcpx should import them first (mcpx init or registry add) is an open question.
  6. Report what was installed, where, and how to undo it.

The human home page (#155) shows the same prompt behind a copy button. The bot page is the prompt, with nothing around it. Keep a single source for the text so the two cannot drift.

Shipping the agent docs in the binary

An agent with mcpx on PATH but no network, or with a different version than the site, should get docs that match the binary it has.

Prefer a format flag on an existing command over a new command:

  • mcpx help --format markdown (or mcpx man --format markdown|roff) prints the agent version of the command reference, generated from Commands() like the man page.
  • mcpx help agents (or a topic argument) prints the embedded AGENTS.md.

Coordinate with #144: the markdown emitter that feeds the site's reference pages should be the same one behind this flag, so the site's agent pages and the binary's output are byte-identical for the same version. Embedding AGENTS.md costs a few KB, and go:embed is already in use.

Approaches: how the twin is produced

Approach A (least recommended): generator plugin only

Examples: starlight-llms-txt, docusaurus-plugin-llms, mdbook-llms-txt-tools, or Hugo's built-in markdown output format with .RawContent.

  • It is fast to turn on.
  • But these plugins emit the source (or lightly cleaned HTML-to-markdown): shortcodes and includes are raw or dropped, decoration leaks in, there is no agent header, and the output shape changes with the plugin version.
  • It ties the twin to the generator chosen in chore(deps): update rust crate actix-files to v0.6.10 - autoclosed #117, and cannot produce the in-binary docs.

Approach B (middle): a build step emits .md + llms.txt from the same source

  • A small program in this repo reads the book after preprocessing and writes, per page:
    • <page>.md, with decoration stripped, includes resolved and an agent header prepended;
    • llms.txt (ordered like the site navigation, one ## per top-level section, with a one-line note per page taken from its lede);
    • llms-full.txt.
  • The source can be an mdBook preprocessor over the JSON book, as in fluree/db#1340, or a Hugo template.
  • It adds <link rel="alternate" type="text/markdown"> to every HTML page via the theme.
  • The result is deterministic, generator-light and checkable in CI. It still only derives the twin mechanically. Pages that need a different shape for agents (the home page, the install prompt) have no place to live.

Approach C (recommended): B, plus hand-written agent sources where they add value, plus the same emitters in the binary

Why C: it is the only option that gives agents something better than the human page with the chrome removed, and still keeps one source of truth per fact.

Open questions

  1. Where are hand-written agent pages allowed? Only the home page and the loop, or any page? Too many overrides and the twin drifts from the human page.
  2. Size budgets. llms.txt should stay small (a few KB; it is meant to be read whole). llms-full.txt for the whole compendium (docs(id): design plan, research, and n0 relay default #152) could run to megabytes (Fluree's is ~1.9 MB). Should we split it into llms-full.txt (levels 1 and 2) and a separate compendium file, or cap it and list the rest under ## Optional?
  3. Twin URL shape: page.md or page.html.md? Both are allowed by the spec. page.md is shorter; page.html.md never collides with a source file.
  4. Should the install prompt be versioned (pinned to the release it was published with), or always install latest?
  5. Which harnesses does the prompt cover at first: only opencode, or all of Update Rust crate anyhow to 1.0.75 #48's list?

Ease · Impact · Related

Ease M (B is S once #117 is chosen; the install prompt and the in-binary docs make it M) · Impact high (agents are a primary audience of mcpx) · Depends on / related: #117, #118, #155, #158, #144, #145, #150, #152, #44 (closed, fixed in #53), #48, #49

Security/auth deferred; see tracker.

Activity

  1. developing-today commented on Oct 28, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    History carried over from dezren39/darwin-nix#120 (verbatim, oldest first):


    @dezren39 · 2026-09-30T07:20:18Z

    Integration pass. Placed in the DAG rooted at #181.


    @dezren39 · 2026-09-30T11:49:09Z

    Issues pass (2026-09-30, at 05c78b2).

  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 29, 2026
  4. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  5. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    Triage verdict — not a duplicate; split: in-binary half unblocked and enqueued, site-twin half waits on #1941

    Dedupe: no existing code issue covers the agent-twin or in-binary docs. #1941 (build the site in CI, deploy to GitHub Pages) and #1903 (generated reference that cannot drift) are dependencies this issue coordinates with, not duplicates; the docs layer trackers (#1894/#1898/#1848) do not include per-page agent twins or llms.txt.

    Scope check against current pkgs/mcpx main (2026-10-29, via GitHub API):

    • No site pipeline exists in the repo yet and mcpx docs: build the site in CI and deploy to GitHub Pages #1941 is still open: pkgs/mcpx/docs is plain markdown, there is no generator config, and no llms.txt / twin machinery anywhere in pkgs/mcpx (llms appears only as mentions in docs/spec/requirements.md and docs/proposals.md). The per-page twin, llms.txt/llms-full.txt, discovery <link> elements and the bot home page / install prompt all attach to that site and cannot start before it.
    • The in-binary half is independent and untouched: AGENTS.md is not embedded (the only go:embed is internal/defaults/defaults.json), package.nix does not install it, and there is no mcpx help agents / docs topic (0 code hits).

    Follow-up enqueued: queue task 3244 (small_fix) — embed AGENTS.md via go:embed and print it verbatim via mcpx help agents, with a byte-identity test. The issue's mcpx help --format markdown emitter stays here too: it must be the same emitter as the generated-reference work (#144/#145 line), so it belongs with that coordination, not in 3244.

    Remainder on this issue: site twins + llms.txt + install prompt, gated on #1941; open questions (override allowance, size budgets, twin URL shape, prompt versioning, harness coverage) are Drew-facing design choices to settle when the site lands — not blocking 3244.

    Verification for the follow-up: pkgs/mcpx: go test ./... via CI on its PR.

  6. added
    queue/queuedHas a queued task in the Supabase agent queue
    and removed
    queue/claimedQueue worker lifecycle state
    on Oct 29, 2026
  7. 31 remaining items

  8. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 30 (priority/none). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

  9. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  10. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  11. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · blocked — packet defect (task 8023, lane code-h)

    • Agent: queue worker (repo-worker-code), lane code-h
    • Session / ID: task 8023 (attempt 1, direct lane)
    • Found via: queue claim — revalidation at current main 1c1aa4a79

    What has already landed (verified):

    • In-binary agent docs — the issue's "docs ship inside the binary" requirement: pkgs/mcpx/agentdocs.go embeds AGENTS.md (//go:embed AGENTS.md), and mcpx help agents prints it byte-identically (internal/cli/root.go:751-753, internal/cli/manual.go:555). An offline agent with the binary now gets version-matched agent docs.
    • A docs book now exists to twin from: pkgs/mcpx/book.toml + pkgs/mcpx/docs/ (SUMMARY.md and chapters), built by docs.nix.

    What remains — and why this packet is blocked as packet_defect:
    The rest of issue #1947 is the site-side pipeline the issue itself scopes as Approach B/C (its recommended Approach C): a build emitter producing a specialized .md twin per page, llms.txt, llms-full.txt, <link rel="alternate"> wiring, the hand-written bot home page / install prompt, and CI twin-currency checks. The issue rates it Ease M and leaves five open questions undecided (where agent overrides are allowed; llms-full size budgets/splitting; twin URL shape page.md vs page.html.md; install-prompt versioning; first harness coverage). pkgs/mcpx/docs/install.md:25 still lists the agent prompt / llms.txt URL as "Not yet".

    A small_fix packet ("work issue #1947 per its body", 45-minute timebox) cannot implement an undecided design of that size without inventing the answers to those five questions. Blocking task 8023 as packet_defect so it is re-packeted properly: either (a) a design/triage task that decides the five open questions, then slice packets (emitter → twins+llms.txt; install-prompt page; CI checks), or (b) a single larger fix packet that records the decisions in its scope. The verified-landed state above means any successor starts from the twins/llms.txt work only — the in-binary part must not be re-implemented.

  12. added
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 3, 2026
  13. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  14. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    Triage findings — task 7809, issue #1947

    Verdict: still live and partially done. The in-binary half is half-landed; the site half has not started.

    Verified fresh this run (2026-11-03):

    Next concrete actions: task 8023 for the format flag; a design pass on this issue's five open questions before the site-twin build is enqueued.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

queue/blockedQueue or user escalation statesource/creatorFiled by the new-issue-creator jobstatus/blockedQueue or user escalation statetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions