Skip to content
Palimem Docsspec v1.7.0

Use Palimem with VS Code + Copilot Agent

Connect Palimem to VS Code (Copilot Agent and other VS Code MCP clients) using ai-memory connect vscode. The helper merges a memory-service stdio entry into .vscode/mcp.json.


  • VS Code with MCP support (Copilot Agent or compatible extension)
  • Node.js 18+
  • Repository cloned and Node dependencies installed:
    Terminal window
    cd app && npm install

From your repository root:

Terminal window
node app/scripts/ai-memory.js connect vscode \
--project-root "$(pwd)" \
--data-dir .ai-memory/data

This writes .vscode/mcp.json in the project. Reload the VS Code window so MCP servers are picked up.


The committed sample lives at examples/vscode-copilot-agent/.vscode/mcp.json.sample:

{
"servers": {
"memory-service": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/repo/app/scripts/memory-service-mcp.js"],
"env": {
"MEMORY_SERVICE_DATA_DIR": "/absolute/path/to/repo/.ai-memory/data"
}
}
}
}

VS Code uses a top-level servers object (not mcpServers). Use absolute paths; ai-memory connect vscode resolves them automatically.


  1. Reload VS Code after writing the config.
  2. Ask the agent to call tools/list, then memory_status with scope repository and your project namespace.

tools/list — expect 11 tools.

memory_status — expect ok: true and index_status.state: "current".

Smoke test (non-interactive):

Terminal window
bash examples/vscode-copilot-agent/demo/vscode-copilot-smoke.sh

Paste this into Copilot Agent to configure Palimem:

Set up Palimem as governed local memory for this VS Code project.
- Project: Palimem (spec v1.7.0)
- Run: node app/scripts/ai-memory.js connect vscode --project-root "$(pwd)" --data-dir .ai-memory/data
- Verify: tools/list (11 tools), then memory_status — expect ok and index_status current
Use local data directory .ai-memory/data. Do not enable cloud services.

Flag Purpose
--project-config PATH Target .vscode/mcp.json (default: <project-root>/.vscode/mcp.json)
--project-root PATH Repo root for resolving script paths (default: $PWD)
--data-dir PATH MEMORY_SERVICE_DATA_DIR resolved to absolute (default: .ai-memory/data)
--replace Overwrite existing memory-service entry
--dry-run Print merged JSON without writing

MCP server not listed in VS Code

Reload the window after writing .vscode/mcp.json. VS Code reads MCP config on startup.

ENOENT on memory-service-mcp.js

Run cd app && npm install to install the Node wrapper.

Existing entry refused

Re-run with --replace:

Terminal window
node app/scripts/ai-memory.js connect vscode \
--project-root "$(pwd)" --data-dir .ai-memory/data --replace

Tools show 9 instead of 11

Pull the latest main and reinstall. memory_query_temporal and memory_audit_export were added in spec v1.6.0.


Terminal window
python3 app/import_markdown.py \
--data-dir .ai-memory/data \
examples/markdown/USER.md.sample \
examples/markdown/MEMORY.md.sample