anfra docsAlpha
Set up local developmentSet up your coding agent

Cursor

Set up Cursor to build with anfra, and connect it to anfra's MCP server

Cursor's agent can build your whole anfra project: connect your warehouse, write models and datasets, query them and build data apps. It needs two things from anfra: the anfra plugin or skills, which teach it how, and optionally the MCP server, which lets it query a published project on anfra BI Cloud or a running anfra serve.

anfra agent setup doesn't install for Cursor

Unlike Claude Code and Codex, Cursor installs plugins only from its marketplace panel, so anfra agent setup --agent cursor installs nothing. It only prints the steps below.

Set up

Step 1: Install the CLI

The skills drive the anfra binary, so install it first:

curl -fsSL https://anfra.ai/install.sh | bash

Open a new terminal afterwards so anfra is on your PATH. On Windows, install it inside WSL2 and open your projects in Cursor through its WSL connection, so the agent's terminal can run anfra. See Install the CLI for Windows and the installer options.

Step 2: Install the plugin or the skills

Install the plugin if your team can: besides the skills, it brings hooks that validate AML files as the agent edits them and tell the agent when a newer anfra release is out. Cursor's plugin marketplaces are managed per team, on the Teams and Enterprise plans. Without one, install the skills alone.

An admin imports the marketplace once for the team:

  1. In the Cursor dashboard, go to Settings → Plugins.
  2. Under Team Marketplaces, click Import and paste https://github.com/holistics/anfra-skills.
  3. Review the plugins it found, set Team Access groups if needed, name the marketplace and save.

Then each user opens the marketplace panel in Cursor and installs anfra. If the admin marked it as required, it installs automatically. To update it later, use the same panel.

The plugin's aql-writer agent is for Claude Code only.

In an anfra project, run anfra agent setup --agent cursor once anyway: it writes an anfra block into the project's AGENTS.md, which tells the agent to use the skills there. It writes the block even though it reports an error for not installing the skills. anfra init writes the same block.

Step 3: Check the installation

anfra agent setup check

It changes nothing. It reports the plugin or the copies of the skills that Cursor loads, with their version, and whether they are behind the latest release. If the skills are missing, restart Cursor.

Use the skills

The agent picks the right skill for most requests on its own. To be sure, name the skill in your prompt.

Example prompt

Use the anfra-build-data-app skill. Build a revenue overview with a monthly trend and revenue by region. Clicking a region should filter the trend.

To start a new project, open an empty folder in Cursor and ask the agent to use the anfra-setup-repo skill.

Connect to the MCP server

The skills work with the project on disk, through the anfra CLI. Add the MCP server when you want the agent to query data it can't reach that way, such as your organization's published project on anfra BI Cloud. Run it yourself, or connect to anfra BI Cloud, which hosts it for your organization. To compare, see Where your MCP server runs.

Cursor reads MCP servers from ~/.cursor/mcp.json for every project, and from .cursor/mcp.json in a project for that project only. Commit the project file to share the server with your team.

anfra BI Cloud

~/.cursor/mcp.json
{
  "mcpServers": {
    "anfra": { "url": "https://us.anfra.ai/mcp" }
  }
}

Then open Cursor Settings → MCP. anfra shows as needing sign-in: click Connect and sign in in the browser it opens. When you approve the connection, you pick one organization, and the agent acts as you there, with your role.

If sign-in fails with a callback error, your admin may have limited where clients can return after sign-in. Ask them to allow cursor://* under Settings → Organization → MCP → Allowed callbacks. See MCP access.

Your machine or server

To query the project on your machine, run anfra serve and add the address it prints:

.cursor/mcp.json
{
  "mcpServers": {
    "anfra": { "url": "http://127.0.0.1:7878/mcp" }
  }
}

It needs no sign-in. For a self-hosted server behind your own authentication, pass the token in a header. Read it from an environment variable so it stays out of the file:

~/.cursor/mcp.json
{
  "mcpServers": {
    "anfra": {
      "url": "https://data.example.com/mcp",
      "headers": { "Authorization": "Bearer ${env:ANFRA_MCP_TOKEN}" }
    }
  }
}

If you self-host with the anfra-hosting image, see Coding agents with MCP for the header to send.

Check the connection

Open Cursor Settings → MCP. anfra should show as connected, with its tools listed. Then ask the agent a question about your data.

Example prompt

Using the anfra MCP server, list the datasets I can query, then show last month's revenue by region.

See Tools for what the server offers.

On this page