neon
Built by Metorial, the integration platform for agentic AI.
neon
Server Summary
Manage Postgres databases
Execute SQL queries
Perform schema migrations
Optimize query performance
A comprehensive Model Context Protocol (MCP) server for managing Neon serverless Postgres databases. This server provides AI assistants with complete control over Neon projects, enabling database creation, schema migrations, query optimization, authentication provisioning, and more—all through natural language interactions.
The Neon MCP server transforms complex database operations into simple conversational commands. Whether you're setting up a new project, tuning slow queries, or managing database migrations with confidence, this server acts as an intelligent database administrator that understands context and helps you make informed decisions.
Manage your entire Neon infrastructure with ease. The server provides comprehensive tools for discovering and organizing your database projects:
Execute SQL with confidence using intelligent query execution tools:
The server implements a sophisticated migration workflow that eliminates the risk of breaking production databases:
Prepare migrations by describing changes in natural language. The system automatically generates DDL statements, creates a temporary branch, and applies changes there first. You can request operations like:
Verify changes on the temporary branch before they touch production. The server encourages testing and provides detailed feedback about what will change.
Complete migrations by applying verified changes to your main branch or discarding them if something isn't right. The temporary branch is automatically cleaned up.
The migration process includes automatic retry logic and comprehensive error handling to ensure your database remains stable.
Transform slow queries into fast ones with AI-powered optimization:
The query tuning workflow analyzes your SQL statements, identifies performance bottlenecks, and suggests concrete improvements. The server:
The system provides detailed cost analysis and execution time comparisons, helping you make data-driven decisions about query optimization.
Leverage Neon's powerful branching capabilities for development workflows:
Branches enable zero-downtime migrations, isolated development environments, and safe experimentation with database changes.
Set up complete authentication infrastructure with a single command:
The provision_neon_auth tool integrates Stack Auth with your Neon database, creating:
The server provides detailed guidance for integrating Stack Auth with Next.js applications, including setup commands, component usage patterns, and security best practices.
Slow Query Monitoring: Query the pg_stat_statements extension to identify queries consuming the most execution time. Filter by minimum duration and limit results to focus on the biggest problems.
Query Plan Analysis: Run EXPLAIN ANALYZE on any query to understand execution behavior, index usage, and performance characteristics.
Multiple Database Support: Work across different databases within your projects, with automatic fallback to default databases.
Role-Based Access: Execute queries with specific database roles for fine-grained permission control.
list_projects - Retrieves up to 400 projects with pagination support. Filter by organization or search by name/ID using partial matches.
list_organizations - Shows all organizations accessible to the current user with optional search filtering.
list_shared_projects - Displays projects shared with you by other users, with pagination and search capabilities.
create_project - Provisions a new Neon project with optional name and organization assignment.
delete_project - Removes a project and all its resources permanently. Requires project ID.
describe_project - Provides detailed information about a specific project including configuration and status.
run_sql - Executes a single SQL statement against a specified database. Supports branch selection and custom database names.
run_sql_transaction - Runs multiple SQL statements in a single transaction for atomic operations.
explain_sql_statement - Generates query execution plans with optional ANALYZE for performance insights.
list_slow_queries - Identifies queries exceeding a specified execution time threshold, sorted by duration.
describe_table_schema - Returns complete column information for a table including data types, constraints, and defaults.
get_database_tables - Lists all tables in a database across all schemas.
describe_branch - Provides a tree view of all objects in a branch: databases, schemas, tables, views, and functions.
prepare_database_migration - Initiates a safe migration workflow by creating a temporary branch and applying changes there. Accepts natural language descriptions of schema modifications.
complete_database_migration - Finalizes a migration by applying verified changes to the main branch or discarding them. Requires migration ID from preparation step.
prepare_query_tuning - Analyzes a slow query, suggests performance improvements, and creates a testing environment for validation.
complete_query_tuning - Applies approved optimization changes to production or cleans up the testing branch. Requires tuning ID and suggested SQL statements.
create_branch - Creates a new branch from the current state of a project with optional naming.
describe_branch - Explores the complete object hierarchy within a branch.
delete_branch - Removes a branch permanently. Requires project and branch IDs.
reset_from_parent - Resets a branch to match its parent's current state, with optional preservation of changes under a new name.
list_branch_computes - Shows compute endpoints associated with a project or specific branch.
get_connection_string - Generates a properly formatted PostgreSQL connection string with automatic parameter resolution for branches, roles, computes, and databases.
provision_neon_auth - Sets up Stack Auth integration with your Neon database, creating authentication schemas and returning credentials for application integration.
This MCP server excels at:
The conversational interface makes complex database operations accessible to developers at all skill levels while maintaining the safety and precision required for production systems.