AiMemoryMcp 1.0.0

dotnet tool install --global AiMemoryMcp --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local AiMemoryMcp --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=AiMemoryMcp&version=1.0.0
                    
nuke :add-package AiMemoryMcp --version 1.0.0
                    

AI Memory MCP

A local MCP server that gives any AI assistant persistent memory. Save and retrieve Q&A responses across sessions using a local SQLite database.

Works with Claude Desktop, Claude Code, VS Code Copilot, Cursor, and any MCP-compatible client.

Install

Requires: .NET 8 SDK

dotnet tool install -g AiMemoryMcp

That's it. The database is created automatically at ~/.ai_memory.db.

Configure Your AI Client

Claude Desktop

Edit ~/.config/claude_desktop_config.json (Linux) or ~/Library/Application Support/Claude/claude_desktop_config.json (Mac):

{
  "mcpServers": {
    "ai-memory": {
      "command": "ai-memory-mcp"
    }
  }
}

Claude Code

Add to .claude/mcp.json or ~/.claude/mcp.json:

{
  "mcpServers": {
    "ai-memory": {
      "command": "ai-memory-mcp"
    }
  }
}

VS Code / Cursor

Add to .vscode/mcp.json:

{
  "servers": {
    "ai-memory": {
      "command": "ai-memory-mcp"
    }
  }
}

What It Does

Once configured, your AI assistant gets these tools:

Tool Description
SaveResponse Save a Q&A from any AI (ChatGPT, Gemini, Claude, etc.)
SearchResponses Search saved memories by keyword, with optional source filter
GetRecent Get the most recently saved responses
UpdateResponse Edit an existing saved response
DeleteResponse Delete a response by ID
ExportMemories Export all memories as JSON or Markdown
ListSources List all AI sources with response counts
ListAttachments List file attachments on a response
GetAttachmentInfo Get metadata for a specific attachment
GetConfig Show current database path and config

Stale entries (older than 90 days) are automatically flagged with [STALE] in results. Duplicate questions are detected and warned about on save.

REST API

A REST API runs alongside the MCP server on http://localhost:5100.

Method Endpoint Description
POST /api/responses Save a Q&A
PUT /api/responses/{id} Update a response
GET /api/responses/search?query=X Search responses
GET /api/responses/recent?limit=5 Get recent responses
GET /api/responses/export?format=json Export all (json or markdown)
DELETE /api/responses/{id} Delete a response
POST /api/responses/with-files Save with file attachments
GET /api/responses/{id}/attachments List attachments
GET /api/attachments/{id} Download an attachment
GET /api/sources List AI sources
GET /api/health Health check

Examples

# Save a response
curl -X POST http://localhost:5100/api/responses \
  -H "Content-Type: application/json" \
  -d '{"question":"How do I reverse a list in Python?","answer":"Use list.reverse() or list[::-1]","sourceAi":"chatgpt","tags":"python,lists"}'

# Search
curl "http://localhost:5100/api/responses/search?query=python"

# Update
curl -X PUT http://localhost:5100/api/responses/1 \
  -H "Content-Type: application/json" \
  -d '{"answer":"Updated answer text"}'

# Export as markdown
curl -o export.md "http://localhost:5100/api/responses/export?format=markdown"

Configuration

All configuration is via environment variables:

Variable Default Description
AI_MEMORY_DB_PATH ~/.ai_memory.db SQLite database file path
AIMEMORY_API_PORT 5100 REST API port
AI_MEMORY_STALE_DAYS 90 Days before a response is marked stale

Example with custom config:

{
  "mcpServers": {
    "ai-memory": {
      "command": "ai-memory-mcp",
      "env": {
        "AI_MEMORY_DB_PATH": "~/my-memories.db",
        "AIMEMORY_API_PORT": "5200",
        "AI_MEMORY_STALE_DAYS": "180"
      }
    }
  }
}

Build from Source

git clone https://github.com/sravanchenna/AiMemoryMcp.git
cd AiMemoryMcp/AiMemoryMcp
dotnet run

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.0 183 3/7/2026