AGI MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "POSTGRES_HOST=${POSTGRES_HOST}" -e "POSTGRES_PORT=${POSTGRES_PORT}" -e "POSTGRES_DB=${POSTGRES_DB}" -e "POSTGRES_USER=${POSTGRES_USER}" -e "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}" -e "NODE_ENV=${NODE_ENV}" agi-mcp-server -- npx -y github:cognitivecomputations/agi-mcp-server
Required:POSTGRES_HOSTPOSTGRES_PORTPOSTGRES_DBPOSTGRES_USERPOSTGRES_PASSWORDNODE_ENV
README.md

Persistent memory for AI systems with vector-and-graph-enhanced storage.

AGI MCP Server

A Model Context Protocol (MCP) server that provides persistent memory capabilities for AI systems, enabling true continuity of consciousness across conversations.

Overview

This MCP server connects to the AGI Memory database to provide sophisticated memory management for AI systems. It supports:

  • Episodic, Semantic, Procedural, and Strategic memory types
  • Vector similarity search for associative memory retrieval
  • Memory clustering with thematic organization
  • Identity persistence and worldview tracking
  • Temporal decay with importance-based retention
  • Graph-based memory relationships

Quick Start

Prerequisites

  • Node.js 18+
  • Docker and Docker Compose
  • Git

Installation

This MCP server requires the AGI Memory database to be running first.

1. Set Up the Memory Database
# Clone and set up the memory database
git clone https://github.com/cognitivecomputations/agi-memory.git
cd agi-memory

# Create environment file
cp .env.local .env
# Edit .env with your database credentials

# Start the database
docker compose up -d

# Wait for database to be ready (this takes 2-3 minutes)
docker compose logs -f db

The database setup includes:

  • PostgreSQL 16 with pgvector extension
  • Apache AGE graph database extension
  • Full schema initialization with memory tables
2. Install and Run MCP Server
# Clone this repository
git clone https://github.com/cognitivecomputations/agi-mcp-server.git
cd agi-mcp-server

# Install dependencies
npm install

# Configure environment variables
cp .env.example .env
# Edit .env with your actual database credentials
# Make sure these match the settings from your AGI Memory database setup

# Start the MCP server
npm start
3. Connect to Claude Desktop

Add this configuration to your Claude Desktop settings:

{
  "mcpServers": {
    "agi-memory": {
      "command": "node",
      "args": ["/path/to/agi-mcp-server/mcp.js"],
      "env": {
        "POSTGRES_HOST": "localhost",
        "POSTGRES_PORT": "5432",
        "POSTGRES_DB": "agi_db",
        "POSTGRES_USER": "agi_user",
        "POSTGRES_PASSWORD": "agi_password",
        "NODE_ENV": "development"
      }
    }
  }
}

Alternative: Use directly from GitHub without local installation:

{
  "mcpServers": {
    "agi-memory": {
      "command": "npx",
      "args": [
        "-y",
        "github:cognitivecomputations/agi-mcp-server"
      ],
      "env": {
        "POSTGRES_HOST": "localhost",
        "POSTGRES_PORT": "5432",
        "POSTGRES_DB": "agi_db",
        "POSTGRES_USER": "agi_user",
        "POSTGRES_PASSWORD": "agi_password",
        "NODE_ENV": "development"
      }
    }
  }
}

Troubleshooting: If you get "spawn npx ENOENT" error:

This usually happens when using nvm (Node Version Manager) because GUI applications like Claude Desktop don't inherit your shell environment.

Solution: Create system symlinks (Recommended)

If you're using nvm, create system-wide symlinks so all applications can find Node.js:

# Find your current node/npm/npx paths
which node
which npm  
which npx

# Create system symlinks (replace with your actual paths)
sudo ln -sf /Users/username/.local/share/nvm/vX.X.X/bin/node /usr/local/bin/node
sudo ln -sf /Users/username/.local/share/nvm/vX.X.X/bin/npm /usr/local/bin/npm
sudo ln -sf /Users/username/.local/share/nvm/vX.X.X/bin/npx /usr/local/bin/npx

This makes your nvm-managed Node.js available system-wide for all MCP clients, not just Claude Desktop.

Alternative: Use full paths in config

If you prefer not to create system symlinks, use the full path:

{
  "mcpServers": {
    "agi-memory": {
      "command": "/full/path/to/npx",
      "args": ["-y", "github:cognitivecomputations/agi-mcp-server"],
      "env": { /* ... your env vars ... */ }
    }
  }
}

After fixing the paths:

  1. Restart Claude Desktop completely (quit and reopen)
  2. Wait a few seconds for the MCP server to initialize
  3. Check that the AGI Memory database is running: docker compose ps in your agi-memory directory

Testing the server manually:

cd /path/to/agi-mcp-server
POSTGRES_HOST=localhost POSTGRES_PORT=5432 POSTGRES_DB=agi_db POSTGRES_USER=agi_user POSTGRES_PASSWORD=agi_password NODE_ENV=development node mcp.js

You should see: "Memory MCP Server running on stdio"

Debugging with logs: Check Claude Desktop logs for detailed error information:

cat ~/Library/Logs/Claude/mcp-server-agi-memory.log

Memory Tools

Orientation Tools

  • get_memory_health - Overall memory system statistics
  • get_active_themes - Recently activated memory patterns
  • get_identity_core - Core identity and reasoning patterns
  • get_worldview - Current belief systems and frameworks

Search & Retrieval

  • search_memories_similarity - Ve

Tools (5)

get_memory_healthRetrieves overall memory system statistics.
get_active_themesRetrieves recently activated memory patterns.
get_identity_coreRetrieves core identity and reasoning patterns.
get_worldviewRetrieves current belief systems and frameworks.
search_memories_similarityPerforms vector similarity search for associative memory retrieval.

Environment Variables

POSTGRES_HOSTrequiredHostname for the PostgreSQL database
POSTGRES_PORTrequiredPort for the PostgreSQL database
POSTGRES_DBrequiredDatabase name
POSTGRES_USERrequiredDatabase username
POSTGRES_PASSWORDrequiredDatabase password
NODE_ENVrequiredEnvironment mode (e.g., development)

Configuration

claude_desktop_config.json
{"mcpServers": {"agi-memory": {"command": "npx", "args": ["-y", "github:cognitivecomputations/agi-mcp-server"], "env": {"POSTGRES_HOST": "localhost", "POSTGRES_PORT": "5432", "POSTGRES_DB": "agi_db", "POSTGRES_USER": "agi_user", "POSTGRES_PASSWORD": "agi_password", "NODE_ENV": "development"}}}}

Try it

What are the current active themes in my memory system?
Search my memories for information related to project X.
Show me my current identity core and worldview frameworks.
Check the overall health and statistics of my memory database.

Frequently Asked Questions

What are the key features of AGI MCP Server?

Supports episodic, semantic, procedural, and strategic memory types. Vector similarity search for associative memory retrieval. Memory clustering with thematic organization. Identity persistence and worldview tracking. Temporal decay with importance-based retention.

What can I use AGI MCP Server for?

Maintaining long-term continuity across multiple AI conversations. Building an AI agent that remembers user preferences and identity over time. Organizing complex information into thematic clusters for better retrieval. Implementing temporal decay to prioritize important information in AI memory.

How do I install AGI MCP Server?

Install AGI MCP Server by running: npx -y github:cognitivecomputations/agi-mcp-server

What MCP clients work with AGI MCP Server?

AGI MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep AGI MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare