Pgcloud

io.github.CloudCorpRecordsPublished by GitHub account CloudCorpRecordsv0.1.0Updated Nov 1, 2026

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

VerifiedSTDIODesktop onlyDatabasesCloud & Infrastructure

Overview

AI-generated overview

Manages Neon Postgres projects, branches and SQL from an MCP client, including two-phase migrations and query tuning on temporary branches.

What you can do
  • List, describe, create and delete Neon projects, branches and compute endpoints, and list organizations
  • Run single SQL statements or multi-statement transactions against a project database
  • Inspect tables and column schemas, list slow queries from pg_stat_statements, and get EXPLAIN plans
  • Prepare migrations or query-tuning sessions on a temporary branch, then complete them onto the original branch or discard them
  • Resolve a Postgres connection string for a database, optionally pooled
When to use it
Useful when an assistant should work directly with a Neon Postgres account: exploring schemas, running queries, reviewing slow queries and plans, or applying schema changes through a safer temporary-branch workflow.
Requirements
Runs locally over stdio via npx or the Docker image. A Neon API key is required in the NEON_API_KEY environment variable; without it every call fails. Network access to the Neon API and the database host's HTTP SQL endpoint is needed.
Before you install
The API key grants access to the Neon account and is sent as a Bearer token. Tools can create and delete projects and branches, run arbitrary SQL, and apply migrations or tuning changes to the main branch, so writes and deletions are possible. Migration and tuning sessions live in the server process and must be completed by the same process that prepared them.

Installation

In SourceWeft

  1. Open Pgcloud in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

pgcloud

pgcloud puts a Neon Postgres account within reach of an MCP client or a terminal. Projects and their branches can be listed, described, created, and deleted; compute endpoints and organizations can be inspected; and any database in a project can be queried directly — single statements, multi-statement transactions, table and column introspection, slow-query reports, and execution plans. Schema changes follow Neon's two-phase pattern: a migration or tuning session is prepared on a temporary branch, exercised there, and only then completed onto the original branch.

A Neon API key is required. Put it in the NEON_API_KEY environment variable; it is sent to the Neon API as a Bearer token and never appears in output. When the variable is missing, every call fails with an error that names it.

Install

bash
npx @reneturcios/pgcloud list_projects

Or run the container image:

bash
docker run -i -e NEON_API_KEY ghcr.io/cloudcorprecords/pgcloud

The container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead.

CLI

Every MCP tool is also a CLI subcommand. Tool arguments are passed as one JSON object with --json:

bash
export NEON_API_KEY=<your Neon API key>
pgcloud list_projectspgcloud list_projects --json '{"limit": 5, "search": "billing"}'pgcloud describe_project --json '{"projectId": "snowy-pond-12345678"}'pgcloud create_branch --json '{"projectId": "snowy-pond-12345678", "branchName": "dev"}'pgcloud run_sql --json '{"projectId": "snowy-pond-12345678", "sql": "select now()"}'pgcloud get_connection_string --json '{"projectId": "snowy-pond-12345678", "pooled": true}'
pgcloud --version

Results print as JSON. Exit codes: 0 on success, 1 when an API or SQL call fails (including a missing NEON_API_KEY), 2 for usage errors.

MCP server

One bin serves both faces. The mcp subcommand starts a stdio MCP server:

bash
npx -y @reneturcios/pgcloud mcp

MCP client configuration:

json
{  "mcpServers": {    "pgcloud": {      "command": "npx",      "args": ["-y", "@reneturcios/pgcloud", "mcp"],      "env": { "NEON_API_KEY": "your Neon API key" }    }  }}

Tools

ToolInput (required in bold)What it does
list_projectslimit, search, org_idLists projects in the account.
describe_projectprojectIdDescribes one project.
create_projectname, region_id, org_idCreates a project.
delete_projectprojectIdDeletes a project and its resources.
create_branchprojectId, branchName, parentBranchIdCreates a branch with a read-write compute.
delete_branchprojectId, branchIdDeletes a branch.
describe_branchprojectId, branchIdBranch record plus its databases.
list_branch_computesprojectId, branchIdLists compute endpoints.
list_organizationssearchLists organizations the user can access.
get_connection_stringprojectId, branchId, databaseName, roleName, pooledResolves a Postgres connection string.
run_sqlsql, projectId, branchId, databaseName, roleNameRuns one SQL statement.
run_sql_transactionsql (array), projectId, …Runs statements in one transaction.
get_database_tablesprojectId, branchId, databaseNameLists tables via information_schema.
describe_table_schemaprojectId, tableName, …Lists a table's columns.
list_slow_queriesprojectId, limit, …Slowest queries from pg_stat_statements.
explain_sql_statementsql, projectId, …Returns the EXPLAIN plan for a statement.
prepare_database_migrationmigrationSql, projectId, …Runs migration SQL on a temporary branch.
complete_database_migrationmigrationId, projectId, …Applies a prepared migration to the original branch.
prepare_query_tuningsql, projectId, …Opens a tuning session on a temporary branch with the plan.
complete_query_tuningtuningId, projectId, applyChangesCloses a tuning session, applying or discarding.

Management calls go to https://api.neon.tech/api/v2. SQL calls first resolve the branch's connection URI from the API, then POST the statement to the database host's HTTP SQL endpoint with the URI in the Neon-Connection-String header; SQL text is passed through as given. Migration and tuning sessions are held in the server process, so a session must be completed by the same process that prepared it.

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # node test runner over test/*.test.ts, no network (fake fetch fixtures)npm run dev     # run the CLI from source via tsx

License

MIT — see LICENSE.

Source: README.md at commit 67b8c9e

Tools

20

list_projects

List all Neon projects in your account.

Parameterslimitorg_idsearch

describe_project

Describes a Neon project

ParametersprojectIdrequired

create_project

Create a new Neon project.

Parametersnameorg_idregion_id

delete_project

Delete a Neon project

ParametersprojectIdrequired

create_branch

Create a branch in a Neon project

ParametersprojectIdrequiredbranchNameparentBranchId

delete_branch

Delete a branch from a Neon project

ParametersbranchIdrequiredprojectIdrequired

describe_branch

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

ParametersbranchIdrequiredprojectIdrequired

list_branch_computes

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

ParametersbranchIdprojectIdrequired

list_organizations

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

Parameterssearch

get_connection_string

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

ParameterspooledbranchIdroleNameprojectIdrequireddatabaseName

run_sql

Execute a single SQL statement against a Neon database.

ParameterssqlrequiredbranchIdroleNameprojectIdrequireddatabaseName

run_sql_transaction

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

ParameterssqlrequiredbranchIdroleNameprojectIdrequireddatabaseName

get_database_tables

Get all tables in a Neon database

ParametersbranchIdprojectIdrequireddatabaseName

describe_table_schema

Describe the schema of a table in a Neon database

ParametersbranchIdprojectIdrequiredtableNamerequireddatabaseName

list_slow_queries

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

ParameterslimitbranchIdprojectIdrequireddatabaseName

explain_sql_statement

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

ParameterssqlrequiredbranchIdprojectIdrequireddatabaseName

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.

ParametersbranchIdprojectIdrequireddatabaseNamemigrationSqlrequired

complete_database_migration

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

ParametersprojectIdrequiredmigrationIdrequireddatabaseName

prepare_query_tuning

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

ParameterssqlrequiredbranchIdprojectIdrequireddatabaseName

complete_query_tuning

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

ParameterstuningIdrequiredprojectIdrequiredapplyChangesrequired

Version history

1
  1. v0.1.0LatestNov 1, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts