Documentation
MCP Integration
If your LLM client supports MCP (like Claude Desktop, Cursor, LM Studio, OpenWebUI, Opencode, or Neovim CodeCompanion), you can plug Searchbase directly into it using one of the supported transports.
- MCP SSE Endpoint:
http://localhost:8080/mcp/sse - MCP Streamable HTTP Endpoint:
http://localhost:8080/mcp/http
Available Tools
web_search: Search the live web and return compact search results.fetch_url: Fetch one exact URL and return its content as Markdown.
OpenWebUI
OpenWebUI works best with the Streamable HTTP transport.
- Open OpenWebUI.
- Click your profile.
- Go to Admin Panel > Settings > Integrations.
- Click + Add connection.
- Set the connection type to MCP Streamable HTTP.
- Set the ID to
searchbase. - Set the target URL to
http://localhost:8080/mcp/http. - Save the connection.
After connection, OpenWebUI should discover the web_search and fetch_url tools automatically.
LM Studio
LM Studio can connect to Searchbase through the MCP SSE endpoint.
Use this configuration in LM Studio’s MCP server settings:
| |
If LM Studio asks for fields instead of raw JSON, use:
| Field | Value |
|---|---|
| Name | searchbase |
| Transport | sse |
| URL | http://localhost:8080/mcp/sse |
Once enabled, LM Studio can call web_search for discovery and fetch_url when it needs full page content.
Opencode
Opencode can connect to Searchbase through the remote MCP SSE endpoint.
Add the Searchbase MCP server to your opencode.json or opencode.jsonc config:
| |
If you restrict tools in Opencode, enable the Searchbase MCP server tools:
| |
Replace localhost with your Searchbase server address when Opencode runs on a different machine.
Neovim CodeCompanion
CodeCompanion currently supports stdio MCP servers, but does not support remote SSE or Streamable HTTP MCP servers directly. Because Searchbase exposes remote MCP transports, the simplest CodeCompanion setup is to expose Searchbase as command tools that call the REST API.
Add only the Searchbase tools to your codecompanion.setup() config:
| |
Replace localhost with your Searchbase server address when Neovim runs on a different machine. Keep vim.fn.shellescape() around the JSON payload so queries and URLs are escaped safely before curl runs.
Claude Desktop / Cursor
Clients that support SSE MCP servers can use the same JSON shape:
| |
Replace localhost with the actual server address if Searchbase is not running on the same machine as your MCP client.
Idle Connection Timeouts
Some MCP clients close a connection when nothing is received for a while. The reference MCP SSE client, for example, defaults sse_read_timeout to 300s, so an idle Searchbase session is dropped after roughly five minutes.
Searchbase can send periodic heartbeat pings on both the SSE and Streamable HTTP transports to keep those connections open. The heartbeat is off by default and is enabled explicitly:
| |
SEARCHBASE_MCP_HEARTBEAT_INTERVAL is expressed in seconds, defaults to 60, and is only used when the heartbeat is enabled. The minimum accepted value is 15; anything lower fails startup. Pick an interval comfortably below your client’s read timeout. See Self Hosting for the full configuration reference.
Fetch failures
fetch_url returns an MCP tool result with isError: true and text such as
Failed to fetch URL: not_found. The fixed categories match the
REST fetch errors. Extraction failures are
tool errors rather than MCP protocol errors, allowing the model to react to
timeout, robots_denied, or unreachable without receiving raw browser
errors or fetched URLs. Successful tool responses remain unchanged.