Skip to content

Claude Code Integration

Vheins x C.O.R.E edited this page Aug 14, 2026 · 1 revision

Integration with Claude Code

Complete guide for connecting MCP Local Memory Service to Claude Code — Anthropic's CLI AI agent.

Prerequisites

  • Node.js 20+ installed
  • Claude Code installed (npm install -g @anthropic-ai/claude-code)
  • Internet access for first-time setup (embedding model downloads once)

Installation

Option 1: Quick Start (npx — no permanent install)

Suitable for a first try. Each time Claude Code starts, npx will run the package from npm:

claude mcp add --transport stdio --scope project local-memory -- npx -y @vheins/local-memory-mcp

Option 2: Global Install (recommended)

Install the package permanently — faster startup, no re-download:

npm install -g @vheins/local-memory-mcp
claude mcp add --transport stdio --scope project local-memory -- local-memory-mcp

Option 3: Local Install (via project package.json)

If your project already has a package.json:

npm install --save-dev @vheins/local-memory-mcp
claude mcp add --transport stdio --scope project local-memory -- npx @vheins/local-memory-mcp

Configuration Scope

Use --scope as needed:

Scope File Shared? Best for
project .mcp.json in project root Yes (via git) All team members share the same memory
local ~/.claude.json No Just for you
user ~/.claude.json (global) No You across all projects

Example:

# Just for you, in this project
claude mcp add --transport stdio --scope local local-memory -- npx -y @vheins/local-memory-mcp

# All team members
claude mcp add --transport stdio --scope project local-memory -- npx -y @vheins/local-memory-mcp

Verification

claude mcp list

Output:

local-memory (project) — running
  Tools: memory-read, memory-write, task-read, ...

Inside Claude Code, /mcp shows the local-memory server with its available tools. Test the connection by asking:

"Check local memory for this project"

If Claude responds with "No memory found" (not an error), the connection is successful.

Manual Configuration (.mcp.json)

If you prefer to edit the .mcp.json file directly (e.g. for version control), create the file in the project root:

{
	"mcpServers": {
		"local-memory": {
			"command": "npx",
			"args": ["-y", "@vheins/local-memory-mcp"],
			"type": "stdio"
		}
	}
}

Or for global install:

{
	"mcpServers": {
		"local-memory": {
			"command": "local-memory-mcp",
			"type": "stdio"
		}
	}
}

Environment Variables

The server detects the active repository automatically from the current working directory and any MCP workspace roots (it also reads the git remote to infer the owner). You can override storage or ports during registration:

claude mcp add --transport stdio --scope project \
  --env STORAGE_PATH=/custom/path \
  local-memory -- npx -y @vheins/local-memory-mcp

Or in .mcp.json:

{
	"mcpServers": {
		"local-memory": {
			"command": "local-memory-mcp",
			"args": [],
			"env": {
				"PORT": "3456"
			}
		}
	}
}

Daily Workflow with Claude Code

You say Claude does
"Claude, check pending tasks for this project." calls task-read and displays the tasks to work on
"Note that we decided to use Prisma ORM because it's more mature." calls memory-write with type decision
"What do we know about authentication in this project?" calls memory-read (and synthesize if it needs an LLM-grounded answer)
"Task LOGIN-001 is done, commit is at abc123." calls task-write with status completed

Running the Dashboard

Claude Code can also run the web dashboard:

# From CLI (separate from Claude Code)
npx @vheins/local-memory-mcp dashboard
# Open http://localhost:3456

Or ask Claude to run it — keep in mind Claude Code must remain running in a separate terminal.

Troubleshooting for Claude Code

  • "local-memory" not found in /mcp: check with claude mcp list, then re-register: claude mcp remove local-memory and claude mcp add --transport stdio --scope project local-memory -- npx -y @vheins/local-memory-mcp.
  • Server crashes / disconnected: check the error log with claude mcp get local-memory, or run directly to see errors: npx -y @vheins/local-memory-mcp.
  • Tools not showing even though server is running: Claude Code supports list_changed notifications, so new tools should appear automatically; if not, refresh with /mcp or restart Claude Code.
  • Slow startup: if using npx, each startup can be slow due to download/cache check — use the global install (Option 2).

Disabling / Removing

claude mcp remove local-memory

To temporarily disable, use the /mcp panel inside Claude Code.

References

Clone this wiki locally