← Back to blog
2025-12-206 min read

Integrating shodh-memory with Claude Code and Cursor via MCP

mcpintegrationtutorial
mcp-integration-claude-cursor.md

Integrating shodh-memory with Claude Code and Cursor

The Model Context Protocol (MCP) lets AI assistants use external tools. Here's how to give Claude Code persistent memory in 60 seconds.

Quick Start

```bash

One command to add memory to Claude Code

claude mcp add shodh-memory npx -y @shodh/memory-mcp

```

That's it. Claude now remembers across sessions.

What Claude Can Now Do

After installation, Claude has these new capabilities:

remember

Store important context for later:

```

User: Remember that this project uses PostgreSQL 15

Claude: [Stores memory with tags: database, postgresql, infrastructure]

```

recall

Search past context semantically:

```

User: What database does this project use?

Claude: [Recalls: "This project uses PostgreSQL 15"]

```

proactive_context

Automatically surface relevant memories:

```

User: Help me optimize this SQL query

Claude: [Auto-retrieves database preferences, past optimization discussions]

```

Cursor Integration

For Cursor, add to your MCP settings:

```json

{

"mcpServers": {

"shodh-memory": {

"command": "npx",

"args": ["-y", "@shodh/memory-mcp"],

"env": {

"SHODH_USER_ID": "cursor-user"

}

}

}

}

```

Memory Isolation

Each user/project can have isolated memory:

```bash

Per-project memory

SHODH_USER_ID=project-frontend npx @shodh/memory-mcp

Per-user memory

SHODH_USER_ID=$(whoami) npx @shodh/memory-mcp

```

What Gets Remembered

By default, shodh-memory stores:

Explicit user preferences
Important decisions and their rationale
Learned patterns about the codebase
Error resolutions for future reference

It does NOT store:

Conversation logs (privacy)
Secrets or credentials (security)
Temporary debugging context

Verification

Test that memory is working:

```

User: Remember that I prefer functional programming patterns

Claude: Stored. I'll keep this preference in mind.

[New session]

User: How should I structure this data transformation?

Claude: Based on your preference for functional patterns,

I'd suggest using map/filter/reduce rather than loops...

```

Troubleshooting

```bash

Check if MCP server is running

claude mcp list

View stored memories

curl http://localhost:3030/api/memories

Reset memory (fresh start)

rm -rf ~/.shodh-memory/data

```