Skip to main content
GitHub Copilot CLI supports MCP. Connect Agent Memory to give Copilot persistent memory of your codebase architecture, conventions, and past decisions. Once connected, Copilot can reference what it learned in earlier sessions — the JWT middleware you chose, the test patterns you follow, the bug you already fixed twice.

Connect Copilot CLI

1

Start the Agent Memory server

In a separate terminal, start the memory server before launching Copilot:
agentmemory
The server runs on port 3111. Keep this terminal open.
2

Wire Agent Memory into Copilot

Run the connect command:
agentmemory connect copilot-cli
This merges mcpServers.agentmemory into ~/.copilot/mcp-config.json (or $COPILOT_HOME/mcp-config.json when COPILOT_HOME is set), preserving any existing MCP server entries.
3

Restart Copilot

Copilot picks up MCP servers on next launch or after running /mcp inside a session.

Full Plugin Install (hooks and skills)

For the complete experience with lifecycle hooks and skills, install the plugin directly inside a Copilot session:
copilot plugin install rohitg00/agentmemory:plugin
The plugin adds hook-based automatic capture on top of the MCP tools, so Copilot captures context without you needing to ask it to remember things explicitly.

Manual MCP Config

If you prefer to configure it yourself, add this block to ~/.copilot/mcp-config.json:
{
  "mcpServers": {
    "agentmemory": {
      "type": "local",
      "command": "npx",
      "args": ["-y", "@agentmemory/mcp"],
      "env": {
        "AGENTMEMORY_URL": "${AGENTMEMORY_URL:-http://localhost:3111}",
        "AGENTMEMORY_SECRET": "${AGENTMEMORY_SECRET:-}",
        "AGENTMEMORY_TOOLS": "${AGENTMEMORY_TOOLS:-all}"
      },
      "tools": ["*"]
    }
  }
}
The "tools": ["*"] field tells Copilot to make all Agent Memory tools available. The "type": "local" field marks this as a locally-spawned MCP server.

What Copilot Remembers

Once Agent Memory is connected, Copilot builds a persistent picture of your project across sessions:

Project conventions and patterns

Naming conventions, folder structures, preferred libraries, and code style patterns observed across sessions.

Past bug fixes and root causes

When you fix a bug, Agent Memory records the root cause. Copilot can recall this context if a related issue comes up later.

Architecture decisions

Technology choices, dependency decisions, and the reasoning behind them — so Copilot understands why your project is structured the way it is.

Frequently accessed files

Files you touch often and their roles in the codebase, so Copilot understands what is important in your project.

Install Native Skills (optional)

After connecting, install Agent Memory’s skills to make Copilot more proactive about using memory:
npx skills add rohitg00/agentmemory -y
This installs 15 skills that teach Copilot when to call recall, save, and pattern-detection tools.

Verification

After connecting, start a new Copilot session and ask it about a past decision:
What do you remember about how authentication is set up in this project?
If Agent Memory has context from a previous session where you worked on auth, Copilot will surface it. If the session is fresh, ask it to use memory_recall directly:
Use memory_recall to search for any context about this project.
To check the server from your terminal:
agentmemory status
The real-time viewer at http://localhost:3113 shows all stored memories and when they were last accessed.

Windows Note

agentmemory connect copilot-cli is the one connect adapter that is Windows-safe. On Windows, the MCP server config uses cmd.exe under the hood to spawn npx. All other agentmemory connect adapters currently require macOS or Linux (or WSL2 on Windows).