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)
.mcp.json:
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
Cursor / Windsurf / Other MCP Clients
Most MCP clients support HTTP transport with custom headers. The connection details are:| Setting | Value |
|---|---|
| URL | https://cloud.onyx.app/mcp (or http://YOUR_DOMAIN:8090/) |
| Transport | HTTP (Streamable HTTP) |
| Auth Header | Authorization: Bearer YOUR_TOKEN |
Available Tools
The MCP server exposes three tools that LLM clients can invoke:search_indexed_documents
search_indexed_documents
Search your private knowledge base indexed in Onyx. Returns ranked document chunks with content, relevance scores,
and metadata.Parameters:
Example call:Response fields:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | — | Natural language search query |
source_types | string[] | No | All sources | Filter by connector type (e.g. ["confluence", "github", "jira"]) |
time_cutoff | string | No | No cutoff | ISO 8601 datetime — only return docs updated after this time |
limit | integer | No | 10 | Maximum number of results to return |
| Field | Description |
|---|---|
documents | Array of result objects |
documents[].semantic_identifier | Human-readable document name |
documents[].content | Relevant text snippet |
documents[].source_type | Connector source (e.g. "confluence") |
documents[].link | URL to the original document |
documents[].score | Relevance score |
total_results | Number of results returned |
query | The original query |
executed_queries | List of queries actually executed (may include expansions) |
search_web
search_web
Search the public internet for general knowledge and current events.Parameters:
Example call:Response fields:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | — | Search query |
limit | integer | No | 5 | Maximum number of results |
| Field | Description |
|---|---|
results | Array of web search results |
results[].title | Page title |
results[].url | Page URL |
results[].snippet | Short text excerpt |
query | The original query |
search_web returns snippets, not full page content. Use open_urls to fetch the complete text of any result.open_urls
open_urls
Retrieve the complete text content from one or more web URLs.Parameters:
Example call:Response fields:
| Parameter | Type | Required | Description |
|---|---|---|---|
urls | string[] | Yes | List of URLs to fetch |
| Field | Description |
|---|---|
results | Array of fetched pages |
results[].title | Page title |
results[].url | The fetched URL |
results[].content | Full extracted text content |
Available Resources
indexed_sources
indexed_sources
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:Self-Hosted Configuration
To self-host the MCP server, you will need to enable the deployment via environment variables. Docker:.env
values.yaml
Health Check
Verify the MCP server is running:Environment Variables
Most users should not need to configure these environment variables.
| Variable | Default | Description |
|---|---|---|
MCP_SERVER_ENABLED | false | Set to "true" to enable the MCP server |
MCP_SERVER_HOST | 0.0.0.0 | Host to bind the MCP server |
MCP_SERVER_PORT | 8090 | Port for the MCP server |
MCP_SERVER_CORS_ORIGINS | (empty) | Comma-separated list of allowed CORS origins |
API_SERVER_PROTOCOL | http | Protocol for internal API server connection |
API_SERVER_HOST | 127.0.0.1 | Hostname 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:- Ignore the OAuth configuration menus
- Open the Authentication tab
- Select Bearer Token authentication
- Paste your Onyx PAT or API key
- Click Connect