Allow overriding the MCP server name via environment variable
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 204
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the FastMCP(...) construction described in the issue and trace where the server name is set during initialization. Add support for MCP_SERVER_NAME while preserving MariaDB_Server when it is unset, then run the existing test suite or initialization checks to verify both naming cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100