# OpenCode History MCP server

> Lets AI coding agents search local OpenCode conversation history to avoid repeating past work or re-diagnosing solved bugs.

- Repository: https://github.com/singleflo/opencode-history-mcp
- Page: https://hostedmcp.org/servers/singleflo/opencode-history-mcp
- Transport: —
- Stars: 4
- License: MIT

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `OPENCODE_DATA_DIR` | no | no |  |

## Tools (7)

- `search_history`
- `find_related_work`
- `find_sessions_by_file`
- `list_sessions`
- `get_session_detail`
- `get_session_messages`
- `get_stats`

## FAQ

### Is my data safe with this server?

Yes, everything runs locally on your machine and no data ever leaves your computer.

### Does this server modify my existing OpenCode database?

No, the source database is opened in read-only mode and remains untouched.

### What if my OpenCode data is in a non-standard location?

You can explicitly point the server to your data directory by setting the OPENCODE_DATA_DIR environment variable.
