When using HTTP/SSE or Streamable HTTP transport, the following security model applies:
| Binding | Token | TLS | Allowed? |
|---|---|---|---|
| localhost:8080 | Yes | - | Yes |
| 192.168.x.x:8080 | Yes | Yes | Yes |
| 192.168.x.x:8080 | Yes | No | No - TLS required |
| 192.168.x.x:8080 | No | - | No - token required |
| 0.0.0.0:8080 | - | - | No - explicit flag required |
| 0.0.0.0:8080 (--allow-all-interfaces) | Yes | Yes | Yes |
# Token authentication (required for HTTP transport)
--mcp-token "secret" # Token from CLI
--mcp-token-file /path/to/file # Token from file (recommended for production)
# TLS configuration (required for non-localhost)
--tls # Enable TLS
--tls-cert /path/to/cert.pem # Certificate file
--tls-key /path/to/key.pem # Private key file
# Network exposure
--allow-all-interfaces # Allow 0.0.0.0/:: binding (requires token + TLS)- Use
--mcp-token-fileinstead of--mcp-tokento avoid exposing token in process list - Always use TLS for non-localhost bindings
- Use specific interface IPs instead of 0.0.0.0 when possible
- For development,
--mcp-token devis fine - token can be any string
This repository has multiple layers of protection against accidental credential commits:
- Automatically scans files before commit for potential secrets
- Checks for common patterns: passwords, API keys, tokens
- Prevents commits of dangerous files like
.zmcp.json,.env - Located in
.githooks/pre-commit
To enable: git config core.hooksPath .githooks
Explicitly ignores:
*.zmcp.json- MCP configuration files*.key,*.pem- Private keys.env*- Environment filessecrets/,credentials/- Secret directories
- Gitleaks: Scans for secrets in code and history
- Gosec: Go-specific security analysis
- Dependency scanning: Checks for vulnerable dependencies
- Custom patterns in
.gitleaks.toml - Detects MCP configs, API keys, tokens, passwords
- Allows test/example passwords
-
Immediately rotate the exposed credentials
-
Remove from history:
# Remove file from all history git filter-branch --force --index-filter \ 'git rm --cached --ignore-unmatch PATH_TO_FILE' \ --prune-empty --tag-name-filter cat -- --all # Force push (coordinate with team) git push origin --force --all git push origin --force --tags
-
Contact security team if credentials were exposed publicly
-
Never commit:
- Real passwords, API keys, or tokens
.zmcp.jsonor similar config files- Private keys or certificates
.envfiles with real values
-
Use instead:
- Environment variables
- External secret management
- Example/template files (e.g.,
.env.example) - Placeholder values in docs
-
Before committing:
- Review
git diffcarefully - Check
git statusfor unexpected files - Run
gitleaks detect --staged
- Review
# Install gitleaks
brew install gitleaks
# Scan current directory
gitleaks detect
# Scan staged changes
gitleaks detect --staged
# Scan with custom config
gitleaks detect -c .gitleaks.tomlIf you discover a security vulnerability:
- Do NOT create a public issue
- Email security concerns to [maintainer email]
- Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
We perform regular security audits:
- Weekly automated scans via GitHub Actions
- Dependency updates monthly
- Manual review quarterly