A Model Context Protocol (MCP) server for seamless integration with Onyx AI knowledge bases. This MCP server connects any MCP-compatible client to your Onyx knowledge base, enabling powerful semantic search and chat capabilities.
To install Onyx MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @lupuletic/onyx-mcp-server --client claude
shell
git clone https://github.com/lupuletic/onyx-mcp-server.git
cd onyx-mcp-server
shell
npm install
shell
npm run build
shell
export ONYX_API_TOKEN="your-api-token-here"
export ONYX_API_URL="http://localhost:8080/api" # Adjust as needed
shell
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": []
}
}
}
Consult your MCP client's documentation for how to add a custom MCP server. You'll need to provide:
node
)/path/to/onyx-mcp-server/build/index.js
)ONYX_API_TOKEN
and ONYX_API_URL
Once configured, your MCP client will have access to two powerful tools:
The search_onyx
tool provides direct access to Onyx's search capabilities with enhanced context retrieval:
<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>
Parameters:
query
(required): The topic to search fordocumentSets
(optional): List of document set names to search within (empty for all)maxResults
(optional): Maximum number of results to return (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 instead of just chunks (default: false)The chat_with_onyx
tool leverages Onyx's powerful chat API with LLM + RAG for comprehensive answers:
<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>
Parameters:
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 within (empty for all)chatSessionId
(optional): Existing chat session ID to continue a conversationThe chat tool supports maintaining conversation context across multiple interactions. After the first call, the response will include a chat_session_id
in the metadata. You can pass this ID in subsequent calls to maintain context.
For the best results, you can use both tools in combination - search for specific details and chat for comprehensive understanding.
npm run dev
This project enforces the Conventional Commits specification for all commit messages. To make this easier, we provide an interactive commit tool:
npm run commit
This will guide you through creating a properly formatted commit message. Alternatively, you can write your own commit messages following the conventional format:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Where type
is one of: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.
npm run build
Run the test suite:
npm test
Run tests with coverage:
npm run test:coverage
npm run lint
Fix linting issues:
npm run lint:fix
This project uses GitHub Actions for continuous integration and deployment. The CI pipeline runs on every push to the main branch and on pull requests. It performs the following checks:
When a PR is merged to the main branch, the project automatically determines the appropriate version bump type and publishes to npm. The system analyzes both PR titles and commit messages to determine the version bump type.
feat:
, fix:
, docs:
)feat:
, fix:
, docs:
)npm run commit
for an interactive commit message creation toolfeat
or containing new features → minor version bumpfix
or containing bug fixes → patch version bumpBREAKING CHANGE
or with an exclamation mark → major version bumpThis automated process ensures consistent versioning based on the nature of the changes, following semantic versioning principles, and eliminates manual version management.
Contributions are welcome! Please see our Contributing Guide for more details.
If you discover a security vulnerability, please follow our Security Policy.
This project is licensed under the MIT License - see the LICENSE file for details.