Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 89
  • 8 stars
  • 1.5k a week
  • MIT
  • Updated

Install secondlayer

Built from the published package, never by AI.

claude mcp add secondlayer -- npx -y @secondlayer/mcp

Run in your terminal. Add --scope user to use it in every project.

Step-by-step: install secondlayer in Claude Code

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
SettingNeededWhat it is
SECONDLAYER_API_KEYEnvironment variable, secretOptionalAccount API key (sk-sl_*) for the hosted API: credits, writes.
SECONDLAYER_API_URLEnvironment variableOptionalInstance 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

A

No 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 →

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.

secondlayer Install

Add to stack

Loading.