Remote Server

Any client that speaks Streamable HTTP connects with the URL alone.

.mcp.jsonjson
{
"mcpServers": {
"secondlayer": {
"type": "http",
"url": "https://api.secondlayer.tools/mcp"
}
}
}
CredentialWhen
Browser sign-in (OAuth)The default. The client registers itself and opens the consent page.
Authorization: Bearer <sk-sl_ key>A client without OAuth support.
  • initialize and tools/list need no sign-in; a tool call without one is a 401 naming the OAuth metadata.
  • Reads use your credits, like reads made with a key.
  • Subgraph and webhook reads never start a stopped stack. Start it with any write, or a read with wake=1 using a key.
  • Tools marked "Local only" on Tools are not on the hosted server: use the local server.
  • What an app can do, and how to revoke it: Sign-in and Permissions.
Edit on GitHub

Quick Start

Copy this prompt into your agent.

Set up Secondlayer Index in this project. It reads Stacks chain data, decoded, from block 1.

1. Install `@secondlayer/sdk` with the project's package manager. If a release-age policy blocks the install, stop and ask me instead of changing it.
2. Ask me for a Secondlayer API key (`sk-sl_...`, from https://www.secondlayer.tools/signin) and put it in `.env` as `SECONDLAYER_API_KEY`. Never commit it. If I self-host, use `INSTANCE_TOKEN` and my instance URL instead. Until I give you one, read with a free trial key: `curl -X POST https://api.secondlayer.tools/api/public/trial-key` returns `{ key }`, read-only for Streams and Index, good for 24 hours and 100,000 rows. Keep it out of git too.
3. Add a note to `AGENTS.md`, creating it if needed: before using Secondlayer, follow the secondlayer skill if it's installed, and read https://www.secondlayer.tools/llms.txt. Before writing code, read https://www.secondlayer.tools/docs/index.md. Any docs page opens as Markdown when you add `.md` to its URL.
4. If you support skills, run: `bunx skills add ryanwaits/secondlayer --skill secondlayer -y`