The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Pg Mnemosyne MCP listing page.
A Model Context Protocol (MCP) server that provides AI assistants with a robust "super memory", task tracker, and dynamic PostgreSQL database management capabilities.
Install the package globally:
pipx, run: pip install pg-mnemosyne-mcp --break-system-packages)Auto-configure all your AI agents (Claude, Gemini, Qwen, Cursor, etc.) at once:
(Be sure to replace user and password with your actual PostgreSQL username and database password!)
Restart your AI agents. You're done!
asyncpg.create_pool) for instant sub-millisecond database queries.Users will need to provide their PostgreSQL credentials using the PG_BASE_DSN environment variable. This is a standard connection string:
postgresql://<USERNAME>:<PASSWORD>@<HOST>:<PORT>/<DEFAULT_DB>
The exact location depends on which AI client you are using. You need to add the server configuration to your client's MCP settings file.
For Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonFor Cursor:
Settings > Features > MCP and add a new MCP server, or edit your project's .cursor/mcp.json.For Roo Code / Cline (VS Code):
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json (Mac) or the equivalent Windows path.For Gemini CLI & Qwen CLI:
~/.gemini/settings.json or ~/.qwen/settings.json).For Claude Code CLI:
~/.claude.json.For Codex CLI:
~/.codex/config.toml (TOML format).For Windsurf IDE:
~/.codeium/windsurf/mcp_config.json.For Antigravity CLI (agy): Antigravity uses a plugin-based system. To add the server:
mkdir -p ~/.gemini/config/plugins/pg-mnemosyne~/.gemini/config/plugins/pg-mnemosyne/mcp_config.json with the Standard Template below.~/.gemini/config/import_manifest.json under the "imports" array:
Configuration Template (Claude Desktop, Cursor, Roo Code, Gemini CLI, Claude Code, Antigravity, Windsurf):
For OpenCode:
~/.config/opencode/opencode.jsonc.Configuration Template (OpenCode):
This starts the MCP server using standard input/output.
The pg-mnemosyne command also acts as a standalone CLI for managing your data and configuring agents.
You can automatically configure all supported AI agents (Claude, Gemini, Qwen, Cursor, etc.) with a single command:
You can add and list records directly from your terminal:
Pg-Mnemosyne includes specialized schemas to help complex multi-agent setups (e.g. Gemini CLI, Codex CLI, Roo Code, Claude Desktop) coordinate on the same project:
Spin up a dedicated tasks table with fields for statuses (backlog, todo, in_progress, blocked, done), priority levels (low, medium, high, critical), tags, and deadlines:
Avoid merge conflicts, double-coding, and redundant compiler troubleshooting by initializing the shared agent_sessions coordination table:
When active, agents use the update_agent_session and get_active_sessions MCP tools to register their current editing files and active subtasks, creating a real-time bulletin board for mutual visibility!
create_project_db(db_name: str): Creates a new isolated PostgreSQL database.init_schema(db_name: str): Initializes the base records table.init_todo_schema(db_name: str): Initializes a professional tasks table.init_coordination_schema(db_name: str): Initializes the multi-agent agent_sessions table.add_column(db_name: str, table: str, column_name: str, data_type: str): Dynamically adds a column to any table.add_record(db_name: str, type: str, content: str, tags: list[str]): Adds a memory/todo record.get_records(db_name: str, type: str = None, limit: int = 50): Retrieves recent records.update_record(db_name: str, record_id: int, content: str = None, tags: list[str] = None, status: str = None): Partially updates a record.delete_record(db_name: str, record_id: int): Deletes a record by ID.update_agent_session(db_name: str, agent_name: str, active_task: str, active_file: str = None, status: str = "active"): Registers/updates active agent state.get_active_sessions(db_name: str): Lists active agent coordination sessions.run_sql(db_name: str, query: str): Runs arbitrary SQL (SELECT, INSERT, DDL, etc.).