local-mysql
Provides tools for querying and executing SQL statements against a local MySQL database, enabling AI agents to perform SELECT queries and INSERT/UPDATE operations on specified schemas.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@local-mysqlshow me the top 10 products by sales from the fo schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
local-mysql MCP Server
This is a local development MCP server that exposes FO MySQL databases to VSCode (and Copilot CLI). It provides two tools: query (SELECT only) and execute (INSERT / UPDATE only).
This server is for local development only. Do not deploy to production environments or connect to production databases.
Connection Settings
The default values are aligned with src/main/resources/application.yml.
Item | Default | Override via Env Var |
host |
|
|
port |
|
|
user |
|
|
password |
|
|
The connection pool is schema-agnostic and does not bind to a default database. Specify the schema using the schema parameter for each call, or use fully qualified names like oa.t_xxx. Allowed schemas: fo, oa, bo, cm, nepro.
Related MCP server: MySQL MCP Server
Installation and Build
cd mcp-server
npm install
npm run buildAfter building, restart your MCP client (VSCode / Copilot CLI) to reload the configuration.
For iterative development without rebuilding:
npm run devTools
query — Read-only SELECT
{
"sql": "SELECT id, name FROM m_article WHERE id = ?",
"params": [123],
"schema": "fo" // 省略可
}Return value:
{
"schema": "fo",
"rowCount": 1,
"truncated": false,
"maxRows": 1000,
"fields": [{ "name": "id", "type": 3 }, { "name": "name", "type": 253 }],
"rows": [{ "id": 123, "name": "..." }]
}Constraints:
Single statement only (multiple statements are rejected)
Must start with
SELECT(CTE /WITHis not supported in v1)Result limit: 1000 rows. If
truncated: true, it indicates that more rows exist.
execute — INSERT or UPDATE
{
"sql": "UPDATE m_article SET name = ? WHERE id = ?",
"params": ["new name", 123],
"schema": "fo"
}Return value:
{
"schema": "fo",
"affectedRows": 1,
"insertId": 0,
"changedRows": 1,
"warningStatus": 0
}Constraints:
Single statement only
Must start with
INSERTorUPDATEDELETE,DROP,ALTER,CREATE,TRUNCATE,RENAME,GRANT,REVOKE,REPLACE,MERGE,CALL,LOAD,HANDLER,LOCK,UNLOCK,SET,USE,START,BEGIN,COMMIT,ROLLBACK,SAVEPOINT— all rejected
Integration
Clone this repository alongside the project that will use this server, and set up the directory structure as follows:
parent/
├── mcp-local-mysql/ ← このリポジトリ
└── your-project/
└── .vscode/mcp.json (Copilot CLI の場合は .mcp.json)VSCode
Add .vscode/mcp.json to the root of your project. The root key is servers:
{
"servers": {
"local-mysql": {
"command": "node",
"args": ["../mcp-local-mysql/dist/index.js"],
"env": {}
}
}
}To override credentials per workspace, edit the env object. Example:
"env": { "FO_DB_USER": "devuser", "FO_DB_PASS": "devpass" }Also, ensure MCP discovery is enabled in .vscode/settings.json so that VSCode recognizes .vscode/mcp.json:
{
"chat.mcp.discovery.enabled": true
}Copilot CLI
Add .mcp.json to the root of your project. The root key is mcpServers:
{
"mcpServers": {
"local-mysql": {
"command": "node",
"args": ["../mcp-local-mysql/dist/index.js"],
"env": {}
}
}
}Security Notes
multipleStatements: falseis set at the driver level (defense-in-depth added to the validator)All queries are parameterized — values must always be passed via
paramsand never embedded directly into the SQL stringSchema names are matched against a whitelist before being embedded into
USE `...`Server logs are output only to stderr. stdout is reserved exclusively for the MCP protocol frames
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides secure, multi-database MySQL access with configurable security levels, enabling SQL queries across multiple databases directly from VS Code.5191MIT
- AlicenseNot gradedqualityDmaintenanceA MySQL MCP server for secure database interaction, enabling schema inspection, query execution, and RBAC via AI coding assistants.6555MIT
- AlicenseNot gradedqualityBmaintenanceA MySQL MCP server for local stdio clients, enabling database queries and management with read-only/write modes, audit logging, and configurable security.655MIT
- AlicenseNot gradedqualityDmaintenanceA read-only MCP server that enables Claude Code to access MySQL databases, allowing safe querying with SELECT, SHOW, DESCRIBE, and EXPLAIN.29MIT
Related MCP Connectors
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.
MCP server for managing Prisma Postgres.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nhs-ayamura/mcp-local-mysql'
If you have feedback or need assistance with the MCP directory API, please join our Discord server