Local Server
The @secondlayer/mcp package runs the server over stdio, with all 20 tools.
{
"mcpServers": {
"secondlayer": {
"command": "npx",
"args": ["-y", "@secondlayer/mcp"],
"env": {
"SECONDLAYER_API_URL": "https://api.secondlayer.tools",
"SECONDLAYER_API_KEY": "<sk-sl_ key from /account/keys>"
}
}
}
}
A client's JSON env can't read your shell, so this block holds the hosted values from Keys and Billing literally.
On your box, set these instead of the key (Self-host):
| Variable | Value |
|---|---|
SECONDLAYER_API_URL | http://127.0.0.1:3800 |
INSTANCE_TOKEN | From .env.local |
The same package's secondlayer-mcp-http command serves it over HTTP behind your own URL, with sessions and an optional SECONDLAYER_MCP_SECRET bearer.
The local server runs every tool, including subgraph deploys: Sign-in and Permissions says what each key allows.
Edit on GitHub