COMPARISONS · AGENT SETUP

Best local search and MCP for opencode in 2026

AUTHOR · XERJ documentation team · REVIEWED BY · XERJ engineering team · PUBLISHED · 2026-12-03 · UPDATED · 2026-12-03
SHORT ANSWER · UPDATED 2026-12-03

The simplest local search for opencode is an MCP server on your own machine: XERJ indexes a folder with xerj autoindex and serves search tools through xerj mcp. opencode connects it through the mcp block of opencode.json, over stdio or over Streamable HTTP with xerj mcp --http at http://127.0.0.1:9330/mcp.

Key number: opencode: 230,891 GitHub stars, latest release v2.4.4, 2 Dec 2026. XERJ: 23,588 GitHub stars, v1.0.0-rc.105, 23 Nov 2026, Apache-2.0 (3 Dec 2026).

Stars, licences, languages and releases for 10 tools were fetched live from the GitHub API, GitHub release pages and the Hugging Face API on 3 Dec 2026. Hosted services link to their official sites and carry no invented numbers.

TL;DR The simplest local search for opencode is an MCP server on your own machine: XERJ indexes a folder with xerj autoindex and serves search tools through xerj mcp.

Try it: setup builder for opencode

Build the XERJ setup, the opencode config and the prompt

1. How should opencode reach XERJ?
2. What will you search?
3. Which search mode should the agent use?

Setup

curl -fsSL https://xerj.org/get | sh
export PATH="$HOME/.local/bin:$PATH"
xerj --insecure --data-dir ~/xerj-data &
xerj autoindex ./project
# opencode starts xerj mcp over stdio from the config below

opencode config

{
  "mcp": {
    "xerj": { "type": "local", "command": ["xerj", "mcp"], "enabled": true }
  }
}

Prompt

Read https://xerj.org/llms.txt. You are running in opencode with the xerj MCP server connected. The code repository at ./project is indexed. Answer my next question with xerj_hybrid_search and cite the file and line for each claim.

Runs in your browser and sends nothing. XERJ commands follow llms.txt; the opencode snippet follows the project's MCP documentation as of 3 Dec 2026. Tool names are the XERJ MCP search tools.
Try it: filter 10 MCP servers

MCP search and memory servers opencode can call

Show only

Sort by

MCP serverWhat it isBest forRuns asLanguageLatest releaseLicenceStars
XERJOne local Rust binary that indexes code, docs, logs and data, and serves cited search to agents over MCPAgents searching local files over MCPCommand-line toolRustv1.0.0-rc.105, 23 Nov 2026Apache-2.023,588
CodegraphCode knowledge graph for AI coding agents with an MCP serverGiving a coding agent a symbol graph of the repoCommand-line toolTypeScriptv1.6.7, 30 Nov 2026MIT79,509
Mem0Memory layer for AI agents that extracts, stores and retrieves user and session memoriesPersonalised assistants that remember usersLibrary in your processPythonts-v3.3.1, 25 Sep 2026Apache-2.070,021
Context7MCP server that serves up-to-date library documentation and code examples to coding agentsCurrent library docs inside an AI editorSelf-hosted serverTypeScriptupstash/context7-mcp 4.9.3, 3 Dec 2026MIT65,847
HindsightAgent memory system that learns from experience with retain, recall and reflect operationsAgent memory that improves over timeSelf-hosted serverPythonv1.3.1, 2 Dec 2026MIT64,660
codebase-memory-mcpMCP server that indexes a codebase into a persistent knowledge graph for agentsPersistent code graph memory for coding agentsSelf-hosted serverCv0.12.1, 16 Oct 2026MIT49,567
GitHub MCP ServerGitHub's official MCP server for repositories, issues, pull requests and code searchAgents working with GitHub repos and issuesSelf-hosted serverGov2.3.0, 24 Nov 2026MIT34,945
CogneeMemory engine that turns documents into a knowledge graph plus vectors for agentsGraph plus vector memory from your documentsLibrary in your processPythonv1.6.11, 26 Nov 2026Apache-2.033,829
GraphitiFramework for building temporally aware knowledge graphs for AI agentsTime-aware knowledge graphs in your own stackLibrary in your processPythonmcp-v1.1.5, 24 Nov 2026Apache-2.033,291
SupermemoryMemory API and app for AI with an MCP serverUniversal memory across AI appsManaged APITypeScriptserver-v0.0.9, 12 Oct 2026MIT32,053

Runs in your browser and sends nothing. Every row ships MCP support from its own project. Data fetched live on 3 Dec 2026.
PASTE THIS TO YOUR AI AGENT. IT DOES THE REST Read https://xerj.org/llms.txt. Set up XERJ for opencode: start a local node, run xerj autoindex ./project, register xerj mcp with opencode, then answer my next question with xerj_hybrid_search and cite file and line.

Pick one in ten seconds

How opencode connects to MCP servers

opencode (Open source AI coding agent built for the terminal) attaches MCP servers through the mcp block of opencode.json. Over stdio, opencode starts xerj mcp itself. Over HTTP, you start xerj mcp --http once and point opencode at http://127.0.0.1:9330/mcp.

Step by step

  1. Install XERJ with curl -fsSL https://xerj.org/get | sh and put ~/.local/bin on your PATH.
  2. Start a local node with xerj --insecure --data-dir ~/xerj-data. Keep the data directory outside any folder you index.
  3. Index a folder with xerj autoindex ./project. It detects formats from content and skips junk with reasons.
  4. Register the server in opencode with the config from the builder above, then restart opencode or reload its tools.
  5. Ask a question. The agent calls xerj_search, xerj_semantic_search or xerj_hybrid_search and cites file and line.

Read-only by default

xerj mcp is a stdio MCP server, and xerj mcp --http serves Streamable HTTP at http://127.0.0.1:9330/mcp, read-only unless you pass --allow-writes. A non-loopback bind needs XERJ_MCP_TOKEN. Keep the default for search. Add --allow-writes only when opencode should store memories through XERJ.

Which MCP server for which job

How we checked

Stars, licences, languages and releases for 11 tools were fetched live from the GitHub API, GitHub release pages and the Hugging Face API on 3 Dec 2026. Hosted services link to their official sites and carry no invented numbers. The opencode snippet follows its MCP documentation; check your installed version, since config keys can change between releases.

Read next

FAQ

Does opencode support MCP?

Yes. opencode attaches MCP servers through the mcp block of opencode.json.

Should opencode use stdio or Streamable HTTP?

Use stdio when opencode runs on the same machine as your files: it starts xerj mcp for you. Use Streamable HTTP when several agents share one server; xerj mcp --http listens on http://127.0.0.1:9330/mcp.

Is xerj mcp read-only?

Yes by default. xerj mcp --http stays read-only unless you pass --allow-writes, and a bind beyond loopback needs XERJ_MCP_TOKEN.

Do my files leave the machine?

XERJ indexes and searches on your machine. The model opencode talks to still receives the passages the agent sends it, so pick a model provider you trust with that text.

Evidence