MySQL Database Access
STDIOA Model Context Protocol server for MySQL database access.
A Model Context Protocol server for MySQL database access.
A Model Context Protocol server for MySQL database access
This is a TypeScript-based MCP server that provides tools for querying MySQL databases. It demonstrates core MCP concepts by providing:
query
- Execute SQL queries
Set the following environment variables in your MCP server configuration:
Install dependencies:
npm install
Build the server:
npm run build
For development with auto-rebuild:
npm run watch
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{ "mcpServers": { "mysql": { "command": "/path/to/mysql-server/build/index.js", "env": { "MYSQL_HOST": "your-mysql-host", "MYSQL_USER": "your-mysql-user", "MYSQL_PASSWORD": "your-mysql-password", "MYSQL_DATABASE": "your-mysql-database" } } } }
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
npm run inspector
The Inspector will provide a URL to access debugging tools in your browser.