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.
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:
| Name | What it does |
|---|---|
execute_ocaltql | Runs 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_ocaltql | Checks 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://guide | The same guide as llms.txt. |
ocaltql://verb-reference | Every verb with its syntax, read from the Verb Reference. |
ocaltql://grammar | The 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.
| Setting | Value |
|---|---|
OCALTQL_IDENTITY | Your Ocalt account email |
OCALTQL_API_KEY | Your OcaltQL API key, the same one you use with the API |
Claude Desktop
Open Settings, then Developer, then Edit Config. Add the server to claude_desktop_config.json and restart Claude.
{
"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.
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.
{
"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.
{
"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.
EMIT "hello from OcaltQL"
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.