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:
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}/

Authentication

Send your API key in either of these headers:
  • Authorization: Bearer YOUR_API_KEY (works with most MCP clients)
  • X-API-KEY: YOUR_API_KEY (recommended for VS Code Copilot and any client that intercepts the Authorization header)
VS Code Copilot users: use X-API-KEY. Copilot’s MCP client manages the Authorization header internally and does not always forward user-supplied values to the server, which can cause Authorization: Bearer to fail. X-API-KEY is a non-standard header name, so Copilot passes it through unchanged. The same workaround applies to other MCP clients that layer their own auth on top of MCP.

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
Local Server Connection
Remote Server Connection
Local Server Connection
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
Local Server Connection
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:
Add to your Windsurf MCP config file (~/.codeium/windsurf/mcp_config.json):Remote Server Connection
Local Server Connection
Add to your VS Code settings (settings.json):
Use the X-API-KEY header (not Authorization: Bearer) when configuring Copilot. Copilot’s MCP client intercepts the Authorization header, which causes authentication to fail.
Remote Server Connection
Local Server Connection
Add to your Zed settings file (~/.config/zed/settings.json):Local Server Connection
For any MCP-compatible client, use one of these configuration patterns:Remote Server Connection (if your client supports url + headers):
Local Server Connection (if your client only supports command):
Which one should I use? If your client supports url, use Remote. If it only supports command, use Local.
Authentication failing? If Authorization: Bearer YOUR_API_KEY doesn’t work, your client may be intercepting the Authorization header. Switch to X-API-KEY: YOUR_API_KEY. The Gurubase MCP endpoint accepts both.

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: Response:
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: Response:

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:
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.
Country detection caveat: Country is detected from the client’s IP address. Clients that connect directly to Gurubase (Claude Desktop, Claude Code via mcp-remote, Cursor, Windsurf, Zed) will resolve to the developer’s country. Clients that proxy MCP traffic through their own infrastructure (notably VS Code Copilot, which routes through GitHub-hosted servers) will resolve to the proxy’s region rather than the developer’s location.

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:
  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:
Authorization: Bearer YOUR_API_KEY also works.
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

MCP Client Connections

Connect external MCP servers to your Guru

API Reference

Explore our REST API documentation

Website Widget

Add your Guru to your website

Slack Bot

Connect your Guru to Slack

Discord Bot

Add your Guru to Discord