DEV Community

THARAGESH .A
THARAGESH .A

Posted on • Originally published at agenthelm.online

How to Give Claude Code & Cursor Persistent Memory Across Sessions with MCP

Every time you start a new session in Cursor, Windsurf, or Claude Code, the AI agent starts with zero memory. It re-discovers your database schema, re-learns internal API patterns, and forgets architectural trade-offs you decided on yesterday.

To solve this, I created AgentHelm (agenthelm-mcp)β€”an open-source Model Context Protocol (MCP) server that acts as a versioned "Project Brain" for coding agents.

Here is how to set it up and how it works under the hood.

How It Works

AgentHelm uses a Brain Compiler pipeline to manage project knowledge:

  1. Context Fetching (get_context): When an agent starts, it queries versioned architecture guidelines, schemas, and conventions.
  2. Knowledge Proposals (propose_knowledge): When an agent learns a new pattern or settles a trade-off during execution, it proposes that decision back to the Project Brain.
  3. Brain Compiler: The compiler checks for conflicts and releases the next version of the Project Brain for all future sessions.

30-Second Setup for Cursor & Claude Desktop

Add agenthelm-mcp to your .cursor/mcp.json or claude_desktop_config.json:


json
{
  "mcpServers": {
    "agenthelm": {
      "command": "npx",
      "args": ["-y", "agenthelm-mcp"],
      "env": {
        "AGENTHELM_CONNECT_KEY": "YOUR_CONNECT_KEY_HERE",
        "AGENTHELM_PROJECT": "your-project-name"
      }
    }
  }
}
You can generate a free connection key at agenthelm.online.

Using Python or Node.js SDKs
If you run custom autonomous agents, you can also use the native SDKs:

Python
bash
pip install agenthelm-sdk
python
from agenthelm import Agent
agent = Agent(key="ahe_live_...", name="Architect Agent", project="My App")
context = agent.get_context(category="database")
print("Project Context:", context.entries)
Node.js
bash
npm install agenthelm-node-sdk
typescript
import { Agent } from 'agenthelm-node-sdk';
const agent = new Agent({ key: 'ahe_live_...', name: 'Worker', project: 'My App' });
Resources & Links
Platform: agenthelm.online
GitHub: github.com/jayasukuv11-beep/agenthelm
npm: agenthelm-mcp
I'd love feedback on how you currently manage agent state across sessions!
![ ](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/u3c80vbov23sou9l5z3o.png)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)