MCP Server
Connect your AI agent to these docs over the Model Context Protocol (MCP)
and it can search, fetch, and cite every page on this site — across all
projects, not just one. Each search result carries a buildHash identifying
the exact build of the docs it read, so your agent can cite a precise,
reproducible source instead of a vague reference. The server is public,
read-only, and needs no API key.
This page is the full reference: transport, tools, resources, and copy-paste client configs.
What is MCP?
The Model Context Protocol is a JSON-RPC 2.0 based protocol for exposing tools and resources to LLM clients. The Kleisli docs MCP server speaks the Streamable HTTP transport — POST for client-to-server requests, GET for server-initiated SSE, DELETE for session termination.
Connection
- Transport endpoint:
https://docs.kleisli.io/mcp/transport - Protocol: Streamable HTTP per spec 2025-03-26
- Authentication: none (public read-only surface)
To initialize a session, POST a standard MCP initialize request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-03-26",
"capabilities": {},
"clientInfo": {"name": "your-client", "version": "1.0.0"}
}
}The server responds with an Mcp-Session-Id header that subsequent
requests must echo back.
Tools
3 read-only tools. Each links to a detail page with input schema, example JSON-RPC envelope, and applicable error codes.
get_page
Fetch one documentation page as Markdown, given its project, section, and page slugs. Returns the page as a "# {title}" heading, a blank line, then the body; if no page matches those coordinates, returns the text "Page not found: {project}/{section}/{page}". Use search_docs when you don't know a page's coordinates; use list_projects to discover project IDs.
list_projects
Enumerate the published documentation projects (drafts are excluded). Call this first to orient when you don't yet know what documentation exists. Returns a plain-text block listing one project per entry as "{id}: {name}" followed by an indented description line. The returned project IDs are the exact values to pass as the project argument to get_page and search_docs.
search_docs
Find documentation pages by keyword or phrase across all projects — use this when you don't already know the exact project, section, and page. Hybrid lexical ranking (full-text + BM25 + trigram) returns the best-matching pages first, each with a snippet (matched terms wrapped in bold) and per-page metadata. Structured results carry project, section, page, title, score, snippet, stability (stable or unstable), and markdownLink, plus summary, mtime, sha, and buildHash when available. buildHash is the corpus provenance stamp — cite it alongside any claim derived from these results. A plain-text fallback lists the same hits. Use get_page to fetch a page once you know its project, section, and page; use list_projects to enumerate available projects.
Resources
Documentation pages are also exposed as MCP resources under the
docs://kleisli/ URI scheme:
docs://kleisli/{project}/{section}/{page}— individual doc pagesdocs://kleisli/llms.txt— global discovery indexdocs://kleisli/llms-full.txt— full documentation contentdocs://kleisli/{project}/llms.txt— per-project discovery indexdocs://kleisli/{project}/llms-full.txt— per-project full content
Use resources/list to enumerate; resources/read to fetch.
Client configuration
Claude Code
Add to ~/.claude/mcp.json (or your project's .mcp.json):
{
"mcpServers": {
"kleisli-docs": {
"type": "http",
"url": "https://docs.kleisli.io/mcp/transport"
}
}
}Cursor
Add to mcp-server-config.json:
{
"mcpServers": {
"kleisli-docs": {
"url": "https://docs.kleisli.io/mcp/transport"
}
}
}Generic / curl
curl -X POST https://docs.kleisli.io/mcp/transport \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'From the terminal
kli ships a kli docs subcommand that reads the kli docs straight
from the command line — no MCP client required. kli docs search <query>
runs a ranked search and kli docs <path> prints any page as Markdown. It
fetches live from this site, so it always tracks the published docs. See
kli docs for the full reference.
Discovery surface
The MCP server is one of several AI-discovery affordances on docs.kleisli.io:
/llms.txt— curated Markdown index of all documentation/llms-full.txt— full content concatenated for token-efficient ingestion<link rel="alternate" type="text/markdown">and<meta name="ai-content-discovery">on every pageLink: </llms.txt>; rel="llms-txt"andX-Llms-Txt: /llms.txtHTTP headers on every response