← Back to search

io.github.daedalus/mcp-psycopg2

daedalus Scanned 24d ago

MCP server exposing psycopg2 PostgreSQL database adapter functionality

B
76 / 100

Versions

0.1.0latest
first seen May 19, 2026
PermissionsTool SafetyAuthAnnotationsCode QualityStabilitySpecVuln HistoryAuthorTransparencyCommunity

Tools 37

connect
annotations: none low

Create a new PostgreSQL database connection. Args: dbname: Database name to connect to. user: User name for authentication. password: Password for authentication. host: Database host address. port: Connection port number (default 5432). connection_id: Unique identifier for this connection (default 'default'). Returns: Connection ID if successful. Example: >>> connect(dbname="mydb", user="admin", password="secret", host="localhost") "default"

host str port int user str dbname str password str connection_id str
close_connection
annotations: none low

Close an existing database connection. Args: connection_id: The ID of the connection to close. Returns: Confirmation message. Example: >>> close_connection("default") "Connection closed"

connection_id str
get_connection_info
annotations: none low

Get information about a database connection. Args: connection_id: The ID of the connection. Returns: Dictionary containing connection information. Example: >>> get_connection_info("default") {"dbname": "test", "user": "postgres", "host": "localhost", ...}

connection_id str
begin_transaction
annotations: none low

Begin a new transaction. Args: connection_id: The ID of the connection. Returns: Confirmation message. Example: >>> begin_transaction("default") "Transaction started"

connection_id str
commit_transaction
annotations: none low

Commit the current transaction. Args: connection_id: The ID of the connection. Returns: Confirmation message. Example: >>> commit_transaction("default") "Transaction committed"

connection_id str
rollback_transaction
annotations: none low

Rollback the current transaction. Args: connection_id: The ID of the connection. Returns: Confirmation message. Example: >>> rollback_transaction("default") "Transaction rolled back"

connection_id str
set_isolation_level
annotations: none low

Set transaction isolation level. Args: level: Isolation level (AUTOCOMMIT, READ_UNCOMMITTED, READ_COMMITTED, REPEATABLE_READ, SERIALIZABLE, DEFAULT). connection_id: The ID of the connection. Returns: Confirmation message. Example: >>> set_isolation_level("READ_COMMITTED", "default") "Isolation level set"

level str connection_id str
create_cursor
annotations: none low

Create a new database cursor. Args: cursor_name: Name for server-side cursor (optional). connection_id: The ID of the connection. cursor_id: Custom cursor ID (defaults to auto-generated). scrollable: Whether cursor can scroll backwards. withhold: Whether cursor persists after commit. Returns: Cursor ID. Example: >>> create_cursor(connection_id="default") "cursor_default_1"

withhold bool cursor_id string scrollable string cursor_name string connection_id str
close_cursor
annotations: none low

Close a database cursor. Args: cursor_id: The ID of the cursor to close. Returns: Confirmation message. Example: >>> close_cursor("cursor_default_1") "Cursor closed"

cursor_id str
execute_query
annotations: none low

Execute a SQL query. Args: query: SQL query to execute. params: Query parameters (optional). cursor_id: Cursor ID to use (creates new if not provided). connection_id: Connection ID. Returns: Dictionary with query results and metadata. Example: >>> execute_query("SELECT * FROM users WHERE id = %s", [1]) {"rows": [[1, "john"]], "rowcount": 1, "columns": [...]}

query str params string cursor_id string connection_id str
execute_many
annotations: none low

Execute a SQL query with multiple parameter sets. Args: query: SQL query to execute. params_list: List of parameter sets. cursor_id: Cursor ID to use. connection_id: Connection ID. Returns: Dictionary with execution results. Example: >>> execute_many("INSERT INTO users (name) VALUES (%s)", [["alice"], ["bob"]]) {"rowcount": 2}

query str cursor_id string params_list string connection_id str
fetch_one
annotations: none low

Fetch one row from cursor. Args: cursor_id: Cursor ID. Returns: Row data as list, or None if no more rows. Example: >>> fetch_one("cursor_default_1") [1, "john"]

cursor_id str
fetch_many
annotations: none low

Fetch multiple rows from cursor. Args: cursor_id: Cursor ID. size: Number of rows to fetch. Returns: List of rows. Example: >>> fetch_many("cursor_default_1", 10) [[1, "john"], [2, "jane"]]

size int cursor_id str
fetch_all
annotations: none low

Fetch all remaining rows from cursor. Args: cursor_id: Cursor ID. Returns: List of all rows. Example: >>> fetch_all("cursor_default_1") [[1, "john"], [2, "jane"], [3, "bob"]]

cursor_id str
quote_identifier
annotations: none low

Quote an SQL identifier. Args: identifier: The identifier to quote. connection_id: Connection ID. Returns: Quoted identifier. Example: >>> quote_identifier("my_table") '"my_table"'

identifier str connection_id str
create_named_cursor
annotations: none low

Create a server-side named cursor. Args: name: Name for the cursor. query: Initial query to execute (optional). scrollable: Whether cursor can scroll backwards. withhold: Whether cursor persists after commit. connection_id: Connection ID. Returns: Cursor ID. Example: >>> create_named_cursor("my_cursor", "SELECT * FROM large_table") "cursor_default_1"

name str query string withhold bool scrollable bool connection_id str
scroll_cursor
annotations: none low

Scroll through cursor results. Args: cursor_id: Cursor ID. value: Offset or absolute position. mode: 'relative' or 'absolute'. Returns: Confirmation message. Example: >>> scroll_cursor("cursor_default_1", 10, "relative") "Cursor scrolled"

mode str value int cursor_id str
copy_from
annotations: none low

Copy data from a file-like object to a table. Args: table: Target table name. columns: Column names (optional). sep: Column separator. null: NULL representation. size: Buffer size. cursor_id: Cursor ID. connection_id: Connection ID. Returns: Status message. Example: >>> copy_from("my_table", columns=["id", "name"]) "Copied 100 rows"

sep str null str size int table str columns string cursor_id string connection_id str
copy_to
annotations: none low

Copy data from a table to a file-like object. Args: table: Source table name. columns: Column names (optional). sep: Column separator. null: NULL representation. cursor_id: Cursor ID. connection_id: Connection ID. Returns: Copied data as string. Example: >>> copy_to("my_table") "1\tjohn\n2\tjane\n"

sep str null str table str columns string cursor_id string connection_id str
copy_expert
annotations: none low

Execute custom COPY statement. Args: sql: COPY SQL statement. connection_id: Connection ID. Returns: Status message. Example: >>> copy_expert("COPY my_table TO STDOUT WITH CSV HEADER") "data\n1,john\n2,jane\n"

sql str connection_id str
get_server_version
annotations: none low

Get PostgreSQL server version. Args: connection_id: Connection ID. Returns: Server version as integer. Example: >>> get_server_version("default") 150005

connection_id str
get_backend_pid
annotations: none low

Get backend process ID. Args: connection_id: Connection ID. Returns: Backend PID. Example: >>> get_backend_pid("default") 12345

connection_id str
get_dsn_parameters
annotations: none low

Get connection parameters. Args: connection_id: Connection ID. Returns: Dictionary of DSN parameters. Example: >>> get_dsn_parameters("default") {"dbname": "test", "user": "postgres", "host": "localhost"}

connection_id str
get_notices
annotations: none low

Get database notices. Args: connection_id: Connection ID. Returns: List of notice messages. Example: >>> get_notices("default") ["NOTICE: CREATE TABLE will create implicit sequence..."]

connection_id str
parse_dsn
annotations: none low

Parse a connection string. Args: dsn: Connection string to parse. Returns: Dictionary of connection parameters. Example: >>> parse_dsn("dbname=test user=postgres") {"dbname": "test", "user": "postgres"}

dsn str
make_dsn
annotations: none low

Create a connection string from arguments. Args: dbname: Database name. user: User name. password: Password. host: Host address. port: Port number. Returns: Connection string. Example: >>> make_dsn(dbname="test", user="postgres", host="localhost") "dbname=test user=postgres host=localhost"

host string port string user string dbname string password string
register_json
annotations: none low

Register JSON type adapter. Args: connection_id: Connection ID. globally: Register globally. Returns: Confirmation message. Example: >>> register_json("default") "JSON type registered"

globally bool connection_id str
register_hstore
annotations: none low

Register hstore type adapter. Args: connection_id: Connection ID. globally: Register globally. unicode: Use unicode keys/values. Returns: Confirmation message. Example: >>> register_hstore("default") "Hstore type registered"

unicode bool globally bool connection_id str
register_composite
annotations: none low

Register composite type adapter. Args: name: Composite type name. connection_id: Connection ID. globally: Register globally. Returns: Confirmation message. Example: >>> register_composite("my_type", "default") "Composite type registered"

name str globally bool connection_id str
create_large_object
annotations: none low

Create or open a large object. Args: connection_id: Connection ID. oid: Object OID (0 for new). mode: Access mode (r, w, rw, n, b, t). Returns: Dictionary with OID and mode. Example: >>> create_large_object("default") {"oid": 12345, "mode": "rw"}

oid int mode str connection_id str
read_large_object
annotations: none low

Read from a large object. Args: oid: Object OID. size: Bytes to read (-1 for all). connection_id: Connection ID. Returns: Data read from large object. Example: >>> read_large_object(12345, "default") "binary data..."

oid int size int connection_id str
write_large_object
annotations: none low

Write to a large object. Args: data: Data to write. oid: Object OID (0 for new). connection_id: Connection ID. Returns: Dictionary with OID and bytes written. Example: >>> write_large_object("data", 0, "default") {"oid": 12345, "bytes_written": 4}

oid int data str connection_id str
cancel_query
annotations: none low

Cancel the current database operation. Args: connection_id: Connection ID. Returns: Confirmation message. Example: >>> cancel_query("default") "Query cancelled"

connection_id str
mogrify
annotations: none low

Return query string after parameter binding. Args: query: SQL query. params: Query parameters. connection_id: Connection ID. Returns: Mogrified query string. Example: >>> mogrify("INSERT INTO t VALUES (%s)", ["value"]) "INSERT INTO t VALUES (E'value')"

query str params string connection_id str
set_session
annotations: none low

Set session parameters. Args: isolation_level: Isolation level. readonly: Read-only mode. deferrable: Deferrable mode. autocommit: Autocommit mode. connection_id: Connection ID. Returns: Confirmation message. Example: >>> set_session(readonly=True, connection_id="default") "Session parameters set"

readonly string autocommit string deferrable string connection_id str isolation_level string
list_connections
annotations: none low

List all active connections. Returns: List of connection information. Example: >>> list_connections() [{"id": "default", "status": "OK"}]

list_cursors
annotations: none low

List all active cursors. Args: connection_id: Filter by connection ID. Returns: List of cursor information. Example: >>> list_cursors() [{"id": "cursor_default_1", "name": None, "closed": False}]

connection_id string

Permissions 0

No permissions indexed yet.

Scan Findings 93

low
Tool 'connect' has no annotations annotation_checker · 100%
low
Tool 'close_connection' has no annotations annotation_checker · 100%
low
Tool 'get_connection_info' has no annotations annotation_checker · 100%
low
Tool 'begin_transaction' has no annotations annotation_checker · 100%
low
Tool 'commit_transaction' has no annotations annotation_checker · 100%
low
Tool 'register_json' has no annotations annotation_checker · 100%
low
Tool 'rollback_transaction' has no annotations annotation_checker · 100%
low
Tool 'set_isolation_level' has no annotations annotation_checker · 100%
low
Tool 'create_cursor' has no annotations annotation_checker · 100%
low
Tool 'close_cursor' has no annotations annotation_checker · 100%
low
Tool 'execute_query' has no annotations annotation_checker · 100%
low
Tool 'execute_many' has no annotations annotation_checker · 100%
low
Tool 'fetch_one' has no annotations annotation_checker · 100%
low
Tool 'fetch_many' has no annotations annotation_checker · 100%
low
Tool 'fetch_all' has no annotations annotation_checker · 100%
low
Tool 'quote_identifier' has no annotations annotation_checker · 100%
low
Tool 'create_named_cursor' has no annotations annotation_checker · 100%
low
Tool 'scroll_cursor' has no annotations annotation_checker · 100%
low
Tool 'copy_from' has no annotations annotation_checker · 100%
low
Tool 'copy_to' has no annotations annotation_checker · 100%
low
Tool 'copy_expert' has no annotations annotation_checker · 100%
low
Tool 'get_server_version' has no annotations annotation_checker · 100%
low
Tool 'get_backend_pid' has no annotations annotation_checker · 100%
low
Tool 'get_dsn_parameters' has no annotations annotation_checker · 100%
low
Tool 'get_notices' has no annotations annotation_checker · 100%
low
Tool 'parse_dsn' has no annotations annotation_checker · 100%
low
Tool 'make_dsn' has no annotations annotation_checker · 100%
low
Tool 'register_hstore' has no annotations annotation_checker · 100%
low
Tool 'register_composite' has no annotations annotation_checker · 100%
low
Tool 'create_large_object' has no annotations annotation_checker · 100%
low
Tool 'read_large_object' has no annotations annotation_checker · 100%
low
Tool 'write_large_object' has no annotations annotation_checker · 100%
low
Tool 'cancel_query' has no annotations annotation_checker · 100%
low
Tool 'mogrify' has no annotations annotation_checker · 100%
low
Tool 'set_session' has no annotations annotation_checker · 100%
low
Tool 'list_connections' has no annotations annotation_checker · 100%
low
Tool 'list_cursors' has no annotations annotation_checker · 100%
info
Sandbox failed to start for behavioral verification behavioral_verifier · 100%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-5h2m-4q8j-pqpj) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-c2jp-c369-7pvx) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-m8x7-r2rg-vh5g) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-mxxr-jv3v-6pgc) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-rcfx-77hg-w2wv) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-rj5c-58rq-j5g5) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-rww4-4w9c-7733) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-vv7q-7jx5-f767) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (PYSEC-2026-1364) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (PYSEC-2026-1365) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (PYSEC-2026-2474) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (PYSEC-2026-2475) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (PYSEC-2026-2476) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (PYSEC-2026-338) dependency_analyzer · 95%
info
pyproject.toml metadata manifest_parser · 100%
info
Tool: connect manifest_parser · 90%
info
Tool: close_connection manifest_parser · 90%
info
Tool: get_connection_info manifest_parser · 90%
info
Tool: begin_transaction manifest_parser · 90%
info
Tool: commit_transaction manifest_parser · 90%
info
Tool: rollback_transaction manifest_parser · 90%
info
Tool: set_isolation_level manifest_parser · 90%
info
Tool: create_cursor manifest_parser · 90%
info
Tool: close_cursor manifest_parser · 90%
info
Tool: execute_query manifest_parser · 90%
info
Tool: execute_many manifest_parser · 90%
info
Tool: fetch_one manifest_parser · 90%
info
Tool: fetch_many manifest_parser · 90%
info
Tool: fetch_all manifest_parser · 90%
info
Tool: quote_identifier manifest_parser · 90%
info
Tool: create_named_cursor manifest_parser · 90%
info
Tool: scroll_cursor manifest_parser · 90%
info
Tool: copy_from manifest_parser · 90%
info
Tool: copy_to manifest_parser · 90%
info
Tool: copy_expert manifest_parser · 90%
info
Tool: get_server_version manifest_parser · 90%
info
Tool: get_backend_pid manifest_parser · 90%
info
Tool: get_dsn_parameters manifest_parser · 90%
info
Tool: get_notices manifest_parser · 90%
info
Tool: parse_dsn manifest_parser · 90%
info
Tool: make_dsn manifest_parser · 90%
info
Tool: register_json manifest_parser · 90%
info
Tool: register_hstore manifest_parser · 90%
info
Tool: register_composite manifest_parser · 90%
info
Tool: create_large_object manifest_parser · 90%
info
Tool: read_large_object manifest_parser · 90%
info
Tool: write_large_object manifest_parser · 90%
info
Tool: cancel_query manifest_parser · 90%
info
Tool: mogrify manifest_parser · 90%
info
Tool: set_session manifest_parser · 90%
info
Tool: list_connections manifest_parser · 90%
info
Tool: list_cursors manifest_parser · 90%
info
Sandbox failed to start for output poisoning scan output_poisoning · 100%
info
No dependency files found for SBOM generation sbom_generator · 100%
medium
No build provenance detected (SLSA L0) slsa_assessor · 90%