opencode-history-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OPENCODE_DATA_DIR | No | Path to the OpenCode data directory. Overrides auto-detection. Useful when OpenCode data lives in a non-standard location (e.g., on a mounted Windows drive in WSL). |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| extensions | {
"io.modelcontextprotocol/ui": {}
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_historyA | Search past OpenCode conversations by keyword (full-text on user prompts and assistant responses). |
| find_sessions_by_fileA | Find sessions that modified or mentioned a specific file. Searches patch records (files actually changed) and file mentions in text. Uses an indexed file_paths table for fast lookup (<50ms). |
| find_related_workA | Find sessions related to a task description by matching session titles and original user prompts. More precise than search_history for finding sessions on the same topic. |
| get_session_detailA | Get full details of a specific session. Returns metadata, original task (first user prompt), files modified, and the last assistant message. |
| get_session_messagesA | Read the actual messages from a session (paginated). Use this after finding a session with the discovery tools to read its content. Each text part is hard-truncated to 1000 chars to control token budget. Tool calls return only name + status (not output). File/base64 parts are skipped. |
| list_sessionsA | Browse sessions filtered by directory. Root sessions only (sub-agents excluded). |
| get_statsA | Overview statistics: session counts, messages, cost, time range, and distribution. Root vs sub-agent breakdown. Top directories by activity. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 7 tools
While search_history and find_related_work both search text, they target different fields (full conversation vs. titles/initial prompts) and the descriptions explicitly distinguish them. All other tools are clearly distinct by resource type (sessions, files, stats).
All tool names follow a consistent verb_noun pattern in snake_case, with modifiers like 'by_file' and 'by_related_work' for clarity.
Seven tools provide a tight, focused set for browsing session history without redundancy.
The tool set covers discovery (search, file lookup, related work, list), detail retrieval, message reading, and aggregate stats—no obvious dead ends for a read-only history server.