Skip to main content
Glama

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

localhost

FO_DB_HOST

port

3306

FO_DB_PORT

user

root

FO_DB_USER

password

admin

FO_DB_PASS

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 build

After building, restart your MCP client (VSCode / Copilot CLI) to reload the configuration.

For iterative development without rebuilding:

npm run dev

Tools

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 / WITH is 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 INSERT or UPDATE

  • DELETE, 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: false is set at the driver level (defense-in-depth added to the validator)

  • All queries are parameterized — values must always be passed via params and never embedded directly into the SQL string

  • Schema 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

Install Server
F
license - not found
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    Not graded
    quality
    D
    maintenance
    A 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.
    519
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A MySQL MCP server for secure database interaction, enabling schema inspection, query execution, and RBAC via AI coding assistants.
    655
    5
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    A MySQL MCP server for local stdio clients, enabling database queries and management with read-only/write modes, audit logging, and configurable security.
    655
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A read-only MCP server that enables Claude Code to access MySQL databases, allowing safe querying with SELECT, SHOW, DESCRIBE, and EXPLAIN.
    29
    MIT

View all related MCP servers

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.

View all MCP Connectors

Latest Blog Posts

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