Model Context Protocol (MCP) Server for Local MySQL

by Martyr2

337 downloads
Not rated
GitHub Website

About

Quick little template for a local MCP MySQL server.

Details

Author
Martyr2
Downloads
337
Categories
Database

- Bare bones basic implementation using FastMCP for Python
- Connects to a local MySQL database
- Quick setup with minimal configuration
- Environment‑based credential management via .env
- Easily extendable for custom use cases

Copy the files into a fresh project with a virtual environment, install dependencies with pip install -r requirements.txt, rename .env.sample to .env, set your database credentials in the .env file, then run the project using python server.py or mcp dev server.py. To incorporate it into Claude Code, add the MCP to Claude’s MCP server list.

Model Context Protocol (MCP) Server for Local MySQL

Purpose

This is a bare bones basic implementation of an MCP server using FastMCP for Python. I am providing this for anyone who wants to quickly copy, paste run and connect to their tool of choice. Then extend it as they see fit.

How To Get Started

1. Copy the files into a fresh project with a virtual environment set up.
2. Type: pip install -r requirements.txt (to install the packages into the virutal environment)
3. Rename the .env.sample file to be just .env
4. Set your database credentials in the .env file
5. Run the project using: python server.py or for the inspector mcp dev server.py

Incorporate it into Claude Code

Claude Code can run these MCP servers by launching a process. Simply add the MCP to the Claude MCP server list (check out the /mcp command for details) and once connected, you can type in a query that would use the tool.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.