# pg-mnemosyne-mcp

> pg-mnemosyne-mcp is an open-source MCP server for agent memory. MCP server giving AI assistants persistent memory, task tracking and PostgreSQL access. It is available on CLI, Self-hosted, macOS, Windows and Linux.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, macOS, Windows, Linux
- **Repository:** https://github.com/janadasroor/pg-mnemosyne-mcp
- **GitHub stars:** 4
- **License:** MIT
- **Categories:** [agent memory](https://ai-powered.com/categories/agent-memory)
- **Listing updated:** 2026-12-01

## About

Pg-Mnemosyne stores an assistant's notes, todos and coordination state in PostgreSQL rather than in a chat window. Once connected, an AI client can create a separate database per project, add tagged memory records, and update or delete them later from any session that points at the same server.

Beyond plain memory, it can set up a dedicated tasks table with statuses, priorities and deadlines, and an agent_sessions table where several coding agents register the files and subtasks they are working on. Its run_sql tool gives the assistant direct query and DDL access, and the schema can be altered on the fly with add_column.

The package is installed with pip or pipx and includes an init command that writes the server entry into the configuration files of common AI clients such as Claude Desktop, Cursor, Gemini CLI and Windsurf. It suits developers running several AI coding agents against one codebase who want shared state in a database they already operate.

## Features

- **Persistent tagged memory:** Records can be added, listed, updated and deleted by type, with tags attached to each item.
- **Per-project databases:** The assistant can create isolated PostgreSQL databases for different projects.
- **Task tracking schema:** A tasks table supports statuses from backlog to done, four priority levels, tags and deadlines.
- **Multi-agent session registry:** Agents register their active file and subtask so others can see what is in progress.
- **Dynamic schema changes:** Columns can be added to existing tables without recreating them.
- **Auto-configuration for AI clients:** A single init command writes the server entry into several supported AI client configs.

## Good for

- Keeping project notes and todos that persist across separate AI assistant sessions
- Coordinating several coding agents so they do not edit the same file at once
- Tracking tasks with priorities and deadlines from inside an assistant chat
- Running ad hoc SQL queries against a project database through an AI client

## Tools

From the tool list in its README, going by the names, 1 of 12 tools deletes data and 6 change data; 3 names don't say. From the server's own tool labels and tool names; not verified by us.

- `create_project_db` (name suggests: changes): Creates a new isolated PostgreSQL database.
- `init_schema`: Initializes the base records table.
- `init_todo_schema`: Initializes a tasks table.
- `init_coordination_schema`: Initializes the agent_sessions table.
- `add_column` (name suggests: changes): Adds a column to a table.
- `add_record` (name suggests: changes): Adds a memory or todo record.
- `get_records` (name suggests: reads): Retrieves recent records.
- `update_record` (name suggests: changes): Partially updates a record.
- `delete_record` (name suggests: deletes): Deletes a record by ID.
- `update_agent_session` (name suggests: changes): Registers or updates active agent state.
- `get_active_sessions` (name suggests: reads): Lists active agent coordination sessions.
- `run_sql` (name suggests: changes): Runs arbitrary SQL.

## FAQ

### How is the server started?

Run pg-mnemosyne run to start it over standard input and output, or let an AI client launch it from its MCP configuration.

### What database does pg-mnemosyne-mcp need?

A PostgreSQL connection string, supplied through the PG_BASE_DSN environment variable or the init command's --dsn option.

### Which AI clients are mentioned as supported?

The setup guide covers Claude Desktop, Claude Code, Cursor, Roo Code, Cline, Gemini CLI, Qwen CLI, Codex CLI, Windsurf, OpenCode and Antigravity.

### Is pg-mnemosyne-mcp free?

Yes. pg-mnemosyne-mcp is open source, so you can use and self-host it for free.

### What are the best alternatives to pg-mnemosyne-mcp?

The closest alternatives to pg-mnemosyne-mcp are Agent-MCP, Gnosis Memory, Compoid MCP and Memxus.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [Agent-MCP](https://ai-powered.com/mcp/agent-mcp-2): Agent-MCP is an open-source MCP server for multi-agent frameworks.
- [Gnosis Memory](https://ai-powered.com/mcp/gnosis-memory): Gnosis Memory is a freemium MCP server for knowledge and memory.
- [Compoid MCP](https://ai-powered.com/mcp/compoid-mcp): Compoid MCP is an open-source MCP server for agent memory.
- [Memxus](https://ai-powered.com/mcp/memxus): Memxus is an MCP server for agent memory.

---
Source: https://ai-powered.com/mcp/pg-mnemosyne-mcp
