Quick start
This guide will help you get an MCP server running and execute your first queries. We’ll use the MySQL server as an example, but the same concepts apply to all servers in this collection.Prerequisites
Before you begin, ensure you have:- A MySQL database running (or access to one)
- Node.js installed (for NPM installation) OR Docker installed
- Claude Desktop app (optional, for AI integration)
Step 1: Choose your installation method
- NPM
- Docker
Install and run the MySQL MCP server using npx:With environment variables for credentials:
Connection strings are optional at startup. If you don’t provide one, you can connect later using the
mysql-connect tool.Step 2: Connect to your database
Once the server is running, connect to your MySQL database using themysql-connect tool.
Connection parameters
- connectionString: MySQL connection string (e.g.,
host.docker.internal:3306/mydb) - user: Database username (e.g.,
root) - password: Database password
Example connection
Step 3: Explore your database schema
The MCP server automatically discovers table schemas and exposes them as resources.View available tables
Resources are exposed in the format:mysql://hr/employees/schemamysql://hr/departments/schema
Get table statistics
Use themysql-stats tool to retrieve comprehensive statistics for a table:
- Table and index statistics
- Column statistics
- Row count and data size
Step 4: Execute your first query
All queries are executed within READ ONLY transactions to prevent data modification.Query syntax
Use themysql-query tool with SQL:
Example queries
Find all tables in the database:Step 5: Analyze query performance
Use themysql-explain tool to understand query execution plans.
Generate an explain plan
- Table access methods
- Index usage
- Estimated rows scanned
- Join order
Optimize your queries
Based on the explain plan, you can:- Add missing indexes
- Rewrite inefficient queries
- Identify full table scans
Step 6: Generate a performance report
Themysql-awr tool generates a comprehensive performance report similar to Oracle’s Automatic Workload Repository.
Run the AWR report
- Database statistics and uptime
- InnoDB metrics (buffer pool, log writes)
- Top queries by execution time (requires Performance Schema)
- Table and index statistics
- Connection information
- Optimization recommendations
For optimal performance monitoring, ensure the Performance Schema is enabled:
Step 7: Integrate with Claude Desktop
Connect the MCP server to Claude Desktop for AI-powered database analysis.Locate your configuration file
Find
claude_desktop_config.json in your system:- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Example prompts for Claude
Once integrated with Claude Desktop, try these prompts: Connect to database:Try other servers
Now that you’ve mastered the MySQL server, try the other servers in this collection:Oracle Database
Connect to Oracle databases with AWR reporting and explain plansConnection example:
PostgreSQL
Query PostgreSQL with performance analysis and pg_stat_statements integrationConnection example:
MikroTik RouterOS
Monitor MikroTik routers with security audits and performance reportsConnection example:
QNAP NAS
Monitor QNAP NAS devices and manage filesConnection example:
Common issues
Connection failed
Problem: Unable to connect to the database. Solutions:- Verify the database is running and accessible
- Check credentials in environment variables
- Use
host.docker.internalinstead oflocalhostwhen using Docker on macOS - Ensure firewall rules allow connections
Permission denied
Problem: Query execution fails with permission errors. Solutions:- Verify the database user has SELECT privileges
- For explain plans (Oracle), grant
SELECT_CATALOG_ROLE - For AWR reports (Oracle), grant
EXECUTE ON DBMS_WORKLOAD_REPOSITORY
Performance Schema not available (MySQL)
Problem: AWR report shows limited query statistics. Solution: Enable Performance Schema in MySQL configuration:Next steps
Installation guide
View detailed installation instructions for all servers
Introduction
Learn about all available servers and their features