MCP integration

About 1 min read

folio ships a stdio MCP server so agents (Claude Code, Cursor, Cline, n8n) can call it directly.

One-line install

Add this to your MCP config (e.g. ~/.claude/mcp.json or the project‘s .mcp.json):

{
  "mcpServers": {
    "folio": {
      "command": "npx",
      "args": ["-y", "@foliolang/cli"],
      "env": {
        "DEEPSEEK_API_KEY": "sk-...",
        "ZHIPU_API_KEY": "..."
      }
    }
  }
}

Restart the agent client. All 4 tools are available immediately.

The 4 tools

folio_build

Input:

Field Type Required Description
source string yes markdown source
theme “default” | “academic” | “minimal” no theme
inline boolean no inline every asset into a single HTML file

Returns { html, errors[], warnings[], cost }.

folio_publish

Like folio_build, but publishes to a configured target (cloudflare / github / netlify / s3) and returns the URL.

folio_list_providers

Returns the list of every LLM / image / publish provider currently configured in env. Lets an agent introspect “what can I use?".

folio_extract

The reverse: pulls structured data (titles, section list, tables, charts) out of a generated HTML file. Useful for multi-turn agent workflows.

Typical agent flow

No chat provider configured for lib-mode build

Next