
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you're building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.
This repository is an example of how to create an MCP server for managing MySQL databases.
A Model Context Protocol server for interacting with a MySQL database. It provides tools for executing queries, creating and describing tables, inserting and fetching data, as well as listing existing tables.
The server implements the following tools:
execute_query
: Execute an arbitrary SQL query.
query
)list_tables
: List all tables in the current database
create_table
: Create a new table
name
(table name) and schema
(column definitions)describe_table
: Show the structure of a specific table
table
(name of the table)insert_data
: Insert new row into a table
table
(target table name) and data
(dict of column values)fetch_data
: Fetch data by executing a SELECT query
query
)The MCP server connects to a MySQL database using environment variables. You need to set the following environment variables before running the server:
MYSQL_HOST
: MySQL server hostnameMYSQL_PORT
: MySQL server portMYSQL_USER
: MySQL usernameMYSQL_PASSWORD
: MySQL passwordMYSQL_DATABASE
: MySQL database nameThese settings are loaded using Pydantic's BaseSettings, which will raise an error if the required environment variables are not set.
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mysql": {
"command": "uvx",
"args": [
"mcp-server-mysql"
]
}
}
To prepare the package for distribution:
uv sync
uv build
This will create source and wheel distributions in the dist/
directory.
uv publish
Note: You'll need to set PyPI credentials via environment variables or command flags:
--token
or UV_PUBLISH_TOKEN
--username
/UV_PUBLISH_USERNAME
and --password
/UV_PUBLISH_PASSWORD
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm
with this command:
npx @modelcontextprotocol/inspector uv --directory $(PWD) run mcp-server-mysql
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
FAQs
Add your description here
We found that mcp-server-mysql demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.