Prerequisites
- A Narrative account with access to at least one company
- An MCP-compatible AI client installed (see supported clients below)
Server URL
All clients connect to the same endpoint:Setup by client
- Claude Code
- Claude Desktop
- Cursor
- Cortex Code
- Windsurf
- Other clients
Run the following command in your terminal:This registers the Narrative MCP server in your Claude Code configuration. The next time Claude calls a Narrative tool, a browser window opens for you to authenticate.To verify the server is registered:You should see
narrative in the output with the server URL.Authenticate
The MCP server accepts two kinds of bearer credential in theAuthorization header:
- OAuth login (interactive clients). A standard OAuth flow exchanges your Narrative login for a scoped session token. This is what Claude Code, Claude Desktop, Cursor, Cortex Code, and Windsurf use by default.
- Narrative API token (programmatic clients). Long-lived API tokens are accepted directly, which lets server-to-server callers and scripted MCP clients connect without a browser-based login.
OAuth (default for interactive clients)
The first time your assistant calls a Narrative tool, the MCP server initiates an OAuth login:- A browser window opens with the Narrative login page.
- Sign in with your Narrative credentials.
- Return to your AI client — the session is now authenticated.
Narrative API token (for programmatic clients)
If your MCP client supports a static bearer token, you can authenticate with a Narrative API key instead of OAuth. Set theAuthorization header on every MCP request:
An OAuth session requires you to select a company before any tool other than the context tools will run. A session authenticated with an API token is locked to that token’s company and skips the step.
Verify the connection
Ask your assistant something like:“Who am I logged in as on Narrative?”The assistant should call
narrative_context_get, which answers with your account, your role, and the company selection:
narrative_context_get reads only the session — it takes no arguments and makes no downstream API calls, so it returns immediately and behaves the same for every role. That makes it the cheapest available proof that the transport, your credential, and your client’s tool loop are all working.
Active company: none set is the expected reply on a fresh OAuth session, including when you belong to exactly one company. Selecting a company is the next step.Select a company
Every tool except the four context tools —narrative_context_get, narrative_context_get_companies, narrative_context_search_companies, and narrative_context_set_company — requires an explicitly selected company. Until you choose one, the rest fail with:
“Switch to Acme Corp on Narrative.”The assistant calls
narrative_context_set_company, and every subsequent tool call in the session operates against that company until you change it.
An OAuth session never pre-selects a company, even for a user who belongs to only one — the choice is always explicit. An API-token session is locked to the token’s company when it connects, so it skips this step.
Troubleshooting
Browser window doesn’t open
Some terminal environments block browser launches. If the OAuth login window doesn’t appear:- Check that your default browser is configured correctly.
- Try opening the server URL directly in a browser to confirm network access:
https://mcp.narrative.io/mcp
Tools not appearing
If your AI client doesn’t show Narrative tools:- Verify the server URL is exactly
https://mcp.narrative.io/mcp(no trailing slash). - Restart your AI client after adding the server configuration.
- Check your client’s MCP logs for connection errors.
”No company selected”
Every tool except the four context tools needs a company chosen for the session. See Select a company. This is expected on a new OAuth session and is not a connection fault.Session expired
If tool calls start failing with authentication errors, your session may have expired. Ask the assistant to retry — the server will prompt you to log in again.What’s next
Data Collaboration MCP Server
Understand how the MCP server works and what it enables
Tool Reference
Browse the complete catalog of available tools
NQL Guide
Learn NQL basics to get more from query tools
Dataset Statistics
Configure column statistics that the MCP server can read and trigger

