{
  "markdown": "# mcp-psycopg2\n\nMCP server exposing psycopg2 PostgreSQL database adapter functionality.\n\n[![PyPI](https://img.shields.io/pypi/v/mcp-psycopg2.svg)](https://pypi.org/project/mcp-psycopg2/)\n[![Python](https://img.shields.io/pypi/pyversions/mcp-psycopg2.svg)](https://pypi.org/project/mcp-psycopg2/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\nmcp-name: io.github.daedalus/mcp-psycopg2\n\n## Install\n\n```bash\npip install mcp-psycopg2\n```\n\n## Usage\n\n```python\nfrom mcp_psycopg2 import mcp\n\n# Run the MCP server\nmcp.run()\n```\n\n## MCP Tools\n\nThe server exposes the following tools for interacting with PostgreSQL databases:\n\n### Connection Management\n- `connect` - Create a new database connection\n- `close_connection` - Close an existing connection\n- `get_connection_info` - Get connection details\n\n### Transaction Management\n- `begin_transaction` - Start a new transaction\n- `commit_transaction` - Commit the current transaction\n- `rollback_transaction` - Rollback the current transaction\n- `set_isolation_level` - Set transaction isolation level\n\n### Cursor Operations\n- `create_cursor` - Create a new cursor\n- `close_cursor` - Close a cursor\n- `execute_query` - Execute a SQL query\n- `execute_many` - Execute a query with multiple parameter sets\n- `fetch_one` - Fetch one row\n- `fetch_many` - Fetch multiple rows\n- `fetch_all` - Fetch all remaining rows\n\n### SQL Composition\n- `quote_identifier` - Quote an SQL identifier\n- `mogrify` - Return query string after parameter binding\n\n### Type Registration\n- `register_json` - Register JSON type adapter\n- `register_hstore` - Register hstore type adapter\n- `register_composite` - Register composite type adapter\n\n### COPY Operations\n- `copy_from` - Copy data from file to table\n- `copy_to` - Copy data from table to file\n- `copy_expert` - Execute custom COPY statement\n\n### Server-Side Cursors\n- `create_named_cursor` - Create a server-side named cursor\n- `scroll_cursor` - Scroll through cursor results\n\n### Large Objects\n- `create_large_object` - Create or open a large object\n- `read_large_object` - Read from a large object\n- `write_large_object` - Write to a large object\n\n### Information\n- `get_server_version` - Get PostgreSQL server version\n- `get_backend_pid` - Get backend process ID\n- `get_dsn_parameters` - Get connection parameters\n- `get_notices` - Get database notices\n- `parse_dsn` - Parse a connection string\n- `make_dsn` - Create a connection string\n\n### Utility\n- `cancel_query` - Cancel the current database operation\n- `set_session` - Set session parameters\n- `list_connections` - List all active connections\n- `list_cursors` - List all active cursors\n\n## Development\n\n```bash\ngit clone https://github.com/daedalus/mcp-psycopg2.git\ncd mcp-psycopg2\npip install -e \".[test]\"\n\n# run tests\npytest\n\n# format\nruff format src/ tests/\n\n# lint\nruff check src/ tests/\n\n# type check\nmypy src/\n```\n",
  "bytes": 2962,
  "sha": "22c54b451139d67386a21af68ff12ba8d3f4211dee428ed7a734ad4687682ada",
  "repo_slug": "daedalus/mcp-psycopg2",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_daedalus_mcp_psycopg2_b55e65fa/readme"
}