ainative-opencode-memory-mcp
LocalAbout ainative-opencode-memory-mcp
ainative-opencode-memory-mcp is a ZeroDB-backed MCP server for persistent memory in OpenCode coding agents. It stores project decisions and conventions, then supports semantic retrieval across sessions.
Key features
- 01Store facts, decisions, and snippets
- 02Semantic memory search
- 03Recall relevant task context
- 04Memory count statistics
- 05Clear all or tagged memories
Use cases
- 01Loading project context at task start
- 02Keeping architecture decisions across sessions
- 03Recalling code conventions and known pitfalls
- 04Removing memories by tag
MCP support
It exposes five memory tools to MCP clients, including storage, semantic search, context recall, statistics, and deletion.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
5Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| tags | array | No | Optional tags (e.g. project name, topic) |
| content | string | Yes | The fact/decision/snippet to remember |
Details
From the project READMEainative-opencode-memory-mcp
Persistent memory for OpenCode agents. OpenCode is stateless — it forgets everything between sessions. This MCP server gives your OpenCode coding agent long-term memory powered by AINative ZeroDB: store a codebase's decisions, conventions, and gotchas once, and recall them in every future session.
Why
OpenCode restarts with a blank slate every time. Your agent re-learns your architecture, re-asks the same questions, re-makes the same mistakes. With this MCP, it remembers:
- Architecture & design decisions
- Naming conventions and code style
- Gotchas, workarounds, and "don't touch X" rules
- User/team preferences
Install
npm install -g ainative-opencode-memory-mcp
Setup (OpenCode)
- Get a free API key → ainative.studio/signup (Hobbyist $5/mo, 7-day free trial).
- Add to your OpenCode MCP config (
opencode.json/ MCP settings):
{
"mcpServers": {
"ainative-memory": {
"command": "npx",
"args": ["-y", "ainative-opencode-memory-mcp"],
"env": { "AINATIVE_API_KEY": "your-key-here" }
}
}
}
Tools
| Tool | What it does |
|---|---|
opencode_store_memory | Remember a fact/decision/snippet (optional tags) |
opencode_search_memory | Semantic search over everything remembered |
opencode_recall_context | Reload relevant memories at the start of a task |
opencode_memory_stats | How many memories are stored |
opencode_clear_memory | Wipe memories (optionally by tag) |
Example
At the start of a session, have your agent call opencode_recall_context with the file/task you're working on — it reloads what it knew. As you work, opencode_store_memory captures new decisions. Next session, it all comes back.
Environment
| Var | Default | Notes |
|---|---|---|
AINATIVE_API_KEY | — | Required. Free at ainative.studio |
OPENCODE_MEMORY_NAMESPACE | opencode | Isolate memories per project |
AINATIVE_API_URL | https://api.ainative.studio | Override for self-host |
Built by AINative Studio — the AI-native dev platform with 65+ models, one OpenAI-compatible endpoint, and persistent agent memory. MIT licensed.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.