Postgres Mysql MCP Server
An MCP server for querying PostgreSQL and MySQL databases, supporting functions such as connecting to databases, executing queries, and viewing table structures through AI editors.
rating : 2.5 points
downloads : 6.8K
What is MCP SQL Server?
MCP SQL Server is a bridge tool that connects AI assistants to databases. It allows AI code editors like Cursor and Windsurf to directly access your PostgreSQL or MySQL databases, view table structures, execute queries, and generate accurate code that perfectly matches your database.How to use MCP SQL Server?
Just configure it once in your AI editor, and the AI assistant can gain database access capabilities. The AI can automatically query your table structures, generate matching SQL statements, check data issues, and create application code that is fully compatible with your database.Use cases
Suitable for developers when using AI-assisted programming, especially when generating database-related code, debugging SQL issues, understanding existing database structures, or creating APIs that interact with databases.Main features
Dual database support
Supports both PostgreSQL and MySQL, two mainstream databases, without the need to switch tools.
Intelligent connection management
Supports environment variable configuration, can automatically connect, and parameters can override environment variables.
Database exploration
List all data tables, view table structures, and understand field types and relationships.
Secure query execution
Supports parameterized queries to prevent SQL injection and ensure query security.
Zero-installation operation
Can be directly run via npx without local installation, always keeping the latest version.
Editor integration
Perfectly integrates with AI editors such as Cursor and Windsurf to improve development efficiency.
Advantages
๐ Improve development efficiency: AI can directly access the database, generate accurate code, and reduce the time for manual table lookup.
๐ Secure and reliable: Supports SSL connections and parameterized queries to protect database security.
๐ Flexible configuration: Supports multiple configuration methods (environment variables, direct parameters, mixed use).
๐ฑ Widely compatible: Supports mainstream AI editors (Cursor, Windsurf, etc.).
โก Performance optimization: Built-in connection pool for fast query response.
๐ฏ Precise code: Generate code based on the actual database structure to avoid field name errors.
Limitations
๐ Learning cost: Need to understand the MCP protocol and editor configuration.
๐ง Environment dependency: Requires a Node.js 18+ runtime environment.
๐ Network requirement: Need to be able to access the database server.
๐ก๏ธ Permission control: AI has database connection permissions, which need to be carefully managed.
๐พ Memory usage: May occupy a certain amount of memory during long-term operation.
How to use
Choose the running method
It is recommended to use npx to run directly without installation. You can also install it globally or locally.
Configure the editor
Add server configuration in the MCP settings of Cursor or Windsurf and set the database connection information.
Set environment variables
Create a .env file or set system environment variables, including database connection information.
Start using
Ask questions or request code in the AI editor, and the AI will automatically use the database tools.
Usage examples
Database structure exploration
When you need to know what tables are in the database or view the structure of a specific table, AI can directly query through the MCP tool.
Intelligent code generation
Generate API code that perfectly matches the database structure to avoid field name errors.
Data query and debugging
Directly query database data to debug problems or obtain information.
Migration and refactoring assistance
Help update relevant code when the database structure changes.
Frequently Asked Questions
Do I need to install Node.js?
Which databases are supported?
How to ensure database security?
Can it be used in a production environment?
Which AI editors are supported?
What if the connection fails?
Can I connect to multiple databases at the same time?
How is the query performance?
Related resources
GitHub repository
Source code, issue feedback, and contribution guidelines.
Model Context Protocol official website
Official documentation and specifications of the MCP protocol.
Cursor editor
An AI code editor that supports MCP.
Windsurf editor
Another AI development environment that supports MCP.
Node.js download
Download the runtime environment (requires version 18+).
PostgreSQL documentation
Official documentation of PostgreSQL.
MySQL documentation
Official documentation of MySQL.

Notion Api MCP
Certified
A Python-based MCP Server that provides advanced to-do list management and content organization functions through the Notion API, enabling seamless integration between AI models and Notion.
Python
17.5K
4.5 points

Markdownify MCP
Markdownify is a multi-functional file conversion service that supports converting multiple formats such as PDFs, images, audio, and web page content into Markdown format.
TypeScript
28.6K
5 points

Gitlab MCP Server
Certified
The GitLab MCP server is a project based on the Model Context Protocol that provides a comprehensive toolset for interacting with GitLab accounts, including code review, merge request management, CI/CD configuration, and other functions.
TypeScript
17.5K
4.3 points

Duckduckgo MCP Server
Certified
The DuckDuckGo Search MCP Server provides web search and content scraping services for LLMs such as Claude.
Python
54.9K
4.3 points

Figma Context MCP
Framelink Figma MCP Server is a server that provides access to Figma design data for AI programming tools (such as Cursor). By simplifying the Figma API response, it helps AI more accurately achieve one - click conversion from design to code.
TypeScript
51.3K
4.5 points

Unity
Certified
UnityMCP is a Unity editor plugin that implements the Model Context Protocol (MCP), providing seamless integration between Unity and AI assistants, including real - time state monitoring, remote command execution, and log functions.
C#
24.3K
5 points

Gmail MCP Server
A Gmail automatic authentication MCP server designed for Claude Desktop, supporting Gmail management through natural language interaction, including complete functions such as sending emails, label management, and batch operations.
TypeScript
17.2K
4.5 points

Minimax MCP Server
The MiniMax Model Context Protocol (MCP) is an official server that supports interaction with powerful text-to-speech, video/image generation APIs, and is suitable for various client tools such as Claude Desktop and Cursor.
Python
36.7K
4.8 points
ยฉ 2025AIBase
