Conversation
Muse runs plugin hooks and MCP servers with a cleared environment, so SUPERMEMORY_API_URL set in the shell never reaches them, and the only way to point the plugin at a self-hosted server was a .muse/supermemory.json in every repo. getBaseUrl now also reads baseUrl from ~/.supermemory-muse/settings.json, after the env var and the project config. A settings.json that sets baseUrl but does not parse is an error rather than a silent fall back to the hosted API. When the base URL is not the hosted API, the MCP proxy does not forward to mcp.supermemory.ai unless mcpUrl or SUPERMEMORY_MCP_URL names an endpoint, and SessionStart says where to put a key instead of opening the hosted browser login. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Muse runs plugin hooks and plugin MCP servers with a fixed environment allowlist. On Muse Code 1.4.2, plugin hooks get 17 variables (PATH, HOME, the plugin paths, temp dirs and a few shell variables) and the MCP server gets the same plus
MUSE_SESSION_ID.SUPERMEMORY_API_URLset in the shell never reaches either, andmanaged_hooks_env_varsonly applies to managed hooks. I checked this with an env-dump plugin in an isolated Muse home.So today the only way to point this plugin at a self-hosted server is a
.muse/supermemory.jsonin every repo, which the docs also say. Any repo or folder without that file falls back tohttps://api.supermemory.aiand sends the self-hosted key, the prompt and the transcript there. Two related problems for self-hosted users:mcp.supermemory.aiwith the configured key, starting withinitialize.Change
getBaseUrlalso readsbaseUrlfrom~/.supermemory-muse/settings.json. Order:SUPERMEMORY_API_URL, the project config, this setting, thenhttps://api.supermemory.ai. The key name matches~/.codex/supermemory.jsonin codex-supermemory.settings.jsonthat mentionsbaseUrlbut does not parse (a trailing comma, say) is an error instead of a silent fall back to the hosted API. A leading byte order mark is ignored.SUPERMEMORY_MCP_URLor the newmcpUrlsetting names an endpoint.mcpUrlexists because the env var cannot reach the proxy under Muse.baseUrlsee no change./supermemory:statusdescribe the resolution order. Version 0.1.1 → 0.1.2 inpackage.jsonand.muse-plugin/plugin.json, as in 0b8ab0d; happy to drop the bump if you'd rather do it at release.Tests
node --test test/unit.mjs: 20 pass on Node 24 (Windows) and Node 22 (Linux).muse plugins validate .passes on Muse 1.4.2.New cases cover:
https://API.supermemory.ai,:443, a trailing slash) not being treated as self-hosted;mcpUrlwhen set, and still targetingmcp.supermemory.aiwith nobaseUrl;The script tests run with
test/no-network.cjspreloaded, which fails anyfetchand browser launch. 8 of the new cases fail onmain.I run this against a self-hosted server (Lite v0.0.8) across several machines, which is where the per-repo file stopped being workable.
🤖 Generated with Claude Code