secondlayer
MCP server by ryanwaits Verified · secondlayer.tools
Secondlayer is an MCP server for Stacks chain data, covering contract state writes, events, transfers and subgraph scaffolds. It suits developers building apps or indexers on Stacks. It runs hosted with browser sign-in or self-hosted.
Install secondlayer
Built from the published package, never by AI.
claude mcp add secondlayer -- npx -y @secondlayer/mcpRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"secondlayer": {
"args": [
"-y",
"@secondlayer/mcp"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"secondlayer": {
"args": [
"-y",
"@secondlayer/mcp"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"secondlayer": {
"args": [
"-y",
"@secondlayer/mcp"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add secondlayer -- npx -y @secondlayer/mcp{
"mcpServers": {
"secondlayer": {
"args": [
"-y",
"@secondlayer/mcp"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add secondlayer npx -y @secondlayer/mcpGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the secondlayer block.
About
Secondlayer is a Stacks chain data service with an MCP server package, @secondlayer/mcp, which the source says provides 20 tools. It offers five products: Index for decoded events from block 1, Streams for the raw node feed, Subgraphs for turning a contract into a queryable table, Webhooks for signed event delivery, and Archive for signed history. Its contract state feature records every map and variable write with the transaction that made it.
The hosted service uses email sign-in and an API key created under Account → Keys. The CLI is installed with bun. Hosted use includes 1M rows free each month, then $5 per 1M rows. The project can also be self-hosted under the MIT license with Docker, your own Postgres and a Stacks node you run. It is aimed at developers building on Stacks who need contract history, event data or real-time alerts.
Written from the project's README and checked against it.
What you need
- Secondlayer account and API key for hosted use
- Bun, to install the CLI
- Docker and Compose for self-hosting
- Postgres for self-hosting
- A Stacks node you run for self-hosting
| Setting | Needed | What it is |
|---|---|---|
SECONDLAYER_Environment variable, secret | Optional | Account API key (sk-sl_*) for the hosted API: credits, writes. |
SECONDLAYER_Environment variable | Optional | Instance API URL. Use https://api.secondlayer.tools for hosted. Default: http://127.0.0.1:3800 |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Try asking
- Who changed the arkadiko-dao contract, and what did they change?
- Show the latest state writes for a Stacks contract with transaction context.
- Help me scaffold a subgraph table from my Stacks contract.
Good to know
- Hosted use is metered: 1M rows free each month, then $5 per 1M rows.
- Rows are written after a transaction lands. It warns but does not prevent.
- Failed transactions leave no rows.
- Contract state covers stored values and calls between contracts, not every intermediate value. Inner calls are not committed on chain.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
What you can do with it
- Audit who changed a Stacks contract
- Turn a Stacks contract into a queryable table
- Get webhooks for Stacks chain events
Alternatives to secondlayer
All alternatives →Turns GitHub repositories into architecture diagrams, written explanations, Mermaid source and narrated explainer videos. Built for developers who want to understand a codebase, and for AI agents that need to read one.
Mocks, records, and chaos-tests HTTP(S) dependencies for development and testing. One port serves many protocols, including gRPC, WebSockets, and LLM chat APIs. Built for developers and testers who need stand-in services during tests.
Provides MCP server and CLI tools that let AI coding agents build, test and manage iOS and macOS projects with Xcode and simulators. It is aimed at developers working on Apple platform apps.
Creates editable draw.io diagrams in AI chat from Mermaid, PlantUML, CSV or draw.io XML. Built for people who want diagrams from text prompts that stay editable in draw.io.
Indexes your code, git history, tests and decisions on your machine so AI coding agents can query the index instead of re-reading files. Built for developers who want fewer files opened and clearer answers about change risk and code health.
Gives your AI assistant hosted codebase intelligence for repos indexed on repowise.dev. Use it to ask how code works, what a change may break, and which tests to run.
Compare with GitDiagram, mockserver or XcodeBuildMCP
secondlayer: common questions
Can I run Secondlayer without a hosted account?
Yes. The source says self-hosting needs no key at all, and the project is MIT licensed and free.
What does the free tier include?
The source says 1M rows are free every month. After that it costs $5 per 1M rows, at the same price for live and history data.
Does contract state tracking cover every value a contract computes?
No. It covers stored values and calls between contracts, not every intermediate value in the code, and inner calls are not committed on chain.
How do I install secondlayer?
In Claude Code run claude mcp add secondlayer -- npx -y @secondlayer/mcp. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is secondlayer the official server?
secondlayer is published by secondlayer.tools from its verified domain in the official MCP Registry.
Is secondlayer free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is secondlayer safe to use?
It scores 89 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to secondlayer?
Similar MCP servers: GitDiagram, mockserver, XcodeBuildMCP, draw.io.
Does secondlayer work with ChatGPT?
Yes. Add its server URL in ChatGPT as a custom connector. See MCP in ChatGPT.
