Problem
The server registers itself with a hardcoded FastMCP server name (MariaDB_Server), which is returned as serverInfo.name during the MCP initialize handshake.
This becomes a problem when running multiple instances of the server against different databases (e.g. separate dev/staging/prod MariaDB instances, each exposed as its own MCP server in a client's configuration). MCP clients such as VS Code group and display tools/approvals by the server's reported name. Since every instance reports the same MariaDB_Server name, they are visually indistinguishable in the client UI (e.g. in VS Code's "Manage Tool Approval" picker), even though each instance is configured under a distinct key in the client's mcp.json and points at a different DB_HOST/DB_NAME.
Example setup
services:
db1-mcp:
image: ghcr.io/mariadb/mcp:latest
environment:
DB_HOST: db1
...
db2-mcp:
image: ghcr.io/mariadb/mcp:latest
environment:
DB_HOST: db2
...
Both db1-mcp and db2-mcp show up as MariaDB_Server in the client, with no way to tell them apart other than inspecting tool call parameters at runtime.
Suggested solution
Add an optional environment variable, e.g. MCP_SERVER_NAME, that overrides the default MariaDB_Server name passed to FastMCP(...). If unset, keep the current default for backward compatibility.
mcp = FastMCP(os.getenv("MCP_SERVER_NAME", "MariaDB_Server"))
This would let operators running multiple instances of the server give each one a distinct, human-readable name (e.g. MariaDB_Production, MariaDB_Staging), making them distinguishable in MCP client UIs without requiring a custom-built image.
Problem
The server registers itself with a hardcoded FastMCP server name (
MariaDB_Server), which is returned asserverInfo.nameduring the MCPinitializehandshake.This becomes a problem when running multiple instances of the server against different databases (e.g. separate dev/staging/prod MariaDB instances, each exposed as its own MCP server in a client's configuration). MCP clients such as VS Code group and display tools/approvals by the server's reported name. Since every instance reports the same
MariaDB_Servername, they are visually indistinguishable in the client UI (e.g. in VS Code's "Manage Tool Approval" picker), even though each instance is configured under a distinct key in the client'smcp.jsonand points at a differentDB_HOST/DB_NAME.Example setup
Both
db1-mcpanddb2-mcpshow up asMariaDB_Serverin the client, with no way to tell them apart other than inspecting tool call parameters at runtime.Suggested solution
Add an optional environment variable, e.g.
MCP_SERVER_NAME, that overrides the defaultMariaDB_Servername passed toFastMCP(...). If unset, keep the current default for backward compatibility.This would let operators running multiple instances of the server give each one a distinct, human-readable name (e.g.
MariaDB_Production,MariaDB_Staging), making them distinguishable in MCP client UIs without requiring a custom-built image.