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.
If you restrict tools in Opencode, enable the Searchbase MCP server tools:
1
2
3
4
5
{
"tools": {
"searchbase": true }
}
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:
require("codecompanion").setup({
interactions= {
chat= {
tools= {
opts= {
default_tools= {
"searchbase_search",
"searchbase_fetch",
},
},
["searchbase_search"] = {
extends="cmd_tool",
description="Search the web using Searchbase",
opts= { require_approval_before=true },
name="searchbase_search",
system_prompt=[[You have access to a web search tool called searchbase_search. Use it to search the web for information.]],
schema= {
properties= {
query= {
type="string",
description="The search query to look up on the web",
},
},
required= { "query" },
},
build_cmd=function(args)
localdata=vim.json.encode({ query=args.query, limit=5 })
localescaped_data=vim.fn.shellescape(data)
return"curl -s -X POST http://localhost:8080/api/v1/search -H 'Content-Type: application/json' -d "..escaped_dataend,
},
["searchbase_fetch"] = {
extends="cmd_tool",
description="Fetch optimized web content using Searchbase",
opts= { require_approval_before=true },
name="searchbase_fetch",
system_prompt=[[You have access to a web fetch tool called searchbase_fetch. Use it to fetch optimized Markdown from a URL.]],
schema= {
properties= {
url= {
type="string",
description="The URL to fetch",
},
js_render= {
type="boolean",
description="Whether to render website JavaScript",
},
},
required= { "url" },
optional= { "js_render" },
},
build_cmd=function(args)
ifargs.js_render==nilthenargs.js_render=falseendlocaldata=vim.json.encode({ url=args.url, js_render=args.js_render })
localescaped_data=vim.fn.shellescape(data)
return"curl -s -X POST http://localhost:8080/api/v1/fetch -H 'Content-Type: application/json' -d "..escaped_dataend,
},
},
},
},
})
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: