Skip to main content
Glama
AINative-Studio

ainative-opencode-memory-mcp

Official

ainative-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

Related MCP server: RLM Memory MCP Server

Install

npm install -g ainative-opencode-memory-mcp

Setup (OpenCode)

  1. Get a free API keyainative.studio/signup (Hobbyist $5/mo, 7-day free trial).

  2. 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.

Available Tools

5 tools
opencode_clear_memoryA

Delete stored memories. Optionally scope to a tag; with no tag, clears ALL memories in the namespace (destructive).

ParametersJSON Schema
NameRequiredDescriptionDefault
tagNoOnly clear memories with this tag

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description discloses the critical destructive behavior: 'with no tag, clears ALL memories in the namespace (destructive)'. This is a key safety signal that compensates for missing annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that conveys purpose, scoping, and destructive warning with no waste. Every phrase earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter tool with no output schema, the description adequately covers purpose, parameter behavior, and destructive risk. Minor omission: it does not mention whether deletion is reversible or any confirmation step, but the destructive warning suffices for the low complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema only documents the tag parameter as 'Only clear memories with this tag'. The description adds essential semantics about the default behavior when the tag is absent, which is not inferable from the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Delete stored memories' with a specific verb and resource, distinguishing it from sibling tools like store, search, and recall. The tag scoping detail further clarifies the operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description makes clear when to use the tag option versus not, warning that omitting it clears all memories. While it does not explicitly name alternatives, the context is clear enough for a deletion tool among distinct sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

opencode_memory_statsA

Report how many memories are stored for this OpenCode namespace.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It clearly states a read-only reporting behavior ('Report how many memories are stored'), which is transparent for a stats tool. It does not mention side effects or details beyond the count, but none are expected.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is direct and front-loaded. It conveys the purpose and scope without any wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple: no parameters, no output schema, and the description fully explains its function and scope. It is complete for an agent to select and invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the rubric sets a baseline of 4 for such cases. The description does not need to add parameter information since there are none.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Report') and resource ('how many memories are stored') with a clear scope ('for this OpenCode namespace'). It distinguishes itself from sibling tools like store, search, recall, and clear by focusing on statistics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly implies when to use this tool: whenever the agent needs to know the count of stored memories for the namespace. While it does not explicitly mention alternatives, the context is clear and no exclusions are needed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

opencode_recall_contextA

Pull the most relevant remembered context for the current coding task — call this at the START of a session to reload what the agent knew.

ParametersJSON Schema
NameRequiredDescriptionDefault
taskYesThe task or file you're working on
limitNoMax memories (default 8)

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It says 'Pull' which implies a read operation, but it does not explicitly state that it is non-destructive, what it returns, or any side effects. The phrase 'reload what the agent knew' adds context but lacks concrete behavioral guarantees.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that conveys purpose and usage without any redundant words. Every phrase earns its place, and the em-dash separates the core action from the explicit usage instruction.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (2 params, no output schema), and the description covers purpose and timing, but it doesn't explain what the returned 'context' looks like or how it relates to stored memories. It also doesn't differentiate from search_memory beyond the stated use case, leaving some practical ambiguity for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema fully describes both parameters ('task' and 'limit') with clear descriptions, giving 100% schema coverage. The tool description itself adds no additional parameter-level semantics beyond what the schema already provides, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Pull') and resource ('remembered context for the current coding task'), and distinguishes itself from siblings like search_memory by focusing on task-relevance and session startup. It clearly states what the tool does and when it should be used.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly instructs the agent to call this at the START of a session to reload prior knowledge, providing a clear usage context. It does not, however, mention exclusions or explicitly compare against sibling tools like search_memory, so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

opencode_search_memoryA

Semantic search over everything the agent has remembered. Returns the most relevant memories for a query.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMax results (default 5)
queryYesWhat to search for

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the transparency burden. It states the core behavior—semantic search and returning relevant memories—but does not explicitly disclose whether the operation is read-only, what side effects (if any) exist, or how results are ordered or scored. The word 'search' implies non-destructive behavior, but no reassurance or additional context is given.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences, front-loaded with the primary action ('Semantic search over everything the agent has remembered') and a clear statement of what it returns. Every clause contributes to understanding with no redundant or tangential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple search tool with no output schema, the description adequately conveys the purpose and return type ('Returns the most relevant memories for a query'). It could benefit from a note distinguishing it from `opencode_recall_context` or a hint about the output format, but the core information is present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema fully documents both parameters (`query` and `limit`) with descriptions, so the baseline is 3. The description adds no additional parameter semantics, such as query syntax or limit constraints, so it does not exceed the schema's coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool performs semantic search over the agent's memories, using a specific verb ('search') and resource ('memories'). It returns the most relevant memories for a query, but it does not explicitly differentiate from the sibling tool `opencode_recall_context`, which may also retrieve memories.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for querying stored memories to find relevant results, but it provides no explicit guidance on when to use it versus alternatives like `opencode_recall_context`. There are no stated exclusions or context-based recommendations, leaving selection to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

opencode_store_memoryA

Store a fact, decision, convention, or code snippet so your OpenCode agent remembers it in future sessions. Use for things like architecture decisions, naming conventions, gotchas, or user preferences.

ParametersJSON Schema
NameRequiredDescriptionDefault
tagsNoOptional tags (e.g. project name, topic)
contentYesThe fact/decision/snippet to remember

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must carry the burden of behavioral disclosure. It does state the persistence behavior ('remembers it in future sessions'), which is helpful, but it doesn't disclose potential edge cases such as overwriting existing memories, size limits, or how tags affect retrieval. This is minimal viable transparency but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no wasted words. It front-loads the core action ('Store a fact...') and then provides concrete use examples. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a simple tool with only two parameters, both documented in the schema. The description covers purpose, persistence semantics, and use cases, which is sufficient for the tool's complexity. It lacks an explicit note about return values or success indication, but given the simplicity and the output schema being absent, it's nearly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for both parameters (content, tags), so the baseline is 3. The description adds illustrative examples of content types ('fact, decision, convention, or code snippet') but doesn't add meaning beyond the schema for either parameter. It provides no extra syntax, formatting, or relationship context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Store') and clearly names the resource (facts, decisions, conventions, code snippets) while explicitly stating the outcome: the agent remembers it in future sessions. It also provides concrete examples (architecture decisions, naming conventions) that distinguish it from sibling tools like search, recall, stats, and clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context on when to use the tool ('Use for things like...') with specific examples (architecture decisions, naming conventions, gotchas, user preferences). However, it doesn't explicitly mention alternatives or when not to use it, so it lacks the full exclusionary guidance needed for a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updatesv0.1.2
    • First observedopencode_clear_memory
    • First observedopencode_memory_stats
    • First observedopencode_recall_context
    • First observedopencode_search_memory
    • First observedopencode_store_memory

TDQS

A4/5.0
Disambiguation4/5

Tools are mostly distinct: store, search, recall, stats, clear each have clear roles. Some overlap exists between search_memory and recall_context, but descriptions clarify recall_context is for session-start context loading while search_memory is for arbitrary queries.

Naming Consistency4/5

All tools share the 'opencode_' prefix and use snake_case, following a verb/object pattern. Minor deviation: 'memory_stats' is noun_noun instead of verb_memory, and 'recall_context' uses context instead of memory, but the naming is still predictable and readable.

Tool Count5/5

Five tools is a well-scoped number for a memory management server, covering store, retrieve, recall, stats, and clear without unnecessary bloat.

Completeness4/5

CRUD-like coverage is solid: store (create), search/recall (read), clear (delete), and stats (count). Missing an update operation, but memory overwriting is not a standard need and the surface feels complete for the domain.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Provides AI coding agents with persistent, long-term memory through local semantic search and SQLite storage. It enables agents to save and retrieve architectural decisions or project context across different conversation sessions without requiring cloud services.
    -
  • A
    license
    A
    quality
    A
    maintenance
    Provides persistent, searchable memory across AI coding agent and chat history (Claude Code, Codex, Gemini CLI, ChatGPT, and more) via retrieval-augmented generation, enabling semantic and hybrid search to retain context across sessions.
    5
    5
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AINative-Studio/ainative-opencode-memory-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server