MCP.Market

Psycopg2 MCP server

by daedalus·io.github.daedalus/mcp-psycopg2·v0.1.0

MCP server exposing psycopg2 PostgreSQL database adapter functionality

B82/100grade B
What users say
No reviews yet
Be the first
Safety scan
B82/100

full report

Adoption
New

0 stars12 downloads/wk

Reviews

Write one

Nobody has reviewed Psycopg2 yet.

If you have run it, two minutes of your experience saves the next person an afternoon.

Psycopg2 tools (37, 10 write)

write = sends, deletes, buys or posts

Read from the package source without running it. The installed server may list more.

  • begin_transaction

    Begin a new transaction.

  • cancel_querywrite action

    Cancel the current database operation.

  • close_connection

    Close an existing database connection.

  • close_cursor

    Close a database cursor.

  • commit_transaction

    Commit the current transaction.

  • connectwrite action

    Create a new PostgreSQL database connection.

  • copy_expertwrite action

    Execute custom COPY statement.

  • copy_from

    Copy data from a file-like object to a table.

  • copy_to

    Copy data from a table to a file-like object.

  • create_cursorwrite action

    Create a new database cursor.

  • create_large_objectwrite action

    Create or open a large object.

  • create_named_cursorwrite action

    Create a server-side named cursor.

  • execute_manywrite action

    Execute a SQL query with multiple parameter sets.

  • execute_querywrite action

    Execute a SQL query.

  • fetch_all

    Fetch all remaining rows from cursor.

  • fetch_many

    Fetch multiple rows from cursor.

  • fetch_one

    Fetch one row from cursor.

  • get_backend_pid

    Get backend process ID.

  • get_connection_info

    Get information about a database connection.

  • get_dsn_parameters

    Get connection parameters.

  • get_notices

    Get database notices.

  • get_server_version

    Get PostgreSQL server version.

  • list_connections

    List all active connections.

  • list_cursors

    List all active cursors.

  • make_dsnwrite action

    Create a connection string from arguments.

  • mogrify

    Return query string after parameter binding.

  • parse_dsn

    Parse a connection string.

  • quote_identifier

    Quote an SQL identifier.

  • read_large_object

    Read from a large object.

  • register_composite

    Register composite type adapter.

  • register_hstore

    Register hstore type adapter.

  • register_json

    Register JSON type adapter.

  • rollback_transaction

    Rollback the current transaction.

  • scroll_cursor

    Scroll through cursor results.

  • set_isolation_level

    Set transaction isolation level.

  • set_session

    Set session parameters.

  • write_large_objectwrite action

    Write to a large object.

Public scan report

scanner v0.1.9 · 2026-09-27 · same rubric, same numbers if you re-run it

no findings
  • Code scan4 source files scanned25/25
  • –Live reliabilityno gateway calls yet and no remote to proben/a
  • –Tool poisoningtools not inspected (local package is not executed); not countedn/a
  • Auth qualitylocal package, no credentials required12/15
  • Maintenancelast push 159 days ago8/15
  • Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
Overall 82/100. Components that don't apply are left out of the denominator. Any critical finding is an F.RubricAppeal a findingJSON

How Psycopg2 compares

Against every graded Databases MCP server, from our own scans and uptime checks. Updated after each scan run.

Safety score
82/100
higher than 55% of 802 Databases servers
Tools
37
the typical Databases server has 8
Tools that change things
27%
typical: 10%. Fewer write tools means less an agent can break
Downloads a week
12
more than 3% of 324 Databases servers with a package

What its tools let an agent do: 20 read · 8 create · 6 change · 1 delete · 2 run or deploy

Install Psycopg2 in Claude Code, Cursor or VS Code

claude mcp add mcp-psycopg2 -- uvx mcp-psycopg2
Add to Cursor

What the publisher says

From the Psycopg2 repository's README, as published. We do not edit it. Read it on GitHub

mcp-psycopg2

MCP server exposing psycopg2 PostgreSQL database adapter functionality.

mcp-name: io.github.daedalus/mcp-psycopg2

Install

pip install mcp-psycopg2

Usage

from mcp_psycopg2 import mcp

# Run the MCP server
mcp.run()

MCP Tools

The server exposes the following tools for interacting with PostgreSQL databases:

Connection Management

  • connect - Create a new database connection
  • close_connection - Close an existing connection
  • getconnectioninfo - Get connection details

Transaction Management

  • begin_transaction - Start a new transaction
  • commit_transaction - Commit the current transaction
  • rollback_transaction - Rollback the current transaction
  • setisolationlevel - Set transaction isolation level

Cursor Operations

  • create_cursor - Create a new cursor
  • close_cursor - Close a cursor
  • execute_query - Execute a SQL query
  • execute_many - Execute a query with multiple parameter sets
  • fetch_one - Fetch one row
  • fetch_many - Fetch multiple rows
  • fetch_all - Fetch all remaining rows

SQL Composition

  • quote_identifier - Quote an SQL identifier
  • mogrify - Return query string after parameter binding

Type Registration

  • register_json - Register JSON type adapter
  • register_hstore - Register hstore type adapter
  • register_composite - Register composite type adapter

COPY Operations

  • copy_from - Copy data from file to table
  • copy_to - Copy data from table to file
  • copy_expert - Execute custom COPY statement

Server-Side Cursors

  • createnamedcursor - Create a server-side named cursor
  • scroll_cursor - Scroll through cursor results

Large Objects

  • createlargeobject - Create or open a large object
  • readlargeobject - Read from a large object
  • writelargeobject - Write to a large object

Information

  • getserverversion - Get PostgreSQL server version
  • getbackendpid - Get backend process ID
  • getdsnparameters - Get connection parameters
  • get_notices - Get database notices
  • parse_dsn - Parse a connection string
  • make_dsn - Create a connection string

Utility

  • cancel_query - Cancel the current database operation
  • set_session - Set session parameters
  • list_connections - List all active connections
  • list_cursors - List all active cursors

Development

git clone https://github.com/daedalus/mcp-psycopg2.git
cd mcp-psycopg2
pip install -e ".[test]"

# run tests
pytest

# format
ruff format src/ tests/

# lint
ruff check src/ tests/

# type check
mypy src/

Nothing above is checked by us. What we check is on the safety report.

Psycopg2: common questions

Is Psycopg2 MCP server safe?
Mostly: it is graded B (82/100). Read the Psycopg2 safety report
How do I install Psycopg2?
It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
Does Psycopg2 need an API key?
Not as far as the registry entry and our scan can tell: no credentials are declared or required.
Is Psycopg2 maintained?
The last commit was 195 days ago (2026-04-21). The latest release is v0.1.0.
What can I use instead of Psycopg2?
Servers from other publishers that do the same job: DBHub MCP server, Faucet MCP server and CogniCore MCP server.
How does Psycopg2 compare with other Databases MCP servers?
safety score 82/100 (higher than 55% of 802 Databases servers); tools 37 (the typical Databases server has 8); tools that change things 27% (typical: 10%. Fewer write tools means less an agent can break). Full comparison.

Alternatives to Psycopg2

Same job from other publishers: the closest match first, then the best rated.

  • DBHub
    Token-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite
    A
  • Faucet
    SQL database to MCP tools and REST API: PostgreSQL, MySQL, SQL Server, Oracle, SQLite, Snowflake.
    A
  • CogniCore
    Memory, reflection and safety for AI agents. Hosted or local, no vector database.
    A
  • Neo4j Cypher
    A simple Neo4j MCP server that allows you to run Cypher queries against a Neo4j database.
    A
  • Appwrite
    Build and deploy backends: auth, Postgres/MySQL/vector databases, storage, functions, hosting, CDN
    A

More from daedalus →