BetterIAM

Use the docs with AI

Connect AI coding assistants to these docs through MCP, or give them the whole site as Markdown with llms.txt.

AI coding assistants write better Better IAM code when they can read the real reference instead of guessing method names. This site offers the same content to tools as it does to people, in three forms: an MCP server your assistant can query, plain-text indexes for one-shot context, and a Markdown version of every page.

Connect an assistant with MCP

The Model Context Protocol lets an assistant call tools while it works. This site serves an MCP endpoint at /api/mcp (Streamable HTTP, no sign-in required, read-only) with five tools:

ToolWhat it does
searchFull-text search over every page, the same index as the search dialog.
list_pagesLists every page with its URL and one-line description.
get_pageReturns one page as Markdown, by URL (for example /docs/guides/authorization/policies).
lookup_api_methodReturns the signature, HTTP route, permission, errors, and behaviour of one server API method, for example groups.addMember.
lookup_exportExplains a function, hook, component, class, or constant a package exports, for example useSession or @better-iam/core evaluatePolicy, with its parameters and every entry point that exports it.
lookup_error_codeExplains an IamError code (for example ACCESS_DENIED): what it means, why it happens, and how to handle it.
claude mcp add --transport http better-iam-docs https://docs.example.com/api/mcp

Replace https://docs.example.com with the address where these docs are served (http://localhost:4000 when you run them locally with pnpm --filter @better-iam/docs dev).

Give a model the whole site

When a tool cannot call MCP, paste or fetch the site as plain text:

URLContentUse it for
/llms.txtAn index: every page's title, URL, and descriptionLetting a model pick which pages to read
/llms-full.txtEvery page as Markdown in one fileLoading everything into a long context window
/docs/<page>.mdOne page as MarkdownQuoting a single page precisely

Any docs URL also returns Markdown when the request asks for it with Accept: text/markdown, so agents that fetch pages get Markdown without special URLs. Each page's Copy Markdown button and Open menu (with shortcuts to open the page in an AI chat) use the same Markdown.

Keep answers accurate

The reference pages, and the MCP lookup tools, are generated from the code (method names, signatures, routes, and error codes) with hand-written explanations on top, so they match the version of Better IAM these docs were built from. When an assistant's answer disagrees with your installed version, trust the TypeScript types in your editor: every server method is typed end to end from the betterIam() instance.

Was this page helpful?

Better IAM is created by Sean Filimon

Last updated

On this page