Skip to content

Feature: Plugin should inherit MCP server env vars from environment #375

Closed

Description

@anthony-spruyt

Problem

The Claude Code plugin hardcodes the MCP server config to localhost:3111. When agentmemory is deployed remotely (e.g., Kubernetes cluster accessed via reverse proxy, or cluster-internal DNS), users must add a duplicate entry in .mcp.json with the correct AGENTMEMORY_URL and AGENTMEMORY_SECRET env vars.

This causes a permanent /doctor warning:

MCP server "agentmemory" skipped — same command/URL as already-configured "agentmemory"

Both entries are needed because:

  • Plugin: provides hooks (observation capture, session lifecycle)
  • .mcp.json: provides MCP server with correct URL/auth env vars

Requested Behavior

Plugin should support env var overrides for its MCP server config, either:

  1. Read AGENTMEMORY_URL and AGENTMEMORY_SECRET from the environment when available instead of hardcoding localhost
  2. Detect an existing .mcp.json entry and skip its own MCP server definition (without the warning)
  3. Allow plugin config to specify env var overrides

Use Cases

  • Kubernetes deployment with cluster-internal DNS (http://agentmemory.agentmemory.svc.cluster.local:3111)
  • Remote server behind reverse proxy with API key auth
  • Any non-localhost deployment where hooks are still needed

Activity

  1. rohitg00 commented on May 18, 2026

    @rohitg00
    Owner

    Shipped in v0.9.19 via #460 — https://github.com/rohitg00/agentmemory/releases/tag/v0.9.19

    Thanks @anthony-spruyt for the careful repro on the doctor warning + the three concrete options. Went with #1 (env passthrough via ${VAR} expansion). One wired MCP entry now covers local + k8s + reverse-proxied deployments without duplicates.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions