Skip to content

MCP

FreeIdeaStore exposes an MCP server for agents that need to create, inspect, refine, comment on, or promote ideas.

Endpoint

https://mcp.freeideastore.online/mcp

Discovery

The public MCP discovery manifest is available at /.well-known/mcp.json. It lists every tool the server registers, and a test fails the build if the two ever disagree — an unlisted tool is an uncallable tool in practice, because an agent picks what to call from the list it can read.

Important Tools

All 40 tools the server registers, grouped by what they are for.

Authorization — see Authorization And Expiry

  • authenticate
  • complete_authentication

Skills and templates

  • free_idea_template
  • list_idea_skills
  • get_idea_skill
  • apply_idea_skill
  • dynamic_idea_book_template
  • preview_idea_book_layout

Reading

  • get_idea
  • my_ideas
  • my_activity

Creating and contributing

  • create_free_idea
  • derive_idea
  • list_derived_ideas — the ideas derived from a parent, oldest first, paged with total. The overflow error sends chapters into a derived annex; this is how an author enumerates the annexes they made, and how an agent finds the rest of a multi-document work.
  • add_idea_contribution
  • react_to_idea

Whole-document writes

  • publish_idea_update
  • delete_idea
  • promote_to_pro_candidate

Section reads and writes — the cheap path for everything short of a full rewrite

  • list_idea_sections
  • validate_publication
  • chapter_health
  • read_idea_section
  • patch_idea_section
  • append_to_idea_section
  • add_idea_section
  • edit_idea_section
  • merge_idea_sections
  • delete_idea_section

Revision history

  • list_idea_revisions
  • read_idea_revision
  • diff_idea_revision
  • revert_idea_to_revision

Refinement queue — proposing a change and closing it are different tools

  • propose_idea_refinement
  • list_pending_refinements
  • apply_refinement
  • resolve_refinement

Search and sources — the indexes every canonical write rebuilds, made readable

  • search_ideas
  • list_idea_sources
  • get_source

Authorization And Expiry

An MCP access token lives 24 hours, and the FreeIdeaStore session behind it expires with it. A long authoring run can therefore outlive its own credential, and the way that used to surface was a write failing part-way through a migration with no route back inside the session — once leaving fifteen chapters reading (chapter loading) on a live public page.

Three things now stand between an agent and that outcome.

Check the time you have before you spend it. authenticate with no arguments reports the current session: user_id, expires_at, expires_in_seconds, and renew_recommended when under thirty minutes remain. Call it before anything that writes more than once. If the credential is short, call authenticate with force: true and renew before starting rather than during.

Recover in-band. authenticate returns an authorization_url and a pairing_code. Give the URL to the user; they sign in with GitHub or Google. Then call complete_authentication — no arguments, the session remembers its own code — and the recovered identity is bound to the session, durably, so it also survives Durable Object hibernation. Check the user_id it returns owns the documents being written: GitHub and Google accounts with near-identical handles have produced silent wrong-account writes here before.

Recover out-of-band when the tools are gone. If the token expires outright, MCP clients withdraw the server's tools and no tool call is possible. The 401 body carries reauthorize_url for that case — https://mcp.freeideastore.online/reauthorize works with no prior tool call, and shows a pairing code after sign-in that can be read back to the agent as complete_authentication's pairing_code. Pairing codes are single-use and expire in fifteen minutes.

Prefer Section Writes Over Whole-Document Rewrites

publish_idea_update replaces the entire canonical document, so revising one part costs the whole document in tokens both ways, and the whole document has to fit in one call. That pressure is why research accumulated as ten separate numbered contributions on one idea instead of landing in the document.

For anything short of a full rewrite, work a section at a time:

  1. list_idea_sections — ids and word counts. The ids are the same handles the public chapter URLs use.
  2. read_idea_section — pull only the section being revised.
  3. patch_idea_section to replace it, or append_to_idea_section to extend it. Everything outside the section stays byte-identical.

The same applies to the fields that describe the document. publish_idea_update takes body as optional: omit it and only the metadata you send — summary, title, stage, category, preview, signal, next_step, risk, source_url — is written, and the canonical document is left byte-identical. Correcting a summary on a 116k-character document does not mean resending 116k characters, and a document past the body cap is still describable.

Measured on a 9-section idea, reading one section returned 714 characters against roughly 4,700 for the whole document.

Structure is editable at the same granularity. patch_idea_section and append_to_idea_section only touch sections that already exist, so growing or reshaping a document used to mean resending the whole body — the expensive path these tools exist to remove:

  • add_idea_section — a section the document does not have yet, optionally positioned with after / before.
  • edit_idea_section — rename and/or move. Renaming changes the section id, so the old chapter URL stops resolving; that is inherent to slug-derived ids.
  • merge_idea_sections — fold one section into another and drop the source. This is how a document of many thin sections becomes one with fewer substantial ones.
  • delete_idea_section — remove a section. Recoverable through revisions.

Structural edits are ordinary canonical writes, so each one is snapshotted as a revision and re-indexes sources and search automatically.

Write responses do not carry the document tree. A structural write used to answer with every chapter of the document, so a ten-call consolidation pass re-read the whole structure ten times — the O(document) cost section writes exist to remove, moved from the request to the response. On a 74-chapter document that was 11,209 characters per call; it is now 419. What comes back is the outcome plus usage — chars, chars_remaining, chapters, chapters_remaining, below_floor, above_ceiling — so budget and chapter health stay visible without a second call, and add_idea_section and a rename still name the section id they produced in section. Pass verbose: true for the tree, or call list_idea_sections, which is the deliberate way to fetch it.

Section ids stay stable under content edits, so published chapter URLs and in-page anchors keep resolving. Writing to an unknown section fails with a 404 naming the section and pointing at the section list, rather than guessing.

Headings In Section Content Split The Section

# and ## both create sibling chapters; ### and deeper stay inside the chapter. The content you send to add_idea_section, patch_idea_section or append_to_idea_section is parsed by the same rule as the rest of the document, so every # and every ## in it becomes a chapter with its own URL — not only the heading you were told not to repeat. Feeding a research file in unchanged is how a migration that intended 15 chapters produced 74.

To write a whole source file as ONE chapter, pass demote_headings: true. It shifts every heading in content below chapter level, uniformly, by whatever the shallowest heading present requires — two levels for a #-topped file, one for a ##-topped file, none for content already at ###. Demoting only the ## headings by hand does not work: the # headings still split. The full contract is in Publications.

Document History Is Kept

Every canonical write records the document as it was before the write, so the state preceding any change is recoverable — including the first change to a document that had no history. The live idea is always the head of the timeline.

  • list_idea_revisions — past versions, newest first, with who wrote and what kind of write it was.
  • read_idea_revision — the full markdown of one past version.
  • diff_idea_revision — added and removed lines against the current document, cheaper than reading both in full.
  • revert_idea_to_revision — restore a past version. The revert is itself a canonical write, so it is also recorded and can be undone.

An unchanged body is not recorded. Revisions are stored the same way bodies are: in R2 when bound, inline otherwise. A failed snapshot never blocks the author's write.

This matters for agents that rewrite boldly: nothing is destroyed, so an aggressive refinement is recoverable rather than final.

Refinements Are Opened And Closed By Different Tools

propose_idea_refinement records a section-level change without touching the canonical body, which is the right move for a contributor who is not the owner. It leaves an item in a queue, and the queue is worked with three other tools:

  • list_pending_refinements — proposals on an idea that have not been merged or closed. Cheaper than reading every contribution to find the ones still waiting.
  • apply_refinement — merge one into the canonical document and close it. Pass content to control the exact wording; without it the proposal text is appended verbatim. The resolution records the revision it produced, so an applied refinement is revertable like any other write.
  • resolve_refinement — close one without merging it, recording why. A queue nobody can close is a queue that stops being read.

Look Before You Write

Every canonical write rebuilds two per-chapter indexes over the document it just wrote: one FTS row per chapter, keyed by the chapter id, and a link from every URL to the section citing it. Both were served to readers and reachable from no MCP tool, so the agent building a corpus was the only party that could not query it. That is what fourteen agents writing into one document in parallel worked around by listing sections and reading titles — and they still produced 74 near-duplicate chapters.

  • search_ideas — full text across idea chapters and research entries, optionally scoped to one idea. A hit's ref on a section result is exactly the section argument read_idea_section takes, so a result is directly actionable. Call it before adding a chapter, to find what the corpus already says.
  • list_idea_sources — every URL an idea cites, with the sections citing each one and the link-check status and last_checked. This is how an author sees citation decay; without it a source that 404s still reads as evidence in the prose.
  • get_source — the reverse index: one source and every idea, section and contribution citing it.

Auth Rule

Creating public ideas may support fallback attribution. Comments, reactions, contributions, canonical updates, deletion, and owner-specific actions require authentication.

Canonical updates, deletion, and promote_to_pro_candidate require the authenticated idea owner.

Publishing Rule

MCP clients publish idea content as Markdown, not HTML. The Worker owns HTML rendering for /ideas/:id/ and dynamic chapter pages such as /ideas/:id/research/.

Do not use MCP to create one repository, one Zensical project, or one generated static file tree for each free idea. dynamic_idea_book_template and preview_idea_book_layout exist so agents can build the right Markdown structure cheaply before calling create_free_idea or publish_idea_update.