Skip to main content
The Narrative MCP Server for Agents is a remote Model Context Protocol (MCP) server that lets AI agents like Claude explore datasets, kick off queries, refresh materialized views, and manage your Narrative account — all from a single conversation. Instead of switching between a chat window and the Narrative UI, you tell the agent what you need and it operates the platform on your behalf.

What is MCP?

MCP is an open protocol that standardizes how AI applications connect to external tools and data sources. It defines a universal interface so that any MCP-compatible AI client — Claude Code, Claude Desktop, Cursor, Windsurf, and others — can discover and call tools exposed by an MCP server. The protocol handles:
  • Tool discovery. The client asks the server what tools are available and receives their names, descriptions, and parameter schemas.
  • Authentication. OAuth-based flows let the server verify your identity without you sharing API keys with the AI client.
  • Tool execution. The client calls a tool on your behalf, and the server returns structured results that the AI can reason about.

Why use an AI assistant with Narrative?

Working with data collaboration platforms often involves switching between multiple screens — searching for datasets, inspecting schemas, writing queries, monitoring jobs. An AI assistant connected via MCP can compress these multi-step workflows into a conversational loop:
  • Explore datasets naturally. Ask “what datasets do I have about mobile identifiers?” instead of navigating through the UI. The assistant searches, describes schemas, and summarizes what it finds.
  • Write and validate NQL iteratively. Describe what you want in plain language, and the assistant drafts NQL, validates it against your schema, and fixes errors before submitting — all without you writing a query from scratch.
  • Operate on datasets without context-switching. Trigger samples, refresh materialized views, and recalculate statistics through conversation. The assistant polls job status and reports when operations complete.
  • Work across companies. If you belong to multiple companies, the assistant can switch context on your behalf, making cross-tenant operations seamless.

How it works

The Narrative MCP server sits between your AI client and the Narrative API:
  1. You connect once. Add the server URL to your AI client’s MCP configuration. The first time the assistant calls a tool, a browser window opens for you to log in with your Narrative credentials.
  2. The assistant discovers tools. On connection, the client fetches the list of available tools — dataset operations, NQL execution, attribute search, and more.
  3. Tools call the Narrative API. When the assistant uses a tool, the MCP server translates the request into the appropriate Narrative API calls, using your authenticated session.
  4. Results flow back as context. The server returns structured responses that the assistant incorporates into the conversation, so it can chain operations (e.g., describe a dataset, then write a query against it).
The server accepts two kinds of bearer credential, so the same endpoint works for interactive and programmatic clients:
  • OAuth login — Interactive MCP clients (Claude Code, Claude Desktop, Cursor, Windsurf) open a browser-based login, and the server exchanges the resulting credential for a scoped Narrative access token. Your session persists across tool calls, so you only log in once per session.
  • Narrative API token — Server-to-server callers and scripted clients can send a long-lived Narrative API token directly in the Authorization: Bearer header, skipping the browser flow. The token’s existing user, company, and permission scope apply. See Connecting to the Narrative MCP Server for setup details.

Available tools

The server organizes its tools into these categories:
CategoryWhat you can do
ContextInspect the current session, list your companies, switch the active company, search companies by name
DatasetsSearch and describe datasets, inspect column statistics, configure stats collection
Dataset operationsRequest samples, refresh materialized views, recalculate statistics
AttributesSearch and describe Rosetta Stone attributes
Access rulesDiscover and inspect the access rules your company owns or has been granted
NQLValidate queries and submit them for execution
JobsSearch and describe jobs to track asynchronous work — NQL runs, samples, materialized-view refreshes
Data planesDiscover available data planes and their compute pools
WorkflowsCreate, trigger, describe, and follow runs of multi-step workflows
See the MCP server reference for the complete tool catalog with parameters and examples.

Other Narrative MCP servers

Narrative publishes a small suite of MCP servers alongside the Data Collaboration server. You can add any of them to your client independently:
ServerURLAuthWhat it does
Data Collaborationhttps://mcp.narrative.io/mcpOAuthQuery datasets, run NQL, manage workflows
Knowledge Basehttps://docs.narrative.io/mcpNoneSearch the Narrative docs and answer questions with citations
Agent Feedbackhttps://narrative.support/mcpNoneSubmit structured product feedback and bug reports from a session
All three are discoverable in the Narrative product under Marketplace > MCP Servers.

Getting started

To connect your AI assistant to Narrative, follow the setup guide for your client:

Connecting to the Narrative MCP Server

Step-by-step setup for Claude Code, Claude Desktop, Cursor, and other MCP clients

Tool Reference

Complete catalog of available tools with parameters and usage patterns