- Home
- MCP servers
- Mysql Mongo
Mysql Mongo
- javascript
8
GitHub Stars
javascript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"yaoxiaolinglong-mcp-mongodb-mysql-server": {
"command": "node",
"args": [
"/absolute/path/to/mcp-mongodb-mysql-server/build/index.js"
],
"env": {
"DB_HOST": "localhost",
"DB_USER": "your_user",
"DB_DATABASE": "your_database",
"DB_PASSWORD": "your_password",
"MONGODB_URI": "mongodb://user:password@host:27017/database",
"DATABASE_URL": "mysql://user:password@host:3306/database",
"MONGODB_DATABASE": "your_database"
}
}
}
}You can run a Model Context Protocol (MCP) server that exposes both MySQL and MongoDB database operations. This server lets AI models interact with these databases through a standardized interface, enabling practical data access and manipulation from within your MCP client workflows.
How to use
Install and run the MCP server locally, then connect your MCP client to perform cross-database operations. You will configure a single MCP server that supports both MySQL and MongoDB, and you can use the provided tools to query, modify schemas, and manage data across either database. Use the server name you configure to invoke the available MySQL and MongoDB tools from your MCP client.
How to install
# Prerequisites: Node.js and npm
# 1) Install the MCP server client for Claude via Smithery (automatic installation)
# This installs the MCP server so you can run it with Claude
npx -y @smithery/cli install @yaoxiaolinglong/mcp-mongodb-mysql-server --client claude
# 2) Manual installation (optional)
# Clone the project
git clone https://github.com/yaoxiaolinglong/mcp-mongodb-mysql-server.git
cd mcp-mongodb-mysql-server
# Install dependencies
npm install
# Build the project
npm run build
# 3) Add the MCP server to Cursor IDE (manual start in IDE)
# Open Cursor IDE, run the following to register the server
# Name: mysql_mongodb
# Type: command
# Command: node /absolute/path/to/mcp-mongodb-mysql-server/build/index.js
Additional setup and configuration
Configure connections to MySQL and MongoDB using any of the supported methods shown below. You can place these settings in your project’s .env file or supply them directly to the MCP tool when establishing connections.
Database configuration and security
MySQL configuration supports three methods: a single DATABASE_URL in the .env file, individual parameters in the .env file, or direct connections via a tooling helper. MongoDB configuration mirrors this approach with a MongoDB URL and optional database name. The server emphasizes secure password handling through environment variables, prepared statements for MySQL, and automatic connection cleanup.
Troubleshooting and notes
If you encounter connection failures, verify that your environment variables are correctly set, the database servers are reachable, and the MCP server has permissions to access the databases. Ensure you are running the exact start command described for your setup and that the build output index.js path is correct in your environment.
Available tools
connect_db
Connect to a MySQL database using URL, workspace path, or direct credentials.
query
Execute SELECT queries with optional prepared statement parameters.
execute
Execute INSERT, UPDATE, or DELETE queries with optional prepared statement parameters.
list_tables
List all tables in the connected MySQL database.
describe_table
Get the structure of a specific MySQL table.
create_table
Create a new MySQL table with specified fields and indexes.
add_column
Add a new column to an existing MySQL table.
connect_mongodb
Connect to a MongoDB database using URL or workspace path.
mongodb_list_collections
List all collections in the connected MongoDB database.
mongodb_find
Find documents in a MongoDB collection with optional filter, limit, skip, and sort.
mongodb_insert
Insert documents into a MongoDB collection.
mongodb_update
Update documents in a MongoDB collection.
mongodb_delete
Delete documents from a MongoDB collection.
mongodb_create_collection
Create a new collection in MongoDB.