Skip to main content

Introduction

Connect AI assistants to your Guru’s knowledge base using the Model Context Protocol (MCP). Use your Guru directly within Claude Desktop, Claude Code, Cursor, and other MCP-compatible clients. With the MCP integration, you can:
  • Ask questions and get AI-generated answers from your knowledge base
  • Search for relevant documentation without generating an answer
  • Access your Guru’s knowledge directly in your development workflow

Prerequisites

Before setting up the MCP integration, ensure you have:
  • A Guru on Gurubase (either on Gurubase Cloud or self-hosted with Enterprise plan)
  • An API key from API Keys
  • An MCP-compatible client (Claude Desktop, Claude Code, Cursor, etc.)

Getting Your API Key

  1. Go to API Keys
  2. Click “New API Key” to generate a new key
  3. Copy the API key (it starts with gb-)
Store your API key securely. It provides access to your Guru and should not be shared publicly.

MCP Server URL

Your Guru’s MCP server is available at:
https://api.gurubase.io/mcp/{guru_slug}/
Replace {guru_slug} with your Guru’s slug. You can find the slug in your Guru’s URL. For example, if your Guru is at https://app.gurubase.io/g/kubernetes, the slug is kubernetes.
For self-hosted Gurubase (Enterprise plan), use your instance URL: http://localhost:8029/mcp/{guru_slug}/

Client Setup

Replace {guru_slug} with your Guru’s slug and YOUR_API_KEY with your actual API key in the examples below.
In Cursor, go to Settings > MCP Servers and add one of the following configurations:Remote Server Connection
{
  "mcpServers": {
    "gurubase-{guru_slug}": {
      "url": "https://api.gurubase.io/mcp/{guru_slug}/",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
Local Server Connection
{
  "mcpServers": {
    "gurubase-{guru_slug}": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://api.gurubase.io/mcp/{guru_slug}/",
        "--header",
        "Authorization: Bearer YOUR_API_KEY"
      ]
    }
  }
}
Remote Server Connection
claude mcp add --transport http \
  gurubase-{guru_slug} https://api.gurubase.io/mcp/{guru_slug}/ \
  --header "Authorization: Bearer YOUR_API_KEY"
Local Server Connection
claude mcp add gurubase-{guru_slug} -s user -- \
  npx -y mcp-remote "https://api.gurubase.io/mcp/{guru_slug}/" \
  --header "Authorization: Bearer YOUR_API_KEY"
Edit your Claude Desktop configuration file:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
Remote Server Connection
{
  "mcpServers": {
    "gurubase-{guru_slug}": {
      "url": "https://api.gurubase.io/mcp/{guru_slug}/",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
Local Server Connection
{
  "mcpServers": {
    "gurubase-{guru_slug}": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://api.gurubase.io/mcp/{guru_slug}/",
        "--header",
        "Authorization: Bearer YOUR_API_KEY"
      ]
    }
  }
}
macOS users: If Claude Desktop can’t find npx, run which npx in your terminal and add an env section with that directory in the PATH. For example, if npx is at /opt/homebrew/opt/node@20/bin/npx, add:
"env": {
  "PATH": "/opt/homebrew/opt/node@20/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
}
Add to your Windsurf MCP config file (~/.codeium/windsurf/mcp_config.json):Remote Server Connection
{
  "mcpServers": {
    "gurubase-{guru_slug}": {
      "url": "https://api.gurubase.io/mcp/{guru_slug}/",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
Local Server Connection
{
  "mcpServers": {
    "gurubase-{guru_slug}": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://api.gurubase.io/mcp/{guru_slug}/",
        "--header",
        "Authorization: Bearer YOUR_API_KEY"
      ]
    }
  }
}
Add to your VS Code settings (settings.json):Remote Server Connection
{
  "mcp": {
    "servers": {
      "gurubase-{guru_slug}": {
        "url": "https://api.gurubase.io/mcp/{guru_slug}/",
        "headers": {
          "Authorization": "Bearer YOUR_API_KEY"
        }
      }
    }
  }
}
Local Server Connection
{
  "mcp": {
    "servers": {
      "gurubase-{guru_slug}": {
        "command": "npx",
        "args": [
          "-y",
          "mcp-remote",
          "https://api.gurubase.io/mcp/{guru_slug}/",
          "--header",
          "Authorization: Bearer YOUR_API_KEY"
        ]
      }
    }
  }
}
Add to your Zed settings file (~/.config/zed/settings.json):Local Server Connection
{
  "context_servers": {
    "gurubase-{guru_slug}": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "mcp-remote",
          "https://api.gurubase.io/mcp/{guru_slug}/",
          "--header",
          "Authorization: Bearer YOUR_API_KEY"
        ]
      }
    }
  }
}
For any MCP-compatible client, use one of these configuration patterns:Remote Server Connection (if your client supports url + headers):
{
  "url": "https://api.gurubase.io/mcp/{guru_slug}/",
  "headers": {
    "Authorization": "Bearer YOUR_API_KEY"
  }
}
Local Server Connection (if your client only supports command):
{
  "command": "npx",
  "args": [
    "-y",
    "mcp-remote",
    "https://api.gurubase.io/mcp/{guru_slug}/",
    "--header",
    "Authorization: Bearer YOUR_API_KEY"
  ]
}
Which one should I use? If your client supports url, use Remote. If it only supports command, use Local.

Available Tools

Once connected, your MCP client will have access to two tools:

gurubase_ask

Ask a question and get an AI-generated answer from your knowledge base. When to use:
  • You need a complete, synthesized answer
  • You want explanations, tutorials, or how-to guidance
  • Quality and completeness matter more than speed
Parameters:
NameTypeRequiredDescription
questionstringYesThe question to ask your Guru
Response:
{
  "content": "# How do I install Gurubase selfhosted version?\n\nGurubase **Self-Hosted Enterprise Edition** lets you deploy...",
  "slug": "install-gurubase-self-hosted-requirements-05d0f038",
  "trust_score": 35,
  "references": [
    {
      "title": "Self-Hosted Enterprise Edition - Onprem Deployment - Gurubase",
      "link": "https://docs.gurubase.ai/self-hosted",
      "icon": "https://mintlify.s3-us-west-1.amazonaws.com/gurubase/_generated/favicon/favicon-32x32.png?v=3",
      "type": "WEBSITE"
    },
    {
      "title": "Getting Started with Gurubase - Help Center",
      "link": "https://support.gurubase.io/hc/en-us/articles/123456789",
      "icon": "https://support.gurubase.io/favicon.ico",
      "type": "ZENDESK"
    }
  ]
}
FieldDescription
contentThe AI-generated answer in Markdown format
slugUnique identifier for this Q&A
trust_scoreConfidence score (0-100) indicating answer reliability
referencesArray of source documents used to generate the answer
This tool is slower (typically 10-30 seconds) because it retrieves sources, synthesizes information, and generates a comprehensive answer. Use gurubase_semantic_search for quick lookups.
Find relevant source documents without generating an answer. When to use:
  • You need a quick check of what documentation exists
  • You want to find specific articles, guides, or references
  • You need to explore the knowledge base
  • Speed is important
Parameters:
NameTypeRequiredDescription
querystringYesThe search query
labelsarrayNoFilter results by category labels
Response:
{
  "sources": [
    {
      "title": "Widget Runtime Sequence",
      "link": "text-gurubase-growth-Widget_Runtime_Sequence-9a65cf78",
      "labels": [],
      "icon_url": "",
      "text": "sequenceDiagram\n  autonumber\n  participant U as User\n  participant B as Browser (your site)...",
      "type": "Text"
    },
    {
      "title": "Discord - Gurubase",
      "link": "https://docs.gurubase.ai/integrations/bots/discord",
      "labels": [],
      "icon_url": "",
      "text": "The image shows a Discord bot integration that is connected to a specific Discord server...",
      "type": "Text"
    },
    {
      "title": "README.md",
      "link": "https://github.com/Gurubase/gurubase-widget/tree/master/README.md",
      "labels": [],
      "icon_url": "",
      "text": "## Path-Based Widget Loading\n\nIf you want to load the widget only on specific paths...",
      "type": "Text"
    }
  ],
  "total_count": 15
}
FieldDescription
sourcesArray of matching documents
sources[].titleDocument or page title
sources[].linkURL to the source (external link or internal reference)
sources[].labelsCategory labels associated with the source
sources[].icon_urlIcon URL for the source
sources[].textRelevant text snippet (truncated to ~500 chars)
sources[].typeSource type (e.g., “Text”)
total_countTotal number of sources returned

Example Usage

Once configured, you can use your Guru directly in Claude: Asking a question:
“Use the gurubase_ask tool to explain how to set up authentication”
Searching documentation:
“Use gurubase_semantic_search to find docs about rate limiting”
With labels filter:
“Search for API documentation rate limiting using gurubase_semantic_search with labels ‘api’, ‘reference”

Self-Hosted Configuration

For self-hosted Gurubase (Enterprise plan), update the URL to point to your instance:
{
  "mcpServers": {
    "gurubase-{guru_slug}": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://localhost:8029/mcp/{guru_slug}/",
        "--header",
        "Authorization: Bearer YOUR_API_KEY"
      ]
    }
  }
}
Replace localhost:8029 with your actual Gurubase instance URL if different.

Analytics

Questions asked via MCP appear in your Guru’s Analytics dashboard with the source type “MCP”. This allows you to track usage and identify common questions from your development team.

Troubleshooting

This error occurs when Claude Desktop cannot find npx in its PATH. GUI applications on macOS don’t inherit your shell’s PATH.Solution: Add the env section with the correct PATH:
  1. Find your npx location: which npx
  2. Add the directory to the PATH in your config:
"env": {
  "PATH": "/opt/homebrew/opt/node@20/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
}
  1. Completely quit and restart Claude Desktop (Cmd+Q, not just close the window)
  • Verify your API key is correct and starts with gb- - Check that the API key has not been revoked - Ensure the API is enabled for your Guru in Settings
  • Verify the guru_slug in the URL matches your Guru’s slug - Check that the Guru is not disabled - Ensure the API is enabled for your Guru
This is a temporary error. Try asking the question again. If it persists, contact support.
  1. Verify your MCP configuration is correct
  2. Restart Claude Desktop completely
  3. Check Claude Desktop logs for connection errors
  4. Test the endpoint manually:
curl -X POST https://api.gurubase.io/mcp/{guru_slug}/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
The gurubase_ask tool generates comprehensive answers which takes time. For faster lookups, use gurubase_semantic_search to find relevant documents without AI synthesis.

API Reference

For programmatic access without MCP, see our REST API documentation.

Next Steps