Skip to main content

Overview

The Onyx MCP Server lets any MCP-compatible LLM client (Claude Desktop, Claude Code, Cursor, Windsurf, etc.) access your Onyx knowledge base, web search, and URL fetching capabilities through the Model Context Protocol.

Prerequisites

Before connecting, you’ll need:
  • A running Onyx instance (either self-hosted or Onyx Cloud)
  • Authentication — see Personal Access Tokens or API Keys
  • An MCP-compatible client (Claude Desktop, Claude Code, Cursor, etc.)

Self-Hosted MCP Server Configuration

Jump to environment variables, networking, and deployment settings for self-hosted MCP server

Quick Start

Claude Code (CLI)

claude mcp add --transport http onyx https://cloud.onyx.app/mcp \
  --header "Authorization: Bearer YOUR_ONYX_TOKEN_HERE"
Or add it to your project’s .mcp.json:
{
  "mcpServers": {
    "onyx": {
      "type": "http",
      "url": "https://cloud.onyx.app/mcp",
      "headers": {
        "Authorization": "Bearer ${ONYX_TOKEN}"
      }
    }
  }
}
Then set the environment variable before running Claude Code:
export ONYX_TOKEN="your-token-here"
claude

Claude Desktop

Add the following to your Claude Desktop config file:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "onyx": {
      "url": "https://cloud.onyx.app/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_ONYX_TOKEN_HERE"
      }
    }
  }
}
Replace https://cloud.onyx.app/mcp with http://YOUR_ONYX_DOMAIN:8090/ if you’re self-hosting.

Cursor / Windsurf / Other MCP Clients

Most MCP clients support HTTP transport with custom headers. The connection details are:
SettingValue
URLhttps://cloud.onyx.app/mcp (or http://YOUR_DOMAIN:8090/)
TransportHTTP (Streamable HTTP)
Auth HeaderAuthorization: Bearer YOUR_TOKEN
Refer to your client’s MCP documentation for exact configuration steps.

Available Tools

The MCP server exposes three tools that LLM clients can invoke:
Search your private knowledge base indexed in Onyx. Returns ranked document chunks with content, relevance scores, and metadata.Parameters:
ParameterTypeRequiredDefaultDescription
querystringYesNatural language search query
source_typesstring[]NoAll sourcesFilter by connector type (e.g. ["confluence", "github", "jira"])
time_cutoffstringNoNo cutoffISO 8601 datetime — only return docs updated after this time
limitintegerNo10Maximum number of results to return
Example call:
{
  "query": "What is the latest status of PROJ-1234?",
  "source_types": ["jira", "google_drive"],
  "time_cutoff": "2025-01-01T00:00:00Z",
  "limit": 5
}
Response fields:
FieldDescription
documentsArray of result objects
documents[].semantic_identifierHuman-readable document name
documents[].contentRelevant text snippet
documents[].source_typeConnector source (e.g. "confluence")
documents[].linkURL to the original document
documents[].scoreRelevance score
total_resultsNumber of results returned
queryThe original query
executed_queriesList of queries actually executed (may include expansions)
To discover which source types are available, use the indexed_sources resource (see below).
Search the public internet for general knowledge and current events.Parameters:
ParameterTypeRequiredDefaultDescription
querystringYesSearch query
limitintegerNo5Maximum number of results
Example call:
{
  "query": "React 19 migration guide",
  "limit": 5
}
Response fields:
FieldDescription
resultsArray of web search results
results[].titlePage title
results[].urlPage URL
results[].snippetShort text excerpt
queryThe original query
search_web returns snippets, not full page content. Use open_urls to fetch the complete text of any result.
Retrieve the complete text content from one or more web URLs.Parameters:
ParameterTypeRequiredDescription
urlsstring[]YesList of URLs to fetch
Example call:
{
  "urls": [
    "https://react.dev/blog/2024/12/05/react-19",
    "https://react.dev/learn/react-compiler"
  ]
}
Response fields:
FieldDescription
resultsArray of fetched pages
results[].titlePage title
results[].urlThe fetched URL
results[].contentFull extracted text content

Available Resources

URI: resource://indexed_sourcesLists all document connector types currently indexed in your Onyx instance (e.g. "confluence", "github", "google_drive", "slack").Use this to discover valid values for the source_types filter in search_indexed_documents.Example response:
{
  "indexed_sources": ["confluence", "github", "google_drive", "jira", "slack"]
}

Self-Hosted Configuration

To self-host the MCP server, you will need to enable the deployment via environment variables. Docker:
.env
MCP_SERVER_ENABLED=true
Kubernetes:
values.yaml
configMap:
  MCP_SERVER_ENABLED: "true"

Health Check

Verify the MCP server is running:
curl http://localhost:8090/health # or http://YOUR_DOMAIN:8090/health
Expected response:
{
  "status": "healthy",
  "service": "mcp_server"
}

Environment Variables

Most users should not need to configure these environment variables.
VariableDefaultDescription
MCP_SERVER_ENABLEDfalseSet to "true" to enable the MCP server
MCP_SERVER_HOST0.0.0.0Host to bind the MCP server
MCP_SERVER_PORT8090Port for the MCP server
MCP_SERVER_CORS_ORIGINS(empty)Comma-separated list of allowed CORS origins
API_SERVER_PROTOCOLhttpProtocol for internal API server connection
API_SERVER_HOST127.0.0.1Hostname for internal API server connection
API_SERVER_URL_OVERRIDE_FOR_HTTP_REQUESTS(unset)Full URL override for API server. Use this when self-hosting the MCP server against Onyx Cloud

Debugging & Testing

MCP Inspector

The MCP Inspector is an interactive debugging tool for MCP servers:
npx @modelcontextprotocol/inspector
Setup in Inspector:
  • Ignore the OAuth configuration menus
  • Open the Authentication tab
  • Select Bearer Token authentication
  • Paste your Onyx PAT or API key
  • Click Connect
Once connected, you can browse tools, test calls with different parameters, and inspect request/response payloads.

Next Steps