Overview
Custom MCP (Model Context Protocol) servers extend what coding agents can do by giving them access to external tools and data sources. Define them in the Blocks dashboard using a JSON configuration object, and reference global environment variables to inject secrets at runtime. Configure custom MCP servers at Dashboard → Settings → MCP Servers. MCP servers are workspace-wide and can be enabled or disabled per agent.Configuration format
Each MCP server is defined as a JSON object:| Field | Required | Description |
|---|---|---|
command | Yes | The executable to run (e.g., npx, node, python) |
args | No | Array of arguments passed to the command |
env | No | Environment variables to set for the server process |
Referencing environment variables
Use${env:VARIABLE_NAME} in env values to inject global environment variables at runtime. Blocks resolves these before starting the MCP server, so secrets are never hardcoded in the configuration.
The create page includes a dropdown above the JSON editor listing your global environment variables — select one to copy its template string.
Only global environment variables can be referenced. Repository-scoped variables are not available here. See Environment Variables to create them.
Adding a custom MCP server
- Go to Dashboard → Settings → MCP Servers
- Click Add MCP Server
- Enter a name for the server
- Paste your JSON configuration into the editor
- Click Save

