secondlayer
Query Stacks blockchain data and scaffold subgraphs from an AI client
- Pricing
- Freemium
- Platforms
- API, Web, self-hosted
- Runs
- Locally or Remotely
- Version
- 11.6.6
- Listing updated
- 3 days ago
About secondlayer
secondlayer is a freemium MCP server for analytics and data. It can run locally on your machine or as a hosted remote server.
Secondlayer indexes the Stacks chain, and this server lets an agent read contracts, events, transfers and blocks, then scaffold and manage subgraphs. The docs ask the agent to read secondlayer://context first, then use the resources it points to before calling tools.
The hosted server carries read tools only, and signs in through the browser; local stdio (@secondlayer/mcp) adds everything else, including deploying subgraphs and managing webhooks. Tool names include index_events, index_ft_transfers, contracts_find, subgraphs_scaffold, subgraphs_deploy and webhooks_create.
Billing is by rows delivered, with the first 1M rows free each month and $5 per 1M after that. Self-hosting is free under MIT licence.
Install
Run in a terminal
claude mcp add --transport http secondlayer https://api.secondlayer.tools/mcpAdd to Settings → Connectors → Add custom connector
https://api.secondlayer.tools/mcpAdd to ~/.cursor/mcp.json
{
"mcpServers": {
"secondlayer": {
"url": "https://api.secondlayer.tools/mcp"
}
}
}Add to .vscode/mcp.json
{
"servers": {
"secondlayer": {
"type": "http",
"url": "https://api.secondlayer.tools/mcp"
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"secondlayer": {
"serverUrl": "https://api.secondlayer.tools/mcp"
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"secondlayer": {
"type": "http",
"url": "https://api.secondlayer.tools/mcp"
}
}
}Configuration
SECONDLAYER_API_KEYAccount API key (sk-sl_*) for the hosted API: credits, writes.SECONDLAYER_API_URLInstance API URL. Use https://api.secondlayer.tools for hosted.
Tools this server provides (13)
Taken from the project documentation; the running server may differ.
- index_blocks
- Read indexed blocks.
- index_events
- Read indexed events.
- index_ft_transfers
- Read fungible token transfers.
- index_nft_transfers
- Read NFT transfers.
- index_transactions
- Read transactions.
- index_contract_calls
- Read contract calls.
- contracts_find
- Find contracts.
- subgraphs_scaffold
- Scaffold a subgraph.
- subgraphs_deploy
- Deploy a subgraph (local only).
- subgraphs_backfill
- Backfill a subgraph.
- subgraphs_reindex
- Reindex a subgraph.
- subgraphs_query
- Query a subgraph.
- webhooks_create
- Create a chain webhook.
What it does
- Chain data reads
- Blocks, transactions, events and transfers.
- Contract lookup
- Find contracts and inspect their calls.
- Subgraph scaffolding
- Generate subgraph scaffolds and specs.
- Webhook management
- Create webhooks, available on the local server.
- Hosted or local
- Remote read-only or full-tool stdio.
- Self-hostable
- The runtime is MIT licensed.
Good for
- Look up fungible token transfers for a contract
- Scaffold a subgraph for a contract
- Backfill or reindex a subgraph
- Create a chain webhook
Pricing
Freemium
First 1M rows free monthly; $5 per 1M rows; self-hosting free (MIT)
Prices change. Check secondlayer.tools before you buy.
secondlayer FAQ
Can the hosted server deploy subgraphs?
No. It carries read tools only; use the local package for deploys and webhooks.
How is it billed?
By rows delivered, with 1M free each month and $5 per 1M beyond.
Can I self-host?
Yes. The runtime is MIT licensed and free to run yourself.
How do I sign in?
Browser OAuth, or a Bearer `sk-sl_` key for clients without OAuth.
Is secondlayer free?
secondlayer has a free plan, with paid plans for more usage or features.
How do I add secondlayer to Claude Code?
Run this command in your terminal: claude mcp add --transport http secondlayer https://api.secondlayer.tools/mcp
What are the best alternatives to secondlayer?
The closest alternatives to secondlayer are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.
Alternatives to secondlayer

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

GitHub
MCP serverOfficial MCP server connecting AI assistants to GitHub repos, issues and workflows
Not checked yet- Remote
- Open source
- 34.5K GitHub stars
- Developer tools

Serena MCP: the IDE for your agent
MCP serverMCP toolkit giving coding agents symbol-level code retrieval and editing
Runs locally- Open source
- 31.5K GitHub stars
- Developer tools

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Agent-Native Analytics
MCP serverOpen-source analytics app where an AI agent builds charts and dashboards from your data
- Remote
- Open source
- 7.7K GitHub stars
- Analytics and data