Skip to main content
Connect your AI client to Onyx so it can search your Onyx documents, search the web, and read web pages.
This page covers Onyx as an MCP server. To give Onyx Agents tools from another MCP server, see MCP plugins.

Before you connect

  • Get your Onyx MCP URL from your administrator, such as https://onyx.example.com/mcp/.
  • Your Onyx account needs the Search and Create User Access Token permissions.
  • Self-hosted Onyx needs HTTPS for OAuth. The MCP server is in all editions and is on by default.

Connect your AI tools

Claude

Claude Desktop and claude.ai.

ChatGPT

ChatGPT on the web and desktop.

Codex

CLI, desktop app, and IDE extension.

Claude Code

User or project configuration.
For another client, add your Onyx MCP URL as a remote Streamable HTTP server with OAuth.

Sign in and approve access

Your client opens Onyx in your browser. Sign in with your own user account, check the app name and account, and select Allow access. API keys and service accounts cannot approve access. Onyx OAuth consent page showing the app name, requested search access, Allow access, and Deny. Account details are hidden.

Test the connection

Send this prompt from your client:
The client should call search_indexed_documents and return document titles and source links. An empty result can be valid. Try a document that you know you can open in Onyx.

Permissions and data access

A connected app gets the read:search scope. It can search documents that you can access, search the web, and open web pages. It cannot create API keys or use other Onyx APIs. Your document permissions still apply. Your AI client receives the content that Onyx returns. Use a client that your organization allows to receive it.

Connection expiry

After 30 days, sign in and approve access again. If a client reuses an old refresh token, Onyx revokes the authorization and you must connect again.

Manage connected apps

Connected apps in Onyx settings with app names, expiry dates, and Disconnect controls. To revoke an app, open Settings > Accounts & Access > Connected apps in Onyx and select Disconnect. Removing Onyx from your client or signing out of Onyx does not revoke access. For a personal access token connection, revoke the token instead. To change accounts, sign out of Onyx in your client and connect again with the other account.

Use a personal access token instead

If your client cannot use OAuth, create a personal access token with read:search under Settings > Accounts & Access > Access Tokens. On Onyx Cloud, tokens need a paid subscription. Export the token without saving it in your shell history:
Then configure Codex or Claude Code.

Prompts you can use

Replace names and dates with values from your workspace.

Find a procedure

Search a document set

Use an Onyx agent’s knowledge scope

This runs a search with the agent’s knowledge scope and configured model. It does not start a chat with that agent. Do not combine agent with document_set_names in the same search.

Find recently updated documents

The date filter applies to document update times, not dates mentioned in the text.

Compare workspace guidance with public documentation

Tool reference

search_indexed_documents

Search the knowledge indexed in Onyx. The search includes query expansion, retrieval, document selection, and context expansion.
Document-set and agent names must exist in your workspace. Unknown source types, document sets, or agents return an error with suggested or available values. Correct the filter before retrying. Empty filter arrays do not restrict the search. Use a valid timestamp: an invalid time_cutoff can result in a search without a date restriction. The response has a results array. Each result includes title, url, source_type, content, and updated_at. Results are ordered by relevance. content contains retrieved document text, which can be a selected chunk rather than the entire document. There is no limit parameter for this tool.

search_web

Search public web content. Availability depends on your Onyx web-search configuration.
The response contains results and query. Results include page titles, URLs, and snippets. Use open_urls for page text when a snippet is insufficient.

open_urls

Retrieve text from web pages. This tool does not provide a way to bypass a site’s sign-in or Onyx document permissions.
The response contains a results array with fetched page text and metadata.

Resource reference

Clients that support MCP resources can read these JSON resources to discover search filters: Resource support varies by client. A resource lookup is not required before searching: named filters are resolved on the search call and return an error when they cannot be resolved.

Troubleshooting