Onyx MCP Server is a bridge that connects MCP-compatible clients to your Onyx knowledge base, enabling powerful semantic search and retrieval of relevant context from your documents. It provides enhanced search capabilities and chat integration to help you easily access information stored in your Onyx systems.
The easiest way to install the Onyx MCP Server for Claude Desktop is through Smithery:
npx -y @smithery/cli install @lupuletic/onyx-mcp-server --client claude
Clone the repository:
git clone https://github.com/lupuletic/onyx-mcp-server.git
cd onyx-mcp-server
Install dependencies:
npm install
Build the server:
npm run build
Configure your Onyx API Token:
export ONYX_API_TOKEN="your-api-token-here"
export ONYX_API_URL="http://localhost:8080/api" # Adjust as needed
Start the server:
npm start
Add to ~/Library/Application Support/Claude/claude_desktop_config.json
:
{
"mcpServers": {
"onyx-search": {
"command": "node",
"args": ["/path/to/onyx-mcp-server/build/index.js"],
"env": {
"ONYX_API_TOKEN": "your-api-token-here",
"ONYX_API_URL": "http://localhost:8080/api"
},
"disabled": false,
"alwaysAllow": []
}
}
}
Add to your Cline MCP settings file:
{
"mcpServers": {
"onyx-search": {
"command": "node",
"args": ["/path/to/onyx-mcp-server/build/index.js"],
"env": {
"ONYX_API_TOKEN": "your-api-token-here",
"ONYX_API_URL": "http://localhost:8080/api"
},
"disabled": false,
"alwaysAllow": []
}
}
}
For other MCP clients, consult their documentation on adding custom MCP servers. You'll need to provide:
node
/path/to/onyx-mcp-server/build/index.js
ONYX_API_TOKEN
and ONYX_API_URL
The search_onyx
tool provides direct access to Onyx's search capabilities:
<use_mcp_tool>
<server_name>onyx-search</server_name>
<tool_name>search_onyx</tool_name>
<arguments>
{
"query": "customer onboarding process",
"documentSets": ["Company Policies", "Training Materials"],
"maxResults": 3,
"chunksAbove": 1,
"chunksBelow": 1,
"retrieveFullDocuments": true
}
</arguments>
</use_mcp_tool>
query
(required): The topic to search fordocumentSets
(optional): List of document set names to search withinmaxResults
(optional): Maximum number of results (default: 5, max: 10)chunksAbove
(optional): Number of chunks to include above the matching chunk (default: 1)chunksBelow
(optional): Number of chunks to include below the matching chunk (default: 1)retrieveFullDocuments
(optional): Whether to retrieve full documents (default: false)The chat_with_onyx
tool leverages Onyx's chat API with LLM + RAG:
<use_mcp_tool>
<server_name>onyx-search</server_name>
<tool_name>chat_with_onyx</tool_name>
<arguments>
{
"query": "What is our company's policy on remote work?",
"personaId": 15,
"documentSets": ["Company Policies", "HR Documents"],
"chatSessionId": "optional-existing-session-id"
}
</arguments>
</use_mcp_tool>
query
(required): The question to ask OnyxpersonaId
(optional): The ID of the persona to use (default: 15)documentSets
(optional): List of document set names to search withinchatSessionId
(optional): Existing chat session ID to continue a conversationThe chat tool supports maintaining conversation context. After the first call, you'll receive a chat_session_id
in the metadata that you can use in subsequent calls.
For optimal results, you can combine both tools - search for specific details and chat for comprehensive understanding.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.