[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-neondatabase--mcp-server-neon":3,"tool-neondatabase--mcp-server-neon":64},[4,17,27,35,48,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,43,44,45,15,46,26,13,47],"数据工具","视频","插件","其他","音频",{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":10,"last_commit_at":54,"category_tags":55,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,46],{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},2181,"OpenHands","OpenHands\u002FOpenHands","OpenHands 是一个专注于 AI 驱动开发的开源平台，旨在让智能体（Agent）像人类开发者一样理解、编写和调试代码。它解决了传统编程中重复性劳动多、环境配置复杂以及人机协作效率低等痛点，通过自动化流程显著提升开发速度。\n\n无论是希望提升编码效率的软件工程师、探索智能体技术的研究人员，还是需要快速原型验证的技术团队，都能从中受益。OpenHands 提供了灵活多样的使用方式：既可以通过命令行（CLI）或本地图形界面在个人电脑上轻松上手，体验类似 Devin 的流畅交互；也能利用其强大的 Python SDK 自定义智能体逻辑，甚至在云端大规模部署上千个智能体并行工作。\n\n其核心技术亮点在于模块化的软件智能体 SDK，这不仅构成了平台的引擎，还支持高度可组合的开发模式。此外，OpenHands 在 SWE-bench 基准测试中取得了 77.6% 的优异成绩，证明了其解决真实世界软件工程问题的能力。平台还具备完善的企业级功能，支持与 Slack、Jira 等工具集成，并提供细粒度的权限管理，适合从个人开发者到大型企业的各类用户场景。",70626,"2026-04-05T22:51:36",[26,15,13,45],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":70,"readme_en":71,"readme_zh":72,"quickstart_zh":73,"use_case_zh":74,"hero_image_url":75,"owner_login":76,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":79,"owner_twitter":76,"owner_website":80,"owner_url":81,"languages":82,"stars":95,"forks":96,"last_commit_at":97,"license":98,"difficulty_score":23,"env_os":99,"env_gpu":100,"env_ram":99,"env_deps":101,"category_tags":106,"github_topics":79,"view_count":23,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":107,"updated_at":108,"faqs":109,"releases":110},2834,"neondatabase\u002Fmcp-server-neon","mcp-server-neon","MCP server for interacting with Neon Management API and databases","mcp-server-neon 是一款开源工具，旨在让用户通过自然语言直接操作 Neon Postgres 数据库。它基于模型上下文协议（MCP）构建，充当大语言模型与 Neon 管理 API 之间的桥梁，将用户的口语化指令自动转化为具体的数据库操作，如创建项目、生成分支、执行查询或进行架构迁移。\n\n这一工具主要解决了传统数据库管理中必须编写复杂 SQL 语句或直接调用 API 的技术门槛问题。用户无需精通代码，只需像与人对话一样发出指令，即可完成繁琐的数据库维护任务，极大地简化了工作流程并提升了效率。\n\nmcp-server-neon 非常适合希望快速原型开发的开发者、需要频繁调整数据结构的全栈工程师，以及具备一定技术背景但想降低操作难度的数据分析师。其核心亮点在于深度集成了 Neon 独特的“分支”功能，支持通过自然语言触发数据库模式变更，让实验性开发更加安全便捷。此外，它支持 OAuth 和 API 密钥多种认证方式，并能无缝接入 Cursor、VS Code 等主流开发环境。需要注意的是，鉴于其强大的操作权限，官方建议仅在本地开发或集成环境中使用，生产环境需谨慎授权以确保数据安","mcp-server-neon 是一款开源工具，旨在让用户通过自然语言直接操作 Neon Postgres 数据库。它基于模型上下文协议（MCP）构建，充当大语言模型与 Neon 管理 API 之间的桥梁，将用户的口语化指令自动转化为具体的数据库操作，如创建项目、生成分支、执行查询或进行架构迁移。\n\n这一工具主要解决了传统数据库管理中必须编写复杂 SQL 语句或直接调用 API 的技术门槛问题。用户无需精通代码，只需像与人对话一样发出指令，即可完成繁琐的数据库维护任务，极大地简化了工作流程并提升了效率。\n\nmcp-server-neon 非常适合希望快速原型开发的开发者、需要频繁调整数据结构的全栈工程师，以及具备一定技术背景但想降低操作难度的数据分析师。其核心亮点在于深度集成了 Neon 独特的“分支”功能，支持通过自然语言触发数据库模式变更，让实验性开发更加安全便捷。此外，它支持 OAuth 和 API 密钥多种认证方式，并能无缝接入 Cursor、VS Code 等主流开发环境。需要注意的是，鉴于其强大的操作权限，官方建议仅在本地开发或集成环境中使用，生产环境需谨慎授权以确保数据安全。","\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fneon.com\u002Fbrand\u002Fneon-logo-dark-color.svg\">\n  \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Fneon.com\u002Fbrand\u002Fneon-logo-light-color.svg\">\n  \u003Cimg width=\"250px\" alt=\"Neon Logo fallback\" src=\"https:\u002F\u002Fneon.com\u002Fbrand\u002Fneon-logo-dark-color.svg\">\n\u003C\u002Fpicture>\n\n# Neon MCP Server\n\n[![Install MCP Server in Cursor](https:\u002F\u002Fcursor.com\u002Fdeeplink\u002Fmcp-install-dark.svg)](https:\u002F\u002Fcursor.com\u002Fen-US\u002Finstall-mcp?name=Neon&config=eyJ1cmwiOiJodHRwczovL21jcC5uZW9uLnRlY2gvbWNwIn0%3D)\n\n**Neon MCP Server** is an open-source tool that lets you interact with your Neon Postgres databases in **natural language**.\n\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n\nThe Model Context Protocol (MCP) is a [standardized protocol](https:\u002F\u002Fmodelcontextprotocol.io\u002Fintroduction) designed to manage context between large language models (LLMs) and external systems. This repository provides a remote MCP Server for [Neon](https:\u002F\u002Fneon.tech).\n\nNeon's MCP server acts as a bridge between natural language requests and the [Neon API](https:\u002F\u002Fapi-docs.neon.tech\u002Freference\u002Fgetting-started-with-neon-api). Built upon MCP, it translates your requests into the necessary API calls, enabling you to manage tasks such as creating projects and branches, running queries, and performing database migrations seamlessly.\n\nSome of the key features of the Neon MCP server include:\n\n- **Natural language interaction:** Manage Neon databases using intuitive, conversational commands.\n- **Simplified database management:** Perform complex actions without writing SQL or directly using the Neon API.\n- **Accessibility for non-developers:** Empower users with varying technical backgrounds to interact with Neon databases.\n- **Database migration support:** Leverage Neon's branching capabilities for database schema changes initiated via natural language.\n\nFor example, in Claude Code, or any MCP Client, you can use natural language to accomplish things with Neon, such as:\n\n- `Let's create a new Postgres database, and call it \"my-database\". Let's then create a table called users with the following columns: id, name, email, and password.`\n- `I want to run a migration on my project called \"my-project\" that alters the users table to add a new column called \"created_at\".`\n- `Can you give me a summary of all of my Neon projects and what data is in each one?`\n\n> [!WARNING]  \n> **Neon MCP Server Security Considerations**  \n> The Neon MCP Server grants powerful database management capabilities through natural language requests. **Always review and authorize actions requested by the LLM before execution.** Ensure that only authorized users and applications have access to the Neon MCP Server.\n>\n> The Neon MCP Server is intended for local development and IDE integrations only. **We do not recommend using the Neon MCP Server in production environments.** It can execute powerful operations that may lead to accidental or unauthorized changes.\n>\n> For more information, see [MCP security guidance →](https:\u002F\u002Fneon.tech\u002Fdocs\u002Fai\u002Fneon-mcp-server#mcp-security-guidance).\n\n## Setting up Neon MCP Server\n\nThere are a few options for setting up the Neon MCP Server:\n\n1. **Quick Setup with API Key (Cursor, VS Code, and Claude Code):** Run [`neonctl@latest init`](https:\u002F\u002Fneon.com\u002Fdocs\u002Freference\u002Fcli-init) to automatically configure Neon's MCP Server, [agent skills](https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fagent-skills), and VS Code extension with one command.\n2. **Remote MCP Server (OAuth Based Authentication):** Connect to Neon's managed MCP server using OAuth for authentication. This method is more convenient as it eliminates the need to manage API keys. Additionally, you will automatically receive the latest features and improvements as soon as they are released.\n3. **Remote MCP Server (API Key Based Authentication):** Connect to Neon's managed MCP server using API key for authentication. This method is useful if you want to connect a remote agent to Neon where OAuth is not available. Additionally, you will automatically receive the latest features and improvements as soon as they are released.\n\n### Prerequisites\n\n- An MCP Client application.\n- A [Neon account](https:\u002F\u002Fconsole.neon.tech\u002Fsignup).\n- **Node.js (>= v18.0.0):** Download from [nodejs.org](https:\u002F\u002Fnodejs.org).\n\nFor development, you'll also need [Bun](https:\u002F\u002Fbun.sh) installed.\n\n### Option 1. Quick Setup with API Key\n\n**Don't want to manually create an API key?**\n\nRun [`neonctl@latest init`](https:\u002F\u002Fneon.com\u002Fdocs\u002Freference\u002Fcli-init) to automatically configure Neon's MCP Server with one command:\n\n```bash\nnpx neonctl@latest init\n```\n\nThis works with Cursor, VS Code (GitHub Copilot), and Claude Code. It will authenticate via OAuth, create a Neon API key for you, and configure your editor automatically.\n\n### Option 2. Remote Hosted MCP Server (OAuth Based Authentication)\n\nConnect to Neon's managed MCP server using OAuth for authentication. This is the easiest setup, requires no local installation of this server, and doesn't need a Neon API key configured in the client.\n\nRun the following command to add the Neon MCP Server for all detected agents and editors in your workspace:\n\n```bash\nnpx add-mcp https:\u002F\u002Fmcp.neon.tech\u002Fmcp\n```\n\nAlternatively, you can add the following \"Neon\" entry to your client's MCP server configuration file (e.g., `mcp.json`, `mcp_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"Neon\": {\n      \"type\": \"http\",\n      \"url\": \"https:\u002F\u002Fmcp.neon.tech\u002Fmcp\"\n    }\n  }\n}\n```\n\n- Restart or refresh your MCP client.\n- An OAuth window will open in your browser. Follow the prompts to authorize your MCP client to access your Neon account.\n\n> With OAuth-based authentication, the MCP server will, by default, operate on projects under your personal Neon account. To access or manage projects that belong to an organization, you must explicitly provide either the `org_id` or the `project_id` in your prompt to MCP client.\n\n### Option 3. Remote Hosted MCP Server (API Key Based Authentication)\n\nRemote MCP Server also supports authentication using an API key in the `Authorization` header if your client supports it.\n\n[Create a Neon API key](https:\u002F\u002Fconsole.neon.tech\u002Fapp\u002Fsettings?modal=create_api_key) in the Neon Console. Next, run the following command to add the Neon MCP Server for all detected agents and editors in your workspace:\n\n```bash\nnpx add-mcp https:\u002F\u002Fmcp.neon.tech\u002Fmcp --header \"Authorization: Bearer \u003C$NEON_API_KEY>\"\n```\n\nAlternatively, you can add the following \"Neon\" entry to your client's MCP server configuration file (e.g., `mcp.json`, `mcp_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"Neon\": {\n      \"type\": \"http\",\n      \"url\": \"https:\u002F\u002Fmcp.neon.tech\u002Fmcp\",\n      \"headers\": {\n        \"Authorization\": \"Bearer \u003C$NEON_API_KEY>\"\n      }\n    }\n  }\n}\n```\n\n> Provide an organization's API key to limit access to projects under the organization only.\n\n### Scopes and Read-Only Mode\n\nNeon MCP supports OAuth scopes `read`, `write`, and `*` (`*` means both). Your MCP client can request these scopes directly, or you can make the selection in the OAuth permissions UI.\n\n**Read-only mode** restricts which tools are available, disabling write operations like creating projects, branches, or running migrations. Read-only tools include listing projects, describing schemas, querying data, and viewing performance metrics.\n\nYou can set read-only mode in two ways:\n\n1. **OAuth scope selection (recommended):** In OAuth, select read-only by unchecking **Full access** in the authorization UI.\n2. **`X-Neon-Read-Only` header:** Add `X-Neon-Read-Only: true` to your MCP server configuration:\n\n```json\n{\n  \"mcpServers\": {\n    \"Neon\": {\n      \"url\": \"https:\u002F\u002Fmcp.neon.tech\u002Fmcp\",\n      \"headers\": {\n        \"X-Neon-Read-Only\": \"true\"\n      }\n    }\n  }\n}\n```\n\nHow the header behaves:\n\n- **API key flow:** `X-Neon-Read-Only` is the way to enable read-only mode (there is no OAuth scope exchange in this flow).\n- **OAuth flow:** `X-Neon-Read-Only: true` behaves like `scope=read` for the default consent setting (Full access starts unchecked), but the user can still override this in the OAuth UI before approving.\n\nLegacy header `x-read-only` is also supported.\n\n> [!IMPORTANT]\n> If you change MCP configuration files (for example, toggling read-only mode or switching to a project-scoped setup), those changes only take effect for the **OAuth flow** after you log out and log back in.\n> OAuth permissions\u002Fscopes are bound to the session when a new OAuth token is created.\n> This does **not** apply to the API key flow.\n\n> **Note:** Read-only mode restricts which _tools_ are available, not the SQL content. The `run_sql` tool remains available and can execute any SQL including INSERT\u002FUPDATE\u002FDELETE. For true read-only SQL access, use database roles with restricted permissions.\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Tools available in read-only mode\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n- `list_projects`, `list_shared_projects`, `describe_project`, `list_organizations`\n- `describe_branch`, `list_branch_computes`, `compare_database_schema`\n- `run_sql`, `run_sql_transaction`, `get_database_tables`, `describe_table_schema`\n- `list_slow_queries`, `explain_sql_statement`\n- `get_connection_string`\n- `search`, `fetch`, `list_docs_resources`, `get_doc_resource`\n\n**Tools requiring write access:**\n\n- `create_project`, `delete_project`\n- `create_branch`, `delete_branch`, `reset_from_parent`\n- `provision_neon_auth`, `provision_neon_data_api`\n- `prepare_database_migration`, `complete_database_migration`\n- `prepare_query_tuning`, `complete_query_tuning`\n\n\u003C\u002Fdetails>\n\n### Server-Sent Events (SSE) Transport (Deprecated)\n\nMCP supports two remote server transports: the deprecated Server-Sent Events (SSE) and the newer, recommended Streamable HTTP. If your LLM client doesn't support Streamable HTTP yet, you can switch the endpoint from `https:\u002F\u002Fmcp.neon.tech\u002Fmcp` to `https:\u002F\u002Fmcp.neon.tech\u002Fsse` to use SSE instead.\n\nRun the following command to add the Neon MCP Server for all detected agents and editors in your workspace using the SSE transport:\n\n```bash\nnpx add-mcp https:\u002F\u002Fmcp.neon.tech\u002Fsse --type sse\n```\n\n## Remote Server Architecture\n\nThe remote server runs as a Next.js App Router application on Vercel at `mcp.neon.tech`.\n\n> [!NOTE]\n> The root `\u002F` path redirects to [Neon MCP Server docs](https:\u002F\u002Fneon.tech\u002Fdocs\u002Fai\u002Fneon-mcp-server). There is no landing page.\n\nCore implementation areas:\n\n- `landing\u002Fapp\u002Fapi\u002F[transport]\u002Froute.ts`: MCP transport endpoint for Streamable HTTP (`\u002Fmcp`) and SSE (`\u002Fsse`)\n- `landing\u002Fapp\u002Fapi\u002Fauthorize\u002F`, `landing\u002Fapp\u002Fcallback\u002F`, `landing\u002Fapp\u002Fapi\u002Ftoken\u002F`, `landing\u002Fapp\u002Fapi\u002Frevoke\u002F`: OAuth flow endpoints\n- `landing\u002Fapp\u002F.well-known\u002F`: OAuth discovery metadata endpoints\n- `landing\u002Fmcp-src\u002F`: MCP server, tools, handlers, analytics, and Sentry integration\n- `landing\u002Flib\u002F`: Next.js-compatible helpers (OAuth, configuration, error handling)\n- `landing\u002Fmcp-src\u002Futils\u002Fread-only.ts`: read-only mode and scope handling\n\n## Guides\n\n- [Neon MCP Server Guide](https:\u002F\u002Fneon.tech\u002Fdocs\u002Fai\u002Fneon-mcp-server)\n- [Connect MCP Clients to Neon](https:\u002F\u002Fneon.tech\u002Fdocs\u002Fai\u002Fconnect-mcp-clients-to-neon)\n- [Cursor with Neon MCP Server](https:\u002F\u002Fneon.tech\u002Fguides\u002Fcursor-mcp-neon)\n- [Claude Desktop with Neon MCP Server](https:\u002F\u002Fneon.tech\u002Fguides\u002Fneon-mcp-server)\n- [Cline with Neon MCP Server](https:\u002F\u002Fneon.tech\u002Fguides\u002Fcline-mcp-neon)\n- [Windsurf with Neon MCP Server](https:\u002F\u002Fneon.tech\u002Fguides\u002Fwindsurf-mcp-neon)\n- [Zed with Neon MCP Server](https:\u002F\u002Fneon.tech\u002Fguides\u002Fzed-mcp-neon)\n\n# Features\n\n## Supported Tools\n\nThe Neon MCP Server provides the following actions, which are exposed as \"tools\" to MCP Clients. You can use these tools to interact with your Neon projects and databases using natural language commands.\n\n### Tool Scope Metadata\n\nEach tool definition includes a `scope` category used for grant-based tool filtering and consent UX. Current categories are:\n\n- `projects`\n- `branches`\n- `schema`\n- `querying`\n- `neon_auth`\n- `data_api`\n- `docs`\n- `null` (tools without a scope category)\n\nNotes:\n\n- `compare_database_schema` is categorized under `schema`.\n- `provision_neon_data_api` is categorized under `data_api` (separate from `neon_auth`).\n- Read-only enforcement still relies on `readOnlySafe` and server-side read-only logic; `scope` is category metadata, not a standalone read\u002Fwrite switch.\n- In project-scoped mode (`X-Neon-Project-Id`), `search` and `fetch` are not available.\n\n**Project Management:**\n\n- **`list_projects`**: Lists the first 10 Neon projects in your account, providing a summary of each project. If you can't find a specific project, increase the limit by passing a higher value to the `limit` parameter.\n- **`list_shared_projects`**: Lists Neon projects shared with the current user. Supports a search parameter and limiting the number of projects returned (default: 10).\n- **`describe_project`**: Fetches detailed information about a specific Neon project, including its ID, name, and associated branches and databases.\n- **`create_project`**: Creates a new Neon project in your Neon account. A project acts as a container for branches, databases, roles, and computes.\n- **`delete_project`**: Deletes an existing Neon project and all its associated resources.\n- **`list_organizations`**: Lists all organizations that the current user has access to. Optionally filter by organization name or ID using the search parameter.\n\n**Branch Management:**\n\n- **`create_branch`**: Creates a new branch within a specified Neon project. Leverages [Neon's branching](\u002Fdocs\u002Fintroduction\u002Fbranching) feature for development, testing, or migrations.\n- **`delete_branch`**: Deletes an existing branch from a Neon project.\n- **`describe_branch`**: Retrieves details about a specific branch, such as its name, ID, and parent branch.\n- **`list_branch_computes`**: Lists compute endpoints for a project or specific branch, including compute ID, type, size, last active time, and autoscaling information.\n- **`compare_database_schema`**: Shows the schema diff between the child branch and its parent\n- **`reset_from_parent`**: Resets the current branch to its parent's state, discarding local changes. Automatically preserves to backup if branch has children, or optionally preserve on request with a custom name.\n\n**SQL Query Execution:**\n\n- **`get_connection_string`**: Returns your database connection string.\n- **`run_sql`**: Executes a single SQL query against a specified Neon database. Supports both read and write operations.\n- **`run_sql_transaction`**: Executes a series of SQL queries within a single transaction against a Neon database.\n- **`get_database_tables`**: Lists all tables within a specified Neon database.\n- **`describe_table_schema`**: Retrieves the schema definition of a specific table, detailing columns, data types, and constraints.\n\n**Database Migrations (Schema Changes):**\n\n- **`prepare_database_migration`**: Initiates a database migration process. Critically, it creates a temporary branch to apply and test the migration safely before affecting the main branch.\n- **`complete_database_migration`**: Finalizes and applies a prepared database migration to the main branch. This action merges changes from the temporary migration branch and cleans up temporary resources.\n\n**SQL Querying and Optimization:**\n\n- **`list_slow_queries`**: Identifies performance bottlenecks by finding the slowest queries in a database. Requires the pg_stat_statements extension.\n- **`explain_sql_statement`**: Provides detailed execution plans for SQL queries to help identify performance bottlenecks.\n- **`prepare_query_tuning`**: Analyzes query performance and suggests optimizations, like index creation. Creates a temporary branch for safely testing these optimizations.\n- **`complete_query_tuning`**: Finalizes query tuning by either applying optimizations to the main branch or discarding them. Cleans up the temporary tuning branch.\n\n**Neon Auth:**\n\n- **`provision_neon_auth`**: Provisions Neon Auth for a Neon project. It allows developers to easily set up authentication infrastructure by creating an integration with an Auth provider.\n\n**Neon Data API:**\n\n- **`provision_neon_data_api`**: Provisions the Neon Data API for HTTP-based database access with optional JWT authentication via Neon Auth or external JWKS providers.\n\n**Search and Discovery:**\n\n- **`search`**: Searches across organizations, projects, and branches matching a query. Returns IDs, titles, and direct links to the Neon Console.\n- **`fetch`**: Fetches detailed information about a specific organization, project, or branch using an ID (typically from the search tool).\n\n**Documentation and Resources:**\n\n- **`list_docs_resources`**: Lists all available Neon documentation pages by fetching the index from `https:\u002F\u002Fneon.com\u002Fdocs\u002Fllms.txt`. Returns page URLs and titles that can be fetched individually using the `get_doc_resource` tool.\n- **`get_doc_resource`**: Fetches a specific Neon documentation page as markdown content. Use the `list_docs_resources` tool first to discover available page slugs, then pass the slug to this tool.\n\n## Migrations\n\nMigrations are a way to manage changes to your database schema over time. With the Neon MCP server, LLMs are empowered to do migrations safely with separate \"Start\" (`prepare_database_migration`) and \"Commit\" (`complete_database_migration`) commands.\n\nThe \"Start\" command accepts a migration and runs it in a new temporary branch. Upon returning, this command hints to the LLM that it should test the migration on this branch. The LLM can then run the \"Commit\" command to apply the migration to the original branch.\n\n# Development\n\nThis project uses [Bun](https:\u002F\u002Fbun.sh) as the package manager and runtime.\n\n## Project Structure\n\nThe MCP server code lives in the `landing\u002F` directory, which is a Next.js application deployed to Vercel at `mcp.neon.tech`.\n\n```bash\ncd landing\nbun install\n```\n\n## Local Development\n\n```bash\n# Start the Next.js dev server (for the remote MCP server)\nbun run dev\n```\n\n## Linting and Type Checking\n\n```bash\nbun run lint\nbun run typecheck\n```\n\n## Environment Variables\n\nRequired for remote server runtime:\n\n| Variable              | Description                           |\n| --------------------- | ------------------------------------- |\n| `SERVER_HOST`         | Server URL (defaults to `VERCEL_URL`) |\n| `UPSTREAM_OAUTH_HOST` | Neon OAuth provider URL               |\n| `CLIENT_ID`           | OAuth client ID                       |\n| `CLIENT_SECRET`       | OAuth client secret                   |\n| `COOKIE_SECRET`       | Secret for signed cookies             |\n| `KV_URL`              | Vercel KV (Upstash Redis) URL         |\n| `OAUTH_DATABASE_URL`  | Postgres URL for token storage        |\n\nOptional:\n\n| Variable    | Description                                                                       |\n| ----------- | --------------------------------------------------------------------------------- |\n| `LOG_LEVEL` | Winston log level: `error`, `warn`, `info` (default), `debug`, `verbose`, `silly` |\n\n## Testing Pyramid\n\nAll tests run from `landing\u002F`.\n\n```bash\ncd landing\n\n# Unit tests\nbun run test:unit\n\n# Integration tests\nbun run test:integration\n\n# MCP protocol end-to-end tests (real MCP client\u002Fserver tool calls)\nbun run test:e2e:mcp\n\n# Website end-to-end tests (Playwright; provisions\u002Fvalidates ephemeral DB first)\nbun run test:e2e:web\n\n# Full end-to-end suite\nbun run test:e2e\n\n# Full test pyramid (unit + integration + e2e; used in CI)\nbun run test\n```\n\nTesting strategy:\n\n- Prefer **E2E** for transport\u002Fprotocol and user-visible behavior.\n- Use **integration** tests for deterministic tool contracts and workflow behavior.\n- Use **unit** tests for pure logic and edge cases.\n- Avoid relying on third-party uptime in merge-gating tests; mock external dependencies in integration\u002Funit tiers.\n\n## Deployment\n\nVercel deploys the remote server automatically from the repository branch configuration. Preview environments are available for pull requests.\n","\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fneon.com\u002Fbrand\u002Fneon-logo-dark-color.svg\">\n  \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Fneon.com\u002Fbrand\u002Fneon-logo-light-color.svg\">\n  \u003Cimg width=\"250px\" alt=\"Neon Logo fallback\" src=\"https:\u002F\u002Fneon.com\u002Fbrand\u002Fneon-logo-dark-color.svg\">\n\u003C\u002Fpicture>\n\n# Neon MCP 服务器\n\n[![在 Cursor 中安装 MCP 服务器](https:\u002F\u002Fcursor.com\u002Fdeeplink\u002Fmcp-install-dark.svg)](https:\u002F\u002Fcursor.com\u002Fen-US\u002Finstall-mcp?name=Neon&config=eyJ1cmwiOiJodHRwczovL21jcC5uZW9uLnRlY2gvbWNwIn0%3D)\n\n**Neon MCP 服务器** 是一款开源工具，可让您以 **自然语言** 与您的 Neon Postgres 数据库进行交互。\n\n[![许可证：MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n\n模型上下文协议（MCP）是一种 [标准化协议](https:\u002F\u002Fmodelcontextprotocol.io\u002Fintroduction)，旨在管理大型语言模型（LLM）与外部系统之间的上下文。此仓库提供了一个用于 [Neon](https:\u002F\u002Fneon.tech) 的远程 MCP 服务器。\n\nNeon 的 MCP 服务器充当自然语言请求与 [Neon API](https:\u002F\u002Fapi-docs.neon.tech\u002Freference\u002Fgetting-started-with-neon-api) 之间的桥梁。它基于 MCP 构建，可将您的请求转换为必要的 API 调用，从而让您无缝地管理创建项目和分支、运行查询以及执行数据库迁移等任务。\n\nNeon MCP 服务器的一些主要功能包括：\n\n- **自然语言交互：** 使用直观的对话式命令管理 Neon 数据库。\n- **简化数据库管理：** 无需编写 SQL 或直接使用 Neon API 即可执行复杂操作。\n- **非开发者友好：** 使不同技术背景的用户都能与 Neon 数据库互动。\n- **支持数据库迁移：** 利用 Neon 的分支功能，通过自然语言发起数据库模式变更。\n\n例如，在 Claude Code 或任何 MCP 客户端中，您可以使用自然语言完成以下操作：\n\n- `让我们创建一个新的 Postgres 数据库，命名为 \"my-database\"。然后创建一个名为 users 的表，包含以下列：id、name、email 和 password。`\n- `我想在我的名为 \"my-project\" 的项目上运行一次迁移，修改 users 表以添加一个名为 \"created_at\" 的新列。`\n- `你能给我总结一下我所有的 Neon 项目以及每个项目中的数据吗？`\n\n> [!警告]  \n> **Neon MCP 服务器安全注意事项**  \n> Neon MCP 服务器通过自然语言请求赋予了强大的数据库管理能力。**在执行 LLM 请求的操作之前，请务必先审查并授权。** 确保只有授权用户和应用程序才能访问 Neon MCP 服务器。\n>\n> Neon MCP 服务器仅适用于本地开发和 IDE 集成。**我们不建议在生产环境中使用 Neon MCP 服务器。** 它可以执行可能导致意外或未经授权更改的强大操作。\n>\n> 更多信息请参阅 [MCP 安全指南 →](https:\u002F\u002Fneon.tech\u002Fdocs\u002Fai\u002Fneon-mcp-server#mcp-security-guidance)。\n\n## 设置 Neon MCP 服务器\n\n设置 Neon MCP 服务器有几种方法：\n\n1. **使用 API 密钥快速设置（Cursor、VS Code 和 Claude Code）：** 运行 [`neonctl@latest init`](https:\u002F\u002Fneon.com\u002Fdocs\u002Freference\u002Fcli-init)，即可通过一条命令自动配置 Neon 的 MCP 服务器、[agent skills](https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fagent-skills) 和 VS Code 扩展。\n2. **远程 MCP 服务器（基于 OAuth 的身份验证）：** 使用 OAuth 进行身份验证，连接到 Neon 的托管 MCP 服务器。这种方法更为便捷，无需管理 API 密钥。此外，您还将自动获得最新功能和改进。\n3. **远程 MCP 服务器（基于 API 密钥的身份验证）：** 使用 API 密钥进行身份验证，连接到 Neon 的托管 MCP 服务器。如果您希望将远程代理连接到无法使用 OAuth 的 Neon，则此方法非常有用。同时，您也将自动获得最新功能和改进。\n\n### 先决条件\n\n- 一个 MCP 客户端应用。\n- 一个 [Neon 账户](https:\u002F\u002Fconsole.neon.tech\u002Fsignup)。\n- **Node.js（>= v18.0.0）：** 从 [nodejs.org](https:\u002F\u002Fnodejs.org) 下载。\n\n对于开发，您还需要安装 [Bun](https:\u002F\u002Fbun.sh)。\n\n### 方法 1. 使用 API 密钥快速设置\n\n**不想手动创建 API 密钥吗？**\n\n运行 [`neonctl@latest init`](https:\u002F\u002Fneon.com\u002Fdocs\u002Freference\u002Fcli-init)，即可通过一条命令自动配置 Neon 的 MCP 服务器：\n\n```bash\nnpx neonctl@latest init\n```\n\n这适用于 Cursor、VS Code（GitHub Copilot）和 Claude Code。它将通过 OAuth 进行身份验证，为您创建一个 Neon API 密钥，并自动配置您的编辑器。\n\n### 方法 2. 远程托管 MCP 服务器（基于 OAuth 的身份验证）\n\n使用 OAuth 进行身份验证，连接到 Neon 的托管 MCP 服务器。这是最简单的设置方式，无需在本地安装此服务器，也不需要在客户端中配置 Neon API 密钥。\n\n运行以下命令，将 Neon MCP 服务器添加到您工作区中检测到的所有代理和编辑器中：\n\n```bash\nnpx add-mcp https:\u002F\u002Fmcp.neon.tech\u002Fmcp\n```\n\n或者，您也可以将以下“Neon”条目添加到您的客户端 MCP 服务器配置文件中（例如 `mcp.json`、`mcp_config.json`）：\n\n```json\n{\n  \"mcpServers\": {\n    \"Neon\": {\n      \"type\": \"http\",\n      \"url\": \"https:\u002F\u002Fmcp.neon.tech\u002Fmcp\"\n    }\n  }\n}\n```\n\n- 重启或刷新您的 MCP 客户端。\n- 浏览器中将打开一个 OAuth 窗口。按照提示授权您的 MCP 客户端访问您的 Neon 账户。\n\n> 使用基于 OAuth 的身份验证时，MCP 服务器默认会在您个人的 Neon 账户下的项目上运行。要访问或管理属于组织的项目，您必须在向 MCP 客户端发出的提示中明确提供 `org_id` 或 `project_id`。\n\n### 方法 3. 远程托管 MCP 服务器（基于 API 密钥的身份验证）\n\n如果您的客户端支持，远程 MCP 服务器也支持使用 `Authorization` 头部中的 API 密钥进行身份验证。\n\n在 Neon 控制台中 [创建一个 Neon API 密钥](https:\u002F\u002Fconsole.neon.tech\u002Fapp\u002Fsettings?modal=create_api_key)。接下来，运行以下命令，将 Neon MCP 服务器添加到您工作区中检测到的所有代理和编辑器中：\n\n```bash\nnpx add-mcp https:\u002F\u002Fmcp.neon.tech\u002Fmcp --header \"Authorization: Bearer \u003C$NEON_API_KEY>\"\n```\n\n或者，您也可以将以下“Neon”条目添加到您的客户端 MCP 服务器配置文件中（例如 `mcp.json`、`mcp_config.json`）：\n\n```json\n{\n  \"mcpServers\": {\n    \"Neon\": {\n      \"type\": \"http\",\n      \"url\": \"https:\u002F\u002Fmcp.neon.tech\u002Fmcp\",\n      \"headers\": {\n        \"Authorization\": \"Bearer \u003C$NEON_API_KEY>\"\n      }\n    }\n  }\n}\n```\n\n> 提供组织的 API 密钥，以限制对组织下项目的访问权限。\n\n### 作用域与只读模式\n\nNeon MCP 支持 OAuth 作用域 `read`、`write` 和 `*`（`*` 表示两者）。您的 MCP 客户端可以直接请求这些作用域，或者您也可以在 OAuth 权限 UI 中进行选择。\n\n**只读模式**会限制可用工具，禁用创建项目、分支或运行迁移等写操作。只读工具包括列出项目、描述模式、查询数据以及查看性能指标。\n\n您可以通过两种方式设置只读模式：\n\n1. **OAuth 作用域选择（推荐）：** 在 OAuth 授权界面中，取消勾选 **完全访问权限** 即可选择只读模式。\n2. **`X-Neon-Read-Only` 头部：** 将 `X-Neon-Read-Only: true` 添加到您的 MCP 服务器配置中：\n\n```json\n{\n  \"mcpServers\": {\n    \"Neon\": {\n      \"url\": \"https:\u002F\u002Fmcp.neon.tech\u002Fmcp\",\n      \"headers\": {\n        \"X-Neon-Read-Only\": \"true\"\n      }\n    }\n  }\n}\n```\n\n该头部的行为如下：\n\n- **API 密钥流程：** `X-Neon-Read-Only` 是启用只读模式的方式（此流程中没有 OAuth 作用域交换）。\n- **OAuth 流程：** `X-Neon-Read-Only: true` 的行为类似于默认同意设置中的 `scope=read`（完全访问权限默认未选中），但用户仍可在批准前在 OAuth UI 中覆盖此设置。\n\n旧版头部 `x-read-only` 也受支持。\n\n> [!重要提示]\n> 如果您更改 MCP 配置文件（例如切换只读模式或改为项目范围的设置），这些更改仅对 **OAuth 流程** 生效，且需要先注销并重新登录。\n> OAuth 权限\u002F作用域是在创建新的 OAuth 令牌时与会话绑定的。\n> 这不适用于 API 密钥流程。\n\n> **注意：** 只读模式限制的是可用的 _工具_，而非 SQL 内容。`run_sql` 工具仍然可用，并可执行任何 SQL，包括 INSERT\u002FUPDATE\u002FDELETE。如需真正的只读 SQL 访问权限，请使用具有受限权限的数据库角色。\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>只读模式下可用的工具\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n- `list_projects`、`list_shared_projects`、`describe_project`、`list_organizations`\n- `describe_branch`、`list_branch_computes`、`compare_database_schema`\n- `run_sql`、`run_sql_transaction`、`get_database_tables`、`describe_table_schema`\n- `list_slow_queries`、`explain_sql_statement`\n- `get_connection_string`\n- `search`、`fetch`、`list_docs_resources`、`get_doc_resource`\n\n**需要写入权限的工具：**\n\n- `create_project`、`delete_project`\n- `create_branch`、`delete_branch`、`reset_from_parent`\n- `provision_neon_auth`、`provision_neon_data_api`\n- `prepare_database_migration`、`complete_database_migration`\n- `prepare_query_tuning`、`complete_query_tuning`\n\n\u003C\u002Fdetails>\n\n### 服务器发送事件 (SSE) 传输（已弃用）\n\nMCP 支持两种远程服务器传输方式：已弃用的服务器发送事件 (SSE) 和更新、推荐的流式 HTTP。如果您的 LLM 客户端尚不支持流式 HTTP，您可以将端点从 `https:\u002F\u002Fmcp.neon.tech\u002Fmcp` 切换到 `https:\u002F\u002Fmcp.neon.tech\u002Fsse`，以改用 SSE。\n\n运行以下命令，为工作区中检测到的所有代理和编辑器添加使用 SSE 传输的 Neon MCP 服务器：\n\n```bash\nnpx add-mcp https:\u002F\u002Fmcp.neon.tech\u002Fsse --type sse\n```\n\n## 远程服务器架构\n\n远程服务器以 Next.js App Router 应用程序的形式在 Vercel 上的 `mcp.neon.tech` 运行。\n\n> [!注释]\n> 根路径 `\u002F` 会重定向到 [Neon MCP 服务器文档](https:\u002F\u002Fneon.tech\u002Fdocs\u002Fai\u002Fneon-mcp-server)。不存在着陆页。\n\n核心实现区域：\n\n- `landing\u002Fapp\u002Fapi\u002F[transport]\u002Froute.ts`: MCP 传输端点，用于流式 HTTP (`\u002Fmcp`) 和 SSE (`\u002Fsse`)\n- `landing\u002Fapp\u002Fapi\u002Fauthorize\u002F`、`landing\u002Fapp\u002Fcallback\u002F`、`landing\u002Fapp\u002Fapi\u002Ftoken\u002F`、`landing\u002Fapp\u002Fapi\u002Frevoke\u002F`: OAuth 流程端点\n- `landing\u002Fapp\u002F.well-known\u002F`: OAuth 发现元数据端点\n- `landing\u002Fmcp-src\u002F`: MCP 服务器、工具、处理器、分析以及 Sentry 集成\n- `landing\u002Flib\u002F`: 兼容 Next.js 的辅助工具（OAuth、配置、错误处理）\n- `landing\u002Fmcp-src\u002Futils\u002Fread-only.ts`: 只读模式和作用域处理\n\n## 指南\n\n- [Neon MCP 服务器指南](https:\u002F\u002Fneon.tech\u002Fdocs\u002Fai\u002Fneon-mcp-server)\n- [将 MCP 客户端连接到 Neon](https:\u002F\u002Fneon.tech\u002Fdocs\u002Fai\u002Fconnect-mcp-clients-to-neon)\n- [Cursor 与 Neon MCP 服务器](https:\u002F\u002Fneon.tech\u002Fguides\u002Fcursor-mcp-neon)\n- [Claude Desktop 与 Neon MCP 服务器](https:\u002F\u002Fneon.tech\u002Fguides\u002Fneon-mcp-server)\n- [Cline 与 Neon MCP 服务器](https:\u002F\u002Fneon.tech\u002Fguides\u002Fcline-mcp-neon)\n- [Windsurf 与 Neon MCP 服务器](https:\u002F\u002Fneon.tech\u002Fguides\u002Fwindsurf-mcp-neon)\n- [Zed 与 Neon MCP 服务器](https:\u002F\u002Fneon.tech\u002Fguides\u002Fzed-mcp-neon)\n\n# 功能\n\n## 支持的工具\n\nNeon MCP 服务器提供以下操作，这些操作作为“工具”暴露给 MCP 客户端。您可以使用这些工具通过自然语言命令与您的 Neon 项目和数据库进行交互。\n\n### 工具范围元数据\n\n每个工具定义都包含一个 `scope` 类别，用于基于授权的工具筛选和同意用户界面。当前类别包括：\n\n- `projects`\n- `branches`\n- `schema`\n- `querying`\n- `neon_auth`\n- `data_api`\n- `docs`\n- `null`（无范围类别的工具）\n\n注意事项：\n\n- `compare_database_schema` 归类于 `schema`。\n- `provision_neon_data_api` 归类于 `data_api`（与 `neon_auth` 分开）。\n- 只读强制仍然依赖于 `readOnlySafe` 和服务器端的只读逻辑；`scope` 是类别元数据，而不是独立的读写开关。\n- 在项目范围模式下（`X-Neon-Project-Id`），`search` 和 `fetch` 不可用。\n\n**项目管理：**\n\n- **`list_projects`**：列出您账户中的前 10 个 Neon 项目，并提供每个项目的摘要信息。如果您找不到特定项目，可以通过将 `limit` 参数设置为更高的值来增加限制。\n- **`list_shared_projects`**：列出与当前用户共享的 Neon 项目。支持搜索参数和限制返回的项目数量（默认：10）。\n- **`describe_project`**：获取特定 Neon 项目的详细信息，包括其 ID、名称以及相关的分支和数据库。\n- **`create_project`**：在您的 Neon 账户中创建一个新的 Neon 项目。项目充当分支、数据库、角色和计算资源的容器。\n- **`delete_project`**：删除现有的 Neon 项目及其所有相关资源。\n- **`list_organizations`**：列出当前用户有权访问的所有组织。可选地使用搜索参数按组织名称或 ID 进行筛选。\n\n**分支管理：**\n\n- **`create_branch`**：在指定的 Neon 项目中创建一个新的分支。利用 [Neon 的分支功能](\u002Fdocs\u002Fintroduction\u002Fbranching) 进行开发、测试或迁移。\n- **`delete_branch`**：从 Neon 项目中删除现有的分支。\n- **`describe_branch`**：检索特定分支的详细信息，例如其名称、ID 和父分支。\n- **`list_branch_computes`**：列出项目或特定分支的计算端点，包括计算 ID、类型、大小、上次活动时间以及自动扩展信息。\n- **`compare_database_schema`**：显示子分支与其父分支之间的模式差异。\n- **`reset_from_parent`**：将当前分支重置为父分支的状态，丢弃本地更改。如果分支有子分支，则会自动保存到备份中；也可以根据请求以自定义名称手动保存。\n\n**SQL 查询执行：**\n\n- **`get_connection_string`**：返回您的数据库连接字符串。\n- **`run_sql`**：对指定的 Neon 数据库执行单个 SQL 查询。支持读取和写入操作。\n- **`run_sql_transaction`**：在 Neon 数据库中以单个事务的形式执行一系列 SQL 查询。\n- **`get_database_tables`**：列出指定 Neon 数据库中的所有表。\n- **`describe_table_schema`**：获取特定表的模式定义，详细说明列、数据类型和约束条件。\n\n**数据库迁移（模式变更）：**\n\n- **`prepare_database_migration`**：启动数据库迁移过程。关键在于创建一个临时分支，以便在影响主分支之前安全地应用和测试迁移。\n- **`complete_database_migration`**：将准备好的数据库迁移最终应用于主分支。此操作会合并临时迁移分支中的更改，并清理临时资源。\n\n**SQL 查询与优化：**\n\n- **`list_slow_queries`**：通过查找数据库中最慢的查询来识别性能瓶颈。需要启用 pg_stat_statements 扩展。\n- **`explain_sql_statement`**：提供 SQL 查询的详细执行计划，以帮助识别性能瓶颈。\n- **`prepare_query_tuning`**：分析查询性能并提出优化建议，例如创建索引。会创建一个临时分支，以便安全地测试这些优化。\n- **`complete_query_tuning`**：通过将优化应用于主分支或将其丢弃来完成查询调优。同时清理临时调优分支。\n\n**Neon 认证：**\n\n- **`provision_neon_auth`**：为 Neon 项目配置 Neon 认证。它允许开发者通过与认证提供商集成，轻松设置身份验证基础设施。\n\n**Neon 数据 API：**\n\n- **`provision_neon_data_api`**：为基于 HTTP 的数据库访问配置 Neon 数据 API，支持通过 Neon 认证或外部 JWKS 提供商进行可选的 JWT 身份验证。\n\n**搜索与发现：**\n\n- **`search`**：跨组织、项目和分支搜索与查询匹配的内容。返回 ID、标题以及指向 Neon 控制台的直接链接。\n- **`fetch`**：使用 ID（通常来自搜索工具）获取特定组织、项目或分支的详细信息。\n\n**文档与资源：**\n\n- **`list_docs_resources`**：通过从 `https:\u002F\u002Fneon.com\u002Fdocs\u002Fllms.txt` 获取索引，列出所有可用的 Neon 文档页面。返回页面 URL 和标题，可使用 `get_doc_resource` 工具单独获取。\n\n- **`get_doc_resource`**：以 Markdown 格式获取特定的 Neon 文档页面内容。请先使用 `list_docs_resources` 工具发现可用的页面 slug，再将该 slug 传递给此工具。\n\n## 迁移\n\n迁移是一种随着时间推移管理数据库模式变化的方式。借助 Neon MCP 服务器，大型语言模型可以使用单独的“开始”（`prepare_database_migration`）和“提交”（`complete_database_migration`）命令安全地执行迁移。\n\n“开始”命令接受迁移脚本并在一个新的临时分支上运行。完成后，该命令会提示大型语言模型在此分支上测试迁移。随后，大型语言模型可以运行“提交”命令，将迁移应用到原始分支上。\n\n# 开发\n\n该项目使用 [Bun](https:\u002F\u002Fbun.sh) 作为包管理器和运行时。\n\n## 项目结构\n\nMCP 服务器代码位于 `landing\u002F` 目录中，这是一个部署在 Vercel 上的 Next.js 应用程序，地址为 `mcp.neon.tech`。\n\n```bash\ncd landing\nbun install\n```\n\n## 本地开发\n\n```bash\n# 启动 Next.js 开发服务器（用于远程 MCP 服务器）\nbun run dev\n```\n\n## 代码检查与类型检查\n\n```bash\nbun run lint\nbun run typecheck\n```\n\n## 环境变量\n\n远程服务器运行时所需：\n\n| 变量              | 描述                           |\n| --------------------- | ------------------------------------- |\n| `SERVER_HOST`         | 服务器 URL（默认为 `VERCEL_URL`） |\n| `UPSTREAM_OAUTH_HOST` | Neon OAuth 提供者 URL               |\n| `CLIENT_ID`           | OAuth 客户端 ID                       |\n| `CLIENT_SECRET`       | OAuth 客户端密钥                   |\n| `COOKIE_SECRET`       | 用于签名 Cookie 的密钥             |\n| `KV_URL`              | Vercel KV（Upstash Redis）URL         |\n| `OAUTH_DATABASE_URL`  | 用于存储令牌的 Postgres URL        |\n\n可选：\n\n| 变量    | 描述                                                                       |\n| ----------- | --------------------------------------------------------------------------------- |\n| `LOG_LEVEL` | Winston 日志级别：`error`、`warn`、`info`（默认）、`debug`、`verbose`、`silly` |\n\n## 测试金字塔\n\n所有测试均从 `landing\u002F` 目录运行。\n\n```bash\ncd landing\n\n# 单元测试\nbun run test:unit\n\n# 集成测试\nbun run test:integration\n\n# MCP 协议端到端测试（真实的 MCP 客户端\u002F服务器工具调用）\nbun run test:e2e:mcp\n\n# 网站端到端测试（使用 Playwright；会先 provision\u002F验证临时数据库）\nbun run test:e2e:web\n\n# 完整的端到端测试套件\nbun run test:e2e\n\n# 完整测试金字塔（单元 + 集成 + e2e；用于 CI）\nbun run test\n```\n\n测试策略：\n\n- 对于传输\u002F协议及用户可见的行为，优先使用 **E2E** 测试。\n- 使用 **集成** 测试来验证确定性的工具契约和工作流行为。\n- 使用 **单元** 测试来覆盖纯逻辑和边缘情况。\n- 避免在合并准入测试中依赖第三方服务的可用性；在集成\u002F单元层模拟外部依赖。\n\n## 部署\n\nVercel 会根据仓库分支配置自动部署远程服务器。针对拉取请求，还提供预览环境。","# Neon MCP Server 快速上手指南\n\nNeon MCP Server 是一个开源工具，允许你通过**自然语言**与 Neon Postgres 数据库进行交互。它基于模型上下文协议（MCP），将你的指令转化为 API 调用，从而轻松管理项目、分支、执行查询和数据库迁移。\n\n> **⚠️ 安全警告**\n> *   Neon MCP Server 拥有强大的数据库管理能力。**在执行 LLM 请求的操作前，务必审查并授权。**\n> *   该工具仅适用于**本地开发和 IDE 集成**，**不建议在生产环境中使用**。\n\n## 1. 环境准备\n\n在开始之前，请确保满足以下前置条件：\n\n*   **Neon 账户**：拥有一个 [Neon 账户](https:\u002F\u002Fconsole.neon.tech\u002Fsignup)。\n*   **Node.js**：版本需 >= v18.0.0（从 [nodejs.org](https:\u002F\u002Fnodejs.org) 下载）。\n*   **MCP 客户端**：已安装支持 MCP 的编辑器或 Agent，例如：\n    *   Cursor\n    *   VS Code (配合 GitHub Copilot)\n    *   Claude Code\n    *   Cline, Windsurf, Zed 等\n*   **(可选) Bun**：如果你计划参与开发，需要安装 [Bun](https:\u002F\u002Fbun.sh)。\n\n## 2. 安装步骤\n\n你可以选择以下三种方式之一进行配置。推荐初学者使用**方案一**或**方案二**。\n\n### 方案一：一键快速设置（推荐）\n\n此方法会自动处理 OAuth 认证、创建 API Key 并配置编辑器。适用于 Cursor、VS Code 和 Claude Code。\n\n在终端运行以下命令：\n\n```bash\nnpx neonctl@latest init\n```\n\n### 方案二：远程托管服务 + OAuth 认证（无需 API Key）\n\n此方法最便捷，无需手动管理 API Key，且能自动获取最新功能。\n\n**方法 A：使用命令行自动添加**\n运行以下命令，为工作区中检测到的所有 Agent 和编辑器添加配置：\n\n```bash\nnpx add-mcp https:\u002F\u002Fmcp.neon.tech\u002Fmcp\n```\n\n**方法 B：手动修改配置文件**\n在你的 MCP 客户端配置文件（如 `mcp.json` 或 `mcp_config.json`）中添加以下内容：\n\n```json\n{\n  \"mcpServers\": {\n    \"Neon\": {\n      \"type\": \"http\",\n      \"url\": \"https:\u002F\u002Fmcp.neon.tech\u002Fmcp\"\n    }\n  }\n}\n```\n\n*配置完成后，重启或刷新你的 MCP 客户端。浏览器将弹出 OAuth 窗口，请按提示授权访问你的 Neon 账户。*\n\n### 方案三：远程托管服务 + API Key 认证\n\n适用于无法使用 OAuth 的远程 Agent 场景。\n\n1. 在 [Neon Console](https:\u002F\u002Fconsole.neon.tech\u002Fapp\u002Fsettings?modal=create_api_key) 创建 API Key。\n2. 运行以下命令（将 `\u003C$NEON_API_KEY>` 替换为你的实际密钥）：\n\n```bash\nnpx add-mcp https:\u002F\u002Fmcp.neon.tech\u002Fmcp --header \"Authorization: Bearer \u003C$NEON_API_KEY>\"\n```\n\n或者手动配置 `mcp.json`：\n\n```json\n{\n  \"mcpServers\": {\n    \"Neon\": {\n      \"type\": \"http\",\n      \"url\": \"https:\u002F\u002Fmcp.neon.tech\u002Fmcp\",\n      \"headers\": {\n        \"Authorization\": \"Bearer \u003C$NEON_API_KEY>\"\n      }\n    }\n  }\n}\n```\n\n## 3. 基本使用\n\n配置完成后，你可以在支持的 MCP 客户端（如 Cursor 聊天窗口或 Claude Code）中直接使用自然语言操作数据库。\n\n### 常用示例\n\n**创建数据库和表：**\n```text\nLet's create a new Postgres database, and call it \"my-database\". Let's then create a table called users with the following columns: id, name, email, and password.\n```\n\n**执行数据库迁移（添加列）：**\n```text\nI want to run a migration on my project called \"my-project\" that alters the users table to add a new column called \"created_at\".\n```\n\n**查询项目概况：**\n```text\nCan you give me a summary of all of my Neon projects and what data is in each one?\n```\n\n### 进阶：只读模式\n\n为了防止误操作，你可以启用只读模式（禁用创建项目、分支或迁移等写入操作，但保留 SQL 查询功能）。\n\n**配置方法：**\n在 `mcp.json` 中添加 `X-Neon-Read-Only` 头：\n\n```json\n{\n  \"mcpServers\": {\n    \"Neon\": {\n      \"url\": \"https:\u002F\u002Fmcp.neon.tech\u002Fmcp\",\n      \"headers\": {\n        \"X-Neon-Read-Only\": \"true\"\n      }\n    }\n  }\n}\n```\n\n> **注意**：只读模式仅限制可用的**工具**（如禁止调用 `create_project`），`run_sql` 工具仍然可用并可执行任意 SQL（包括 INSERT\u002FUPDATE\u002FDELETE）。若需严格的 SQL 只读权限，请在数据库层面配置角色权限。","某初创公司的全栈开发者需要在本地快速搭建新功能模块，并频繁创建临时数据库分支以验证不同的数据模型方案。\n\n### 没有 mcp-server-neon 时\n- 开发者必须手动查阅 Neon API 文档，编写复杂的 cURL 命令或脚本才能创建项目和分支，耗时且易出错。\n- 每次修改表结构都需要切换上下文，先写 SQL 迁移文件，再手动执行命令行工具，流程割裂严重。\n- 非技术背景的产品经理无法直接查看数据库状态，必须依赖开发人员导出报表，沟通效率低下。\n- 在尝试高风险操作（如删除列）前缺乏直观的预览机制，容易因手误导致开发环境数据丢失。\n\n### 使用 mcp-server-neon 后\n- 开发者直接在 IDE 对话框输入“为支付功能创建一个带用户表和交易记录的新分支”，mcp-server-neon 自动调用 API 完成全套初始化。\n- 只需说出“在用户表中添加注册时间和状态字段”，mcp-server-neon 即可理解意图并自动执行相应的架构变更。\n- 产品经理可通过自然语言询问“显示当前所有项目的表格概要”，mcp-server-neon 即时生成易懂的数据摘要供团队评审。\n- 在执行敏感操作前，mcp-server-neon 会列出具体变更计划等待人工确认，有效拦截了潜在的误操作风险。\n\nmcp-server-neon 将繁琐的数据库运维转化为流畅的自然语言交互，让团队能专注于业务逻辑创新而非基础设施管理。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fneondatabase_mcp-server-neon_a1b38b3a.png","neondatabase","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fneondatabase_19d2f05f.png","",null,"https:\u002F\u002Fneon.tech","https:\u002F\u002Fgithub.com\u002Fneondatabase",[83,87,91],{"name":84,"color":85,"percentage":86},"TypeScript","#3178c6",97.3,{"name":88,"color":89,"percentage":90},"JavaScript","#f1e05a",2.5,{"name":92,"color":93,"percentage":94},"CSS","#663399",0.3,570,104,"2026-04-02T15:43:14","MIT","未说明","不需要",{"notes":102,"python":100,"dependencies":103},"该工具是一个基于 Node.js 的 MCP 服务器，用于通过自然语言与 Neon Postgres 数据库交互。主要运行方式为连接 Neon 托管的远程服务器（无需本地部署），或通过 CLI 工具进行本地配置。生产环境不建议使用，仅限本地开发和 IDE 集成。支持 OAuth 和 API Key 两种认证方式。",[104,105],"Node.js (>= v18.0.0)","Bun (仅开发需要)",[15,45],"2026-03-27T02:49:30.150509","2026-04-06T08:45:29.873194",[],[]]