AI Assistants & MCP

An AI assistant can write OcaltQL for you and, with your permission, run it on your account. There are two ways to set this up. The first needs nothing installed: give the assistant the OcaltQL guide. The second connects the assistant to your account through the official OcaltQL MCP server, so it can run the scripts it writes and show you the results.

The guide for AI: llms.txt

The page ql.ocalt.com/llms.txt is a short version of this tutorial written for AI assistants. It covers the chaining rules, the nesting rule, the thirty most used verbs and eight worked scripts, each tested against the live API. Paste the link into any assistant and ask it to read the page before it writes OcaltQL. The same file is also served at ql.ocalt.com/llm.txt.

A prompt that works with any assistant
Read https://ql.ocalt.com/llms.txt first. Then write an OcaltQL script that
fetches today's USD to ZAR rate and emits it with two decimal places.

The OcaltQL MCP server

MCP, the Model Context Protocol, is how AI assistants use outside tools. The OcaltQL MCP server gives an assistant two tools and three reference documents:

NameWhat it does
execute_ocaltqlRuns a script on your account and returns everything it emits. A failed script returns its error message, so the assistant can fix the script and try again.
check_ocaltqlChecks a script with the OcaltQL parser without running it, and names the line and the reason when something is wrong. It needs no account and costs nothing, so the assistant checks every script before running it.
ocaltql://guideThe same guide as llms.txt.
ocaltql://verb-referenceEvery verb with its syntax, read from the Verb Reference.
ocaltql://grammarThe complete OcaltQL grammar: every statement form, and for each verb its operand, its modifiers and which of them are required.

The server is a single small file with no dependencies. It needs Node.js 18 or newer on your computer. It reads your account from two settings that you add in the assistant's configuration. Your key stays on your computer and is sent only to ql.ocalt.com.

SettingValue
OCALTQL_IDENTITYYour Ocalt account email
OCALTQL_API_KEYYour OcaltQL API key, the same one you use with the API
The assistant acts as you. A script it runs can do anything your key can do, including deleting files and databases. Most assistants ask before each tool call; keep that setting on, and read a script before you approve it.

Claude Desktop

Open Settings, then Developer, then Edit Config. Add the server to claude_desktop_config.json and restart Claude.

claude_desktop_config.json
{
  "mcpServers": {
    "ocaltql": {
      "command": "npx",
      "args": ["-y", "https://ql.ocalt.com/downloads/ocaltql-mcp-1.1.0.tgz"],
      "env": {
        "OCALTQL_IDENTITY": "you@example.com",
        "OCALTQL_API_KEY": "your_api_key"
      }
    }
  }
}

Claude Code

Run this once in a terminal. The server is then available in every Claude Code session.

Terminal
claude mcp add ocaltql --scope user \
  -e OCALTQL_IDENTITY=you@example.com \
  -e OCALTQL_API_KEY=your_api_key \
  -- npx -y https://ql.ocalt.com/downloads/ocaltql-mcp-1.1.0.tgz

Cursor

Open Cursor Settings and find the MCP section (called Tools & Integrations in recent versions), then add a new MCP server. This opens ~/.cursor/mcp.json. Add the server and save.

~/.cursor/mcp.json
{
  "mcpServers": {
    "ocaltql": {
      "command": "npx",
      "args": ["-y", "https://ql.ocalt.com/downloads/ocaltql-mcp-1.1.0.tgz"],
      "env": {
        "OCALTQL_IDENTITY": "you@example.com",
        "OCALTQL_API_KEY": "your_api_key"
      }
    }
  }
}

Windsurf

Open the Cascade panel, choose the MCPs icon, then Manage MCPs and View raw config. This opens ~/.codeium/windsurf/mcp_config.json. Add the server, save, and press Refresh.

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "ocaltql": {
      "command": "npx",
      "args": ["-y", "https://ql.ocalt.com/downloads/ocaltql-mcp-1.1.0.tgz"],
      "env": {
        "OCALTQL_IDENTITY": "you@example.com",
        "OCALTQL_API_KEY": "your_api_key"
      }
    }
  }
}

Check that it works

Ask the assistant: Use the ocaltql tool to emit "hello from OcaltQL". It should run the script below and show you the text it returns. If it reports that the server has no account set, check the two settings above and restart the assistant.

The first test
EMIT "hello from OcaltQL"
Other assistants. Any assistant that supports MCP servers started by a command can use the same settings: the command is npx, the arguments are -y and the package address, and the two account settings go in its environment. The package is also a direct download if you prefer to install it yourself.

To see what an assistant can build with this, read Prompt to Pipeline.