MCP Server

Kleisli.IO's documentation site exposes a Model Context Protocol (MCP) server so AI agents can search and fetch documentation programmatically. This page describes the server, its tools and resources, and how to connect.

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

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

Three tools, all read-only.

search_docs(query: string)

Search documentation across all projects. Returns matching pages with titles and relevance scores.

get_page(project: string, section: string, page: string)

Fetch a single documentation page as raw Markdown — the same content the HTML renderer consumes, no scraping required.

list_projects()

List all documentation projects with their descriptions.

Resources

Documentation pages are also exposed as MCP resources under the docs://kleisli/ URI scheme:

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"}'

Discovery surface

The MCP server is one of several AI-discovery affordances on docs.kleisli.io: