Skip to content

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

@anthony-spruyt

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

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