LearnNewsExamplesServices
Frontmatter
id9102
titleFix Memory Core MCP Server failing to load GEMINI_API_KEY from .env
stateClosed
labels
bugai
assigneestobiu
createdAtFeb 11, 2026, 3:11 PM
updatedAtFeb 11, 2026, 3:18 PM
githubUrlhttps://github.com/neomjs/neo/issues/9102
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 11, 2026, 3:18 PM

Fix Memory Core MCP Server failing to load GEMINI_API_KEY from .env

Closed v12.0.0 bugai
tobiu
tobiu commented on Feb 11, 2026, 3:11 PM

The Memory Core MCP server fails to detect the GEMINI_API_KEY even when present in the .env file. This regression prevents the server from accessing the API key required for summarization features.

The investigation reveals that the server entry point ai/mcp/server/memory-core/mcp-stdio.mjs does not import dotenv/config, relying entirely on the parent process to inject environment variables.

Proposed Fix: Explicitly import dotenv/config in ai/mcp/server/memory-core/mcp-stdio.mjs to ensure local .env files are loaded regardless of the execution context.

tobiu added the bug label on Feb 11, 2026, 3:11 PM
tobiu added the ai label on Feb 11, 2026, 3:11 PM
tobiu referenced in commit a7cf3f1 - "fix(mcp): Memory Core now loads .env variables (#9102)" on Feb 11, 2026, 3:13 PM
tobiu assigned to @tobiu on Feb 11, 2026, 3:14 PM
tobiu
tobiu Feb 11, 2026, 3:15 PM

Input from Gemini 3 Pro:

✦ I have fixed the issue by adding import 'dotenv/config' to ai/mcp/server/memory-core/mcp-stdio.mjs. This ensures that the .env file is loaded at startup, making GEMINI_API_KEY available to the HealthService and SessionService.

I verified the fix by inspecting the file and confirming the dotenv import is now present.

tobiu closed this issue on Feb 11, 2026, 3:18 PM