Skip to content

MySQL MCP and API

MySQL exposes database schemas and SQL queries through a locally running MCP server. An agent can inspect table schemas and run SQL queries against a configured database. Add your MYSQL_HOST, MYSQL_USER and MYSQL_PASS when you install the MySQL MCP server in Longwave.

Add to Longwave

Install elsewhere

Install MySQL

Choose a harness. These instructions start the same local MCP server shown on this page.

Claude Code

Run this in your terminal. It adds a user-scoped server; use --scope project instead if it should apply only to the current project.

terminal
claude mcp add --scope user --transport stdio --env MYSQL_HOST=YOUR_MYSQL_HOST --env MYSQL_USER=YOUR_MYSQL_USER --env MYSQL_PASS=YOUR_MYSQL_PASS mysql -- npx -y @benborla29/mcp-server-mysql

Replace each YOUR_… value with the required secret before running the command.

access
Your key

Use MySQL on Longwave

  1. Download Longwave or open app.longwave.run.
  2. Add your MYSQL_HOST, MYSQL_USER and MYSQL_PASS when you install the MySQL MCP server in Longwave.
  3. Ask for the result in any thread, for example: “Read a table schema before writing SQL”. The agent picks the MySQL function and calls it.

Use cases

Questions people ask

How does the MySQL MCP server connect to a database?

The listed server uses configured MySQL connection details. The database account determines the records and operations it can access. MySQL documentation

Can the MySQL server restrict database writes?

The listed server documents access controls for write operations. Configure those controls and the database user permissions for the required access. MySQL documentation

How do I add the MySQL MCP server to Claude Code?

Run claude mcp add mysql -- npx -y @benborla29/mcp-server-mysql in a terminal. Add your MYSQL_HOST, MYSQL_USER and MYSQL_PASS when you install the MySQL MCP server in Longwave.

Who publishes the MySQL MCP server?

benborla publishes the MySQL MCP server that Longwave installs. Source code

Use MySQL in Longwave

Call MySQL from any agent thread, on your machine or in the cloud.

Add to Longwave