{"grant":{"projectId":null,"scopes":["querying"]},"readOnly":true,"notices":["Notice: The MCP server is currently configured with read-only permissions. All write-access tools have been removed. All remaining tools are limited to read-only operations (for example, read-only SQL queries). Do not try to work around this restriction; it is intentional. If the user requests changes to Neon resources, inform them about the read-only configuration. Connection strings are unavailable in this mode because they carry a privileged role password; if the user needs a DATABASE_URL, tell them to copy it from https://console.neon.tech. The user can remove read-only mode by removing the readonly query param from the MCP server URL, then authorizing again when using OAuth."],"tools":[{"name":"run_sql","title":"Run SQL","scope":"querying","readOnlySafe":true,"description":"Execute one SQL statement on a Neon database. If a prior step created a temporary branch, pass that branch_id. NEVER run destructive SQL autonomously; always ask the user first.","inputSchema":{"type":"object","properties":{"sql":{"type":"string","description":"The SQL query to execute"},"project_id":{"type":"string","description":"The ID of the project to execute the query against"},"branch_id":{"type":"string","description":"An optional ID of the branch to execute the query against. If not provided the default branch is used."},"database_name":{"type":"string","description":"The name of the database. If not provided, the default neondb or first available database is used."}},"required":["sql","project_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"run_sql_transaction","title":"Run SQL Transaction","scope":"querying","readOnlySafe":true,"description":"Execute multiple SQL statements as one transaction. If a prior step created a temporary branch, pass that branch_id. NEVER run destructive SQL autonomously; always ask the user first.","inputSchema":{"type":"object","properties":{"sql_statements":{"type":"array","items":{"type":"string"},"description":"The SQL statements to execute"},"project_id":{"type":"string","description":"The ID of the project to execute the query against"},"branch_id":{"type":"string","description":"An optional ID of the branch to execute the query against. If not provided the default branch is used."},"database_name":{"type":"string","description":"The name of the database. If not provided, the default neondb or first available database is used."}},"required":["sql_statements","project_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"explain_sql_statement","title":"Explain SQL Statement","scope":"querying","readOnlySafe":true,"description":"Analyze the query execution plan for a SQL statement using EXPLAIN ANALYZE. Do not use when you need to execute the query for results (use `run_sql` instead).","inputSchema":{"type":"object","properties":{"sql":{"type":"string","description":"The SQL statement to analyze"},"project_id":{"type":"string","description":"The ID of the project to execute the query against"},"branch_id":{"type":"string","description":"An optional ID of the branch to execute the query against. If not provided the default branch is used."},"database_name":{"type":"string","description":"The name of the database. If not provided, the default neondb or first available database is used."},"analyze":{"type":"boolean","default":true,"description":"Whether to include ANALYZE in the EXPLAIN command"}},"required":["sql","project_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"list_slow_queries","title":"List Slow Queries","scope":"querying","readOnlySafe":true,"description":"List queries from pg_stat_statements by execution time, slowest first. For sizes, indexes, locks, cache, bloat, or replication use inspect_database.","inputSchema":{"type":"object","properties":{"project_id":{"type":"string","description":"The ID of the project to list slow queries from"},"branch_id":{"type":"string","description":"An optional ID of the branch. If not provided the default branch is used."},"database_name":{"type":"string","description":"The name of the database. If not provided, the default neondb or first available database is used."},"compute_id":{"type":"string","description":"The ID of the compute/endpoint. If not provided, the read-write compute associated with the branch will be used."},"limit":{"type":"number","default":10,"description":"Maximum number of slow queries to return"},"min_execution_time":{"type":"number","default":1000,"description":"Minimum execution time in milliseconds to consider a query as slow"}},"required":["project_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"inspect_database","title":"Inspect Database","scope":"querying","readOnlySafe":true,"description":"Run one read-only neon inspect db check (pick `check` from the input schema). Not for arbitrary SQL (`run_sql`), one statement's plan (`explain_sql_statement`), or applying indexes (`prepare_query_tuning`). Omit `database_name` to cover every database; some checks are compute-wide. If a check needs an extension, the tool names `CREATE EXTENSION`; ask before running it.","inputSchema":{"type":"object","properties":{"check":{"type":"string","enum":["table-sizes","index-sizes","unused-indexes","seq-scans","long-running-queries","stalled-queries","locks","outliers","calls","lfc-hit-rate","working-set","vacuum-stats","bloat","replication-slots","subscriptions"],"description":"Which diagnostic to run:\n`table-sizes`: Size of each table (including TOAST), largest first (pg_table_size)\n`index-sizes`: Size of each index, largest first (pg_relation_size)\n`unused-indexes`: Non-unique indexes with fewer than 50 scans — candidates for removal (pg_stat_user_indexes)\n`seq-scans`: Number of sequential scans recorded against each table (pg_stat_user_tables)\n`long-running-queries`: Queries running longer than 5 minutes (pg_stat_activity)\n`stalled-queries`: Active queries running longer than 30 seconds with parallel-worker grouping, waits, and blockers, oldest query group first (compute-wide)\n`locks`: Locks held with the acquiring query and its age (pg_locks + pg_stat_activity)\n`outliers`: The 25 queries with the highest cumulative execution time since statistics were last reset (needs pg_stat_statements)\n`calls`: The 25 most frequently executed queries since statistics were last reset (needs pg_stat_statements)\n`lfc-hit-rate`: Local File Cache hit rate (compute-wide, needs neon extension)\n`working-set`: Estimated working set vs LFC size (compute-wide, needs neon extension)\n`vacuum-stats`: Autovacuum status per table: last (auto)vacuum, dead tuples, threshold\n`bloat`: Estimated bloat for the 25 most bloated tables (statistical estimate, no extension needed)\n`replication-slots`: Replication slots (compute-wide): kind, status, client, restart/confirmed-flush LSNs, and lag (pg_replication_slots + pg_stat_replication)\n`subscriptions`: Per-table logical replication progress on this subscriber (pg_subscription_rel)"},"project_id":{"type":"string","description":"The ID of the project to inspect"},"branch_id":{"type":"string","description":"An optional ID of the branch. If not provided the default branch is used."},"database_name":{"type":"string","minLength":1,"description":"For a database-scoped check, the database to inspect. Omit to cover every database on the branch. Ranking and SQL row limits stay per database. One failing database fails the whole run. For a compute-wide check, the database to connect through; the check still runs once for the whole compute and the result does not include `databaseName`. The response `limit` applies to the combined rows after that."},"compute_id":{"type":"string","description":"The ID of the compute/endpoint. If not provided, the read-write compute associated with the branch will be used."},"limit":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":"Maximum number of rows to return from the combined result. Per-database ranking and SQL caps are applied first. The response reports how many rows the check produced and whether they were truncated, so raise this only when `truncated` is true. A few checks are capped in SQL and say so in their description."}},"required":["check","project_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"search","title":"Search","scope":"global","readOnlySafe":true,"description":"Search across all organizations, projects, and branches by keyword. Returns matching items with id, title, and URL. Query must be at least 3 characters. Do not use when you need all projects (use `list_projects` instead).","inputSchema":{"type":"object","properties":{"query":{"type":"string","minLength":3,"description":"The search query to find matching organizations, projects, or branches"}},"required":["query"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"fetch","title":"Fetch","scope":"global","readOnlySafe":true,"description":"Fetch detailed information about a specific organization, project, or branch using the ID returned by the `search` tool.","inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The ID returned by the search tool to fetch detailed information about the entity"}},"required":["id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}]}