Required Variables
These environment variables must be set for the server to function properly.Your Dokploy server API URL. This should include the full URL path to your Dokploy API endpoint.Example:
Make sure to include
/api at the end of your Dokploy URL. This is the base path for all API endpoints.Your Dokploy API authentication token. This token is used to authenticate all API requests to your Dokploy server.Example:
How to Generate an API Token
- Log in to your Dokploy dashboard
- Navigate to Settings → API Tokens
- Click Create Token or Generate New Token
- Give your token a descriptive name (e.g., “MCP Server”)
- Copy the generated token immediately (it will only be shown once)
- Use this token as your
DOKPLOY_API_KEY
Optional Variables
These variables are optional and provide additional configuration options.The transport mode for the MCP server. Determines how the server communicates with clients.Possible values:See Transport Modes for detailed information about each mode.
stdio- Standard input/output (default, for desktop clients)http- HTTP/HTTPS with Streamable HTTP and legacy SSE supportsse- Same ashttp, enables both modern and legacy protocols
The external port for HTTP/SSE mode. The container always uses port 3000 internally, but you can map it to a different external port.Example:
This variable is only used when running in Docker. The internal port is fixed at 3000.
Configuration Examples
Basic Configuration (Stdio Mode)
For desktop MCP clients like Cursor, VS Code, or Claude Desktop:HTTP Mode Configuration
For web applications or custom integrations:Docker Configuration
When running with Docker:Security Best Practices
Never commit credentials to version control
Never commit credentials to version control
Always use environment variables or secure secret management systems. Never hardcode API keys in your code or configuration files that are committed to Git.Use Make sure
.env files locally:.env is in your .gitignore:Use environment-specific tokens
Use environment-specific tokens
Create separate API tokens for development, staging, and production environments. This allows you to:
- Rotate tokens without affecting other environments
- Track usage by environment
- Revoke access to specific environments independently
Rotate tokens regularly
Rotate tokens regularly
Periodically generate new API tokens and update your configuration. This reduces the risk of compromised credentials.
- Generate a new token in Dokploy
- Update your environment variables
- Test the new configuration
- Revoke the old token
Use HTTPS for Dokploy URLs
Use HTTPS for Dokploy URLs
Always use HTTPS URLs for your
DOKPLOY_URL to ensure encrypted communication:Limit token permissions
Limit token permissions
When creating API tokens in Dokploy, grant only the minimum permissions required for the MCP server to function. This follows the principle of least privilege.
Troubleshooting
Authentication Errors
If you receive authentication errors:- Verify your
DOKPLOY_API_KEYis correct - Check that the token hasn’t expired or been revoked
- Ensure you’re using the correct Dokploy server URL
- Verify the token has the necessary permissions
Connection Errors
If you can’t connect to your Dokploy server:- Verify the
DOKPLOY_URLis correct and includes/api - Check that your Dokploy server is accessible from your network
- Ensure there are no firewall rules blocking the connection
- Test the URL in your browser or with
curl:
Environment Variables Not Loading
If your environment variables aren’t being recognized:- MCP Clients: Verify the
envobject in your configuration file - Docker: Ensure you’re passing
-eflags correctly - Node.js: Check that your
.envfile is in the correct location - Restart your MCP client after updating environment variables
Some MCP clients cache configuration. You may need to restart the client or reload the MCP server for changes to take effect.