drio
Open app

MCP-MongoDB-MySQL-Server

Source

用于mysql和mongodb的mcp

Catalog onlyCatalog onlySTDIO

Overview

MCP-MongoDB-MySQL-Server is a Model Context Protocol server that provides operations for both MySQL and MongoDB databases, enabling AI models to interact with these databases through a standardized interface.

To use the server, you can install it via Smithery or manually clone the repository, build it, and configure it in your IDE. You can connect to either MySQL or MongoDB using various methods such as URL, workspace, or direct parameters.

  • Supports both MySQL and MongoDB databases. - Multiple connection methods (URL, workspace, direct parameters). - Prepared statement support for MySQL queries. - Comprehensive error handling and validation. - TypeScript support. - Automatic workspace detection.
  1. Connecting AI models to MySQL and MongoDB databases.
  2. Executing complex queries and managing database schemas.
  3. Facilitating data operations in applications requiring both SQL and NoSQL databases.

Add to your AI client

Use these steps to connect MCP-MongoDB-MySQL-Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.

Cursor

Add this to your .cursor/mcp.json file in your project root, then restart Cursor.

.cursor/mcp.json

{
  "mcpServers": {
    "mcp-mongodb-mysql-server-yaoxiaolinglong": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-mongodb-mysql-server-yaoxiaolinglong"
      ]
    }
  }
}

Claude Desktop

Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

{
  "mcpServers": {
    "mcp-mongodb-mysql-server-yaoxiaolinglong": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-mongodb-mysql-server-yaoxiaolinglong"
      ]
    }
  }
}

Claude Code

Add this to your project's .mcp.json file. Claude Code will detect it automatically.

.mcp.json (project root)

{
  "mcpServers": {
    "mcp-mongodb-mysql-server-yaoxiaolinglong": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-mongodb-mysql-server-yaoxiaolinglong"
      ]
    }
  }
}

VS Code (Copilot)

Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.

.vscode/mcp.json

{
  "servers": {
    "mcp-mongodb-mysql-server-yaoxiaolinglong": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-mongodb-mysql-server-yaoxiaolinglong"
      ]
    }
  }
}

Windsurf

Add this to your Windsurf MCP config file, then restart Windsurf.

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "mcp-mongodb-mysql-server-yaoxiaolinglong": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-mongodb-mysql-server-yaoxiaolinglong"
      ]
    }
  }
}

Cline

Open Cline settings, navigate to MCP Servers, and add this server configuration.

Cline MCP Settings (via UI)

{
  "mcpServers": {
    "mcp-mongodb-mysql-server-yaoxiaolinglong": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-mongodb-mysql-server-yaoxiaolinglong"
      ]
    }
  }
}

FAQ

Can I use this server for both MySQL and MongoDB?

Yes! This server supports operations for both MySQL and MongoDB databases.

How do I install the server?

You can install it via Smithery or manually by cloning the repository and following the setup instructions.

Is there support for error handling?

Yes, the server provides detailed error messages for connection failures, invalid queries, and more.

MCP-MongoDB-MySQL-Server — MCP Registry