pgcloud

v0.1.0
io.github.CloudCorpRecords/pgcloud Checked 2 days ago Published 1 month ago

Neon Postgres projects, branches, SQL, and migrations from your MCP client.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_projects

List all Neon projects in your account.

ParameterTypeDescription
limitnumberMaximum number of Neon projects to return.
org_idstringOptional Neon organization ID; when given, only projects belonging to that organization are listed.
searchstringOptional search term to filter projects by name.

describe_project

Describes a Neon project

ParameterTypeDescription
projectId *stringID of the Neon project to describe.

create_project

Create a new Neon project.

ParameterTypeDescription
namestringOptional name for the new Neon project; when omitted, Neon assigns a default name.
org_idstringOptional Neon organization ID that will own the new project.
region_idstringOptional Neon region ID in which to create the project, such as aws-us-east-1.

delete_project

Delete a Neon project

ParameterTypeDescription
projectId *stringID of the Neon project to delete, together with everything in it.

create_branch

Create a branch in a Neon project

ParameterTypeDescription
projectId *stringID of the Neon project in which to create the branch.
branchNamestringOptional name for the new branch; when omitted, Neon assigns a default name.
parentBranchIdstringOptional ID of the branch to copy from; when omitted, the branch is created from the project's default branch.

delete_branch

Delete a branch from a Neon project

ParameterTypeDescription
branchId *stringID of the branch to delete.
projectId *stringID of the Neon project that owns the branch.

describe_branch

Get a tree view of all objects in a branch, including databases, schemas, tables, views, and functions

ParameterTypeDescription
branchId *stringID of the branch to describe, including the databases it holds.
projectId *stringID of the Neon project that owns the branch.

list_branch_computes

List compute endpoints for a project or a specific branch, including compute ID, type, and size.

ParameterTypeDescription
projectId *stringID of the Neon project whose compute endpoints to list.
branchIdstringOptional ID of a branch; when given, only compute endpoints for that branch are listed.

list_organizations

List all organizations that the current user has access to, optionally filtered by a search term.

ParameterTypeDescription
searchstringOptional search term to filter organizations by name.

get_connection_string

Get a PostgreSQL connection string for a Neon database with all parameters being optional

ParameterTypeDescription
projectId *stringID of the Neon project whose connection string to return.
branchIdstringOptional ID of the branch to connect to; when omitted, the project's default branch is used.
databaseNamestringOptional name of the database to connect to; when omitted, the project's default database is used.
pooledbooleanOptional flag: when true, return a pooled connection string (through Neon's connection pooler); when false or omitted, return a direct connection string.
roleNamestringOptional name of the database role to connect as; when omitted, the default role is used.

run_sql

Execute a single SQL statement against a Neon database.

ParameterTypeDescription
projectId *stringID of the Neon project that owns the database.
sql *stringThe single SQL statement to execute against the Neon database.
branchIdstringOptional ID of the branch to run against; when omitted, the project's default branch is used.
databaseNamestringOptional name of the database to run against; when omitted, the project's default database is used.
roleNamestringOptional name of the database role to run as; when omitted, the default role is used.

run_sql_transaction

Execute a SQL transaction against a Neon database, should be used for multiple SQL statements.

ParameterTypeDescription
projectId *stringID of the Neon project that owns the database.
sql *arrayArray of SQL statements to execute together in a single transaction against the Neon database.
branchIdstringOptional ID of the branch to run against; when omitted, the project's default branch is used.
databaseNamestringOptional name of the database to run against; when omitted, the project's default database is used.
roleNamestringOptional name of the database role to run as; when omitted, the default role is used.

get_database_tables

Get all tables in a Neon database

ParameterTypeDescription
projectId *stringID of the Neon project that owns the database.
branchIdstringOptional ID of the branch whose tables to list; when omitted, the project's default branch is used.
databaseNamestringOptional name of the database whose tables to list; when omitted, the project's default database is used.

describe_table_schema

Describe the schema of a table in a Neon database

ParameterTypeDescription
projectId *stringID of the Neon project that owns the table.
tableName *stringName of the table whose columns to describe.
branchIdstringOptional ID of the branch containing the table; when omitted, the project's default branch is used.
databaseNamestringOptional name of the database containing the table; when omitted, the project's default database is used.

list_slow_queries

List slow queries from pg_stat_statements, ordered by mean execution time.

ParameterTypeDescription
projectId *stringID of the Neon project that owns the database.
branchIdstringOptional ID of the branch to inspect; when omitted, the project's default branch is used.
databaseNamestringOptional name of the database to inspect; when omitted, the project's default database is used.
limitnumberOptional maximum number of slow queries to return, clamped to between 1 and 100; defaults to 10.

explain_sql_statement

Describe the PostgreSQL query execution plan for a SQL statement by running EXPLAIN in the database

ParameterTypeDescription
projectId *stringID of the Neon project that owns the database.
sql *stringThe SQL statement whose PostgreSQL execution plan to return, run under EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON).
branchIdstringOptional ID of the branch to explain against; when omitted, the project's default branch is used.
databaseNamestringOptional name of the database to explain against; when omitted, the project's default database is used.

prepare_database_migration

Perform a database schema migration by executing the given SQL on a temporary branch for safety, ready to complete onto the main branch.

ParameterTypeDescription
migrationSql *stringThe migration SQL to test on a temporary branch before it is applied to the original branch.
projectId *stringID of the Neon project that owns the database to migrate.
branchIdstringOptional ID of the branch to migrate; the temporary branch is created from it and completion applies the migration back to it. When omitted, the project's default branch is used.
databaseNamestringOptional name of the database to migrate; when omitted, the project's default database is used.

complete_database_migration

Complete a database migration when the user confirms the migration is ready to be applied to the main branch.

ParameterTypeDescription
migrationId *stringID of the prepared migration session returned by prepare_database_migration.
projectId *stringID of the Neon project the migration was prepared for; must match the prepared migration's project.
databaseNamestringOptional name of the database to apply the migration to; when omitted, the database recorded when the migration was prepared is used.

prepare_query_tuning

Analyze a slow query or DML statement on a temporary branch, returning its execution plan to suggest optimizations.

ParameterTypeDescription
projectId *stringID of the Neon project that owns the database.
sql *stringThe slow query or DML statement to analyze on a temporary branch; its execution plan is returned to suggest optimizations.
branchIdstringOptional ID of the branch to tune against; the temporary tuning branch is created from it. When omitted, the project's default branch is used.
databaseNamestringOptional name of the database the statement runs against; when omitted, the project's default database is used.

complete_query_tuning

Complete a query tuning session by either applying the changes to the main branch or discarding them.

ParameterTypeDescription
applyChanges *booleanWhether to apply the tuning session's changes to the original branch (true) or discard them (false); the temporary branch is deleted either way.
projectId *stringID of the Neon project the tuning session was prepared for; must match the session's project.
tuningId *stringID of the query tuning session returned by prepare_query_tuning.