opencode-history-mcp MCP Server

A local MCP (Model Context Protocol) server that lets AI coding agents search your past OpenCode conversations — before they start exploring files or re-doing work you already did.

Local serverstdio

What is the opencode-history-mcp Server?

opencode-history-mcp is an MCP project maintained in the crottolo/opencode-history-mcp repository. The maintainer describes its purpose as “A local MCP (Model Context Protocol) server that lets AI coding agents search your past OpenCode conversations — before they start exploring files or re-doing…”. Read the project documentation for the complete scope.

Installation

The documented pypi package is opencode-history-mcp. The configuration below comes from the maintainer’s example; adapt its paths and account values to your environment.

Source

Project documentation · Repository · Discovery listing. This profile records the public documentation checked on 2026-10-08.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
search_historyFull-text search (FTS5) over user prompts and assistant responses. Ranked by relevance + recency + activity.
find_related_workHigher-precision match on session titles and original task descriptions. Best first call for "have we done this before?"
find_sessions_by_fileFind every session that modified or mentioned a specific file.
list_sessionsBrowse sessions in a directory, sorted by date/messages/cost/tokens.
get_session_detailFull metadata for one session: task, files touched, cost, tokens, sub-agent count.
get_session_messagesRead the actual paginated message history of a session.
get_statsAggregate stats: session/message counts, cost, time range, activity distribution.

How to install the opencode-history-mcp Server

{
  "mcpServers": {
    "opencode-history": {
      "command": "uvx",
      "args": [
        "opencode-history-mcp"
      ]
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.