Get the FREE Ultimate OpenClaw Setup Guide →

mcp-mongodb-mysql

用于mysql和mongodb的mcp

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio yaoxiaolinglong-mcp-mongodb-mysql-server node build/index.js

How to use

This MCP server provides a unified interface to interact with both MySQL and MongoDB databases via the Model Context Protocol. It exposes a set of built-in tools that let AI models connect to databases, run queries, and manage collections entirely through MCP tool calls. The available tools are organized into two groups: MySQL tools and MongoDB tools. MySQL tools include connecting to a database, executing selects, inserts/updates/deletes, listing tables, describing tables, and creating or altering table structures. MongoDB tools include connecting to a database, listing collections, finding documents with filters, and basic collection-level operations. To use these tools, you invoke use_mcp_tool with the appropriate server_name (mysql-mongodb), tool_name, and arguments as shown in the README examples.

How to install

Prerequisites:

  • Node.js installed on your machine
  • Git installed
  • Access to your MCP environment (e.g., Cursor IDE or Smithery workflow)

Manual installation steps:

  1. Clone the repository and install dependencies
git clone https://github.com/yaoxiaolinglong/mcp-mongodb-mysql-server.git
cd mcp-mongodb-mysql-server
npm install
  1. Build the project (if required by the setup)
npm run build
  1. Run the server locally (example)
node build/index.js
  1. In your MCP environment, register the server as an MCP source named mysql-mongodb with the command configured accordingly (see mcp_config below).

Optional Smithery installation (automatic):

npx -y @smithery/cli install @yaoxiaolinglong/mcp-mongodb-mysql-server --client claude
  1. Configure database connections via environment variables or a .env file as described in the repository docs.

Additional notes

Tips:

  • Ensure your environment variables (DATABASE_URL / MONGODB_URI) are correctly set to allow the server to connect to both MySQL and MongoDB.
  • When using the connect tools, prefer the URL-based configuration for simplicity, but you can fall back to workspace paths or explicit credentials if needed.
  • If you run into connection issues, check that your database ports are accessible from the host running the MCP server and that user credentials have the necessary privileges.
  • The server name used in tools is mysql-mongodb; ensure consistency across your MCP tool calls.
  • When upgrading, re-build the project to ensure latest changes (npm run build) before restarting the MCP server.

Related MCP Servers

Sponsor this space

Reach thousands of developers