Skip to content

Show & Tell: MCP Memory Service — semantic memory plugin working with event hook #29022

Closed as not planned

Description

@doobidoo

What is it?

MCP Memory Service is an open-source semantic memory layer for AI agents (vector embeddings, 12 REST API endpoints, MCP transport, 3 storage backends). It now ships a working OpenCode in-process plugin.

What the plugin does

  • Auto-captures valuable content during conversations (decisions, errors, learnings — regex-based, configurable patterns + #skip/#remember overrides)
  • Injects relevant memories into the system prompt via experimental.chat.system.transform
  • Session-end write-back — full analysis + summary stored to memory on session.deleted
  • Harvest integration — optional post-session batch analysis via POST /api/harvest
  • Self-hosted — runs locally on HTTPS (self-signed cert supported)

Key implementation finding

The chat.message hook type exists in @opencode-ai/plugin but OpenCode never triggers plugin.trigger("chat.message", ...) anywhere in the server source. After a day of debugging a "loading plugin" that silently did nothing, we traced through the plugin loader (packages/opencode/src/plugin/index.ts) and confirmed the trigger call site does not exist.

Working approach: Use the event hook with bus subscription:

  • message.part.updated → carries full text content in event.properties.part.text for TextPart
  • session.created / session.deleted → lifecycle management
  • message.updated → carry only metadata, not content

This would be a great addition to the plugin docs.

Hooks used

Hook Purpose
event Bus subscription — message.part.updated, session.created, session.deleted
experimental.chat.system.transform Memory injection into system prompt
experimental.session.compacting Memory preservation during compaction

TLS tip

Bun's fetch() ignores the tls: { rejectUnauthorized: false } option. For self-signed certs, use new https.Agent({ rejectUnauthorized: false }) from node:https — it works reliably across Node.js and Bun.

Plugin file

https://github.com/doobidoo/mcp-memory-service/blob/main/opencode/memory-plugin.js (~820 lines, zero external deps)

Config

https://github.com/doobidoo/mcp-memory-service/blob/main/opencode/memory-plugin.config.example.json

Activity

  1. github-actions commented on May 23, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • This issue doesn't use one of the three required templates: Bug Report, Feature Request, or Question. "Show & Tell" / showcase posts aren't a supported issue type. If you'd like to share this plugin, please resubmit as a Feature Request (e.g. [FEATURE]: Add mcp-memory-service to ecosystem plugins) using the feature request template, with the verification checkbox checked and a description of the enhancement.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. doobidoo commented on May 23, 2026

    @doobidoo
    Author

    @anomalyco/maintainers — this isn't a vanity post. It documents a gap in the plugin docs:

    • chat.message is listed in @opencode-ai/plugin Hooks interface but never triggered by the session processor
    • We traced through packages/opencode/src/plugin/index.ts to confirm
    • The event hook (bus subscription) is the only way to capture message content — and this isn't documented either

    This directly relates to #22831 (feature request to expose body to chat.message) and #23440 (chat.message crash). We've added our findings with concrete workarounds to both.

    If this issue type isn't supported, that's fine — the information is already linked from the related issues. But it would be useful for other plugin developers who hit the same dead end.

  3. github-actions commented on May 23, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions