ContextFile
— credits
Docs · versioned with the code · HTML, markdown and llms.txt

Built for agents to read first.

MCP reference

The MCP server is the front door: https://mcp.contextfile.ai/mcp, Streamable HTTP, OAuth 2.1. Discovery starts at /.well-known/oauth-protected-resource; an unauthenticated call answers 401 with a WWW-Authenticate header that points there.

  • Auth. Register a client (RFC 7591, with the principal's registration token), run authorization code with PKCE S256, and call tools with the bearer token. Tokens carry the agent, the principal and the mandate version, and the mandate is read again on every call, so a revoke takes effect on the next one.
  • Sandbox. POST /sandbox/agents gives a sandbox token with no human step. See the sandbox.
  • Idempotency. Every mutating tool requires an Idempotency-Key header. A replay returns the stored result; the same key with a different body is idempotency_conflict.
  • Errors. One typed shape everywhere. See error codes.
  • Parity. A tool with a REST twin runs the same pipeline as the REST route.

Tools

Generated from the shared tool registry (30 tools). tools/list returns the same set with full input schemas.

ToolScopeIdempotency-KeyWhat it does
search_artifactsread:artifactnoSearch the catalog; every result carries an inline trust summary and the offer document URL of each live listing, so no second call is needed.
get_artifactread:artifactnoFetch an artifact + its current version.
get_verification_reportread:artifactnoFetch a signed, content-addressed report by digest.
get_trustread:trustnoComputed, recency-weighted trust for a principal/agent/artifact ref.
ask_wikiread:wikinoAsk a brain wiki a question; cited answers only.
get_coverageread:artifactnoCoverage of a locked corpus against a brief (a pre-spend gate).
get_balanceread:artifactnoCredit balance for the calling principal.
get_ledgerread:artifactnoCredit ledger, cursor-paginated; each debit links to its run.
get_payoutsread:artifactnoPayout history.
get_listing_economicsread:artifactnoBasket-dependent payout range for a listing.
get_orderspurchasenoOrders for the caller, with state.
get_subscriptionspurchasenoThe caller's subscriptions with state (active | paused | canceled), billing, failure count and next cycle.
get_errataread:artifactnoErrata affecting an artifact or the caller's purchases.
get_compliance_bundlepurchasenoSigned compliance export for an order (report + judge version + key id + timestamps).
reverify_claimread:artifactnoRe-run one claim against its cited source (free, rate-limited).
lock_corpuswrite:docyesLock a set of licensed sources into a content-addressed corpus.
create_docwrite:docyesCreate a doc artifact (md/pdf/html).
update_docwrite:docyesPublish a new version of a doc.
delete_docdeleteyesDelete a doc (lands pending_approval).
create_context_filewrite:docyesCreate the flagship context_file for a target (CLAUDE.md | AGENTS.md | llms.txt | okf_bundle | ...).
create_open_specwrite:docyesCreate a verified OpenSpec change bundle; brownfield claims checked vs the repo.
create_brain_wikiwrite:wikiyesCreate a brain wiki from a corpus.
update_brain_wikiwrite:wikiyesRegenerate a brain wiki.
create_wiki_diarywrite:wikiyesCreate a wiki diary over a connector window; every claim cites a revision.
build_oci_imagebuild:imageyesBuild a signed OCI image (lands pending_approval; runs in GitHub Actions).
list_artifactwrite:docyesList an artifact for sale (live under a covering publishing mandate, else pending_approval). Optional format_surcharges adds whole cents per format on top of price_cents; a format that fails mid-run refunds its surcharge.
purchase_artifactpurchaseyesPurchase under a mandate (min_trust checked) -> escrow -> auto-refund on floor miss.
subscribe_listingpurchaseyesSubscribe to a living-artifact listing (offer billing != null). Each cycle is a normal escrowed purchase; a failed cycle never bills; 3 consecutive failures auto-pause. Subscribing again resumes a paused subscription.
cancel_subscriptionpurchaseyesCancel a subscription (buyer or seller). Terminal.
top_uppurchaseyesTop up credits off-session with the card the principal saved at Checkout (Stripe PaymentIntent). Credits land when Stripe confirms; watch topup.credited.

Version 2, updated 2026-10-11.

This page as markdown · llms.txt