This page explains how the Gitopia MCP Server resolves configuration.
- Environment variables (inside the server process)
- Server config file (
~/.mcp/gitopia/config/config.json, or path fromMCP_CONFIG_FILE) - Built-in defaults
Notes:
- Docker
-e NAME=...overrides values baked into the image viaENVin the Dockerfile. --env-fileinjects variables in bulk; any-eflags or host-provided env still override those.
MCP_WORKSPACE_PATH– workspace root (defaults to~/.mcp/gitopia/workspace)MCP_CONFIG_FILE– optional path to the server config JSONGIT_USER_NAME,GIT_USER_EMAIL– default git identityMCP_LOG_LEVEL– logging levelGITOPIA_MNEMONIC– wallet mnemonic (optional; auto-generated if not set, saved to~/.mcp/gitopia/config/wallet.key). Set via shell env, never in config filesGITOPIA_GRPC_ENDPOINT– gRPC endpoint (env or default constant)
Default path: ~/.mcp/gitopia/config/config.json (inside containers: /home/mcp/.mcp/gitopia/config/config.json). Use it for non-secret defaults.
Example (copy from config.example.json):
{
"workspace": {
"base_path": "~/.mcp/gitopia/workspace"
},
"git": {
"default_user_name": "Your Name",
"default_user_email": "your.email@example.com"
},
"logging": {
"level": "info"
}
}internal/config/config.go–LoadConfigFromEnv()loads fromGetConfigPath()(default orMCP_CONFIG_FILE), then overlays env variables.cmd/server/main.go– readsGITOPIA_GRPC_ENDPOINTfrom env or usesgitopia.DefaultGRPC.
- Share non-secrets via the server config file (mounted into the container).
- Override per client via env in each client’s MCP config (
-eflags or host env UI). - Keep secrets out of files; prompt or use host-level secret storage.