You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Show & Tell: MCP Memory Service — semantic memory plugin working with event hook #29022
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.
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 triggersplugin.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
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.
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:
@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.
Activity
github-actions commentedon May 23, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[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:
chat.messageplugin hook (directly related to your finding aboutchat.messagenot being triggered)chat.messageplugin hook:SyncEvent.run: "sessionID" required but not foundwhen pushing tooutput.parts#23440: Bug report aboutchat.messageplugin hook failing withSyncEvent.run: "sessionID" requiredIf you believe this was flagged incorrectly, please let a maintainer know.
doobidoo commentedon May 23, 2026
@anomalyco/maintainers — this isn't a vanity post. It documents a gap in the plugin docs:
chat.messageis listed in@opencode-ai/pluginHooks interface but never triggered by the session processorpackages/opencode/src/plugin/index.tsto confirmeventhook (bus subscription) is the only way to capture message content — and this isn't documented eitherThis 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.
github-actions commentedon May 23, 2026
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.