@secondlayer/mcp 7.2.1 → 7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,9 +3,10 @@
3
3
  Gives your coding agent direct access to the Stacks data on your own instance —
4
4
  Index (decoded rows), Subgraphs (tables you define, served from your instance),
5
5
  and Streams (raw inputs). Exposes the golden-path tools only: Index reads, the
6
- subgraph lifecycle, subscriptions, and contract discovery/scaffolding.
7
- Everything else (single-record lookups, mempool, stacking, proofs, codegen,
8
- credits, live Streams reads) is available over REST `/v1` + OpenAPI.
6
+ subgraph lifecycle, subscriptions, contract discovery/scaffolding, instance
7
+ status, archive verify/bootstrap, and hosted credits/quote. Everything else
8
+ (single-record lookups, mempool, stacking, proofs, live Streams reads) is
9
+ available over REST `/v1` + OpenAPI. There is no `consume` tool.
9
10
 
10
11
  ## Install
11
12
 
@@ -15,7 +16,7 @@ bun add @secondlayer/mcp
15
16
 
16
17
  ## Auth
17
18
 
18
- Most reads are public: `index_*` and `contracts_find` work with no key. Subgraph tools need an `INSTANCE_TOKEN` past loopback; separately, **public** subgraphs are anon-readable over HTTP at `GET /v1/subgraphs/<name>/<table>` (`{ rows, next_cursor, tip }` cursor envelope), while private ones need the instance token (anon → 404). `streams_dumps` needs no key: the dumps manifest is public; the tool only needs `SL_STREAMS_DUMPS_URL` configured. Every other `streams_*` tool is key-mandatory (keyless → 401). Writes (deploy, reindex, delete, subscriptions) need a key: set `INSTANCE_TOKEN` from `secondlayer init`. `SL_API_KEY` is a legacy alias of `INSTANCE_TOKEN`. Read `secondlayer://context` first: it reports auth state and read-auth tiers.
19
+ Most reads are public: `index_*` and `contracts_find` work with no key. Subgraph tools need an `INSTANCE_TOKEN` past loopback; separately, **public** subgraphs are anon-readable over HTTP at `GET /v1/subgraphs/<name>/<table>` (`{ rows, next_cursor, tip }` cursor envelope), while private ones need the instance token (anon → 404). `streams_dumps` needs no key: the dumps manifest is public; the tool only needs `SL_STREAMS_DUMPS_URL` configured. Every other `streams_*` tool is key-mandatory (keyless → 401). Writes (deploy, reindex, delete, subscriptions) need a key: set `INSTANCE_TOKEN` from `secondlayer init`. Hosted credits/quote use `SECONDLAYER_API_KEY` (`sk-sl_*`). Read `secondlayer://context` first: it reports auth state and read-auth tiers.
19
20
 
20
21
  ## Quick Start — Stdio (IDE)
21
22
 
@@ -50,9 +51,11 @@ bunx -p @secondlayer/mcp secondlayer-mcp-http
50
51
 
51
52
  | Variable | Required | Default | Description |
52
53
  | --- | --- | --- | --- |
53
- | `INSTANCE_TOKEN` | Writes only | — | From `secondlayer init`. Required for write tools; reads are public. `SL_API_KEY` is a legacy alias. |
54
- | `SL_API_URL` | No | `http://127.0.0.1:3800` | Instance API. |
55
- | `SECONDLAYER_API_URL` | No | — | Overrides `SL_API_URL`. |
54
+ | `INSTANCE_TOKEN` | Writes only | — | From `secondlayer init`. Required for write tools; reads are public. Not valid for hosted credits. |
55
+ | `SECONDLAYER_API_KEY` | Hosted credits/quote/latest | — | `sk-sl_*` for `api.secondlayer.tools`. `SL_API_KEY` / `SL_ARCHIVE_API_KEY` are one-release fallbacks. |
56
+ | `SECONDLAYER_API_URL` | No | `http://127.0.0.1:3800` | Instance API. `SL_API_URL` is a one-release fallback. |
57
+ | `SECONDLAYER_BIN` | CLI tools | `secondlayer` on PATH | Path to the CLI binary (`setup`, `bootstrap`, `repair`). |
58
+ | `SECONDLAYER_CWD` | CLI tools | process cwd | Compose project directory. |
56
59
  | `SECONDLAYER_MCP_PORT` | No | `3100` | HTTP transport port. |
57
60
  | `SECONDLAYER_MCP_SECRET` | No | — | Bearer token for HTTP auth. Disabled if unset. |
58
61
 
@@ -65,16 +68,22 @@ bunx -p @secondlayer/mcp secondlayer-mcp-http
65
68
  | **Subscriptions** (13) | `subscriptions_create`, `subscriptions_list`, `subscriptions_get`, `subscriptions_update`, `subscriptions_delete`, `subscriptions_test`, `subscriptions_pause`, `subscriptions_resume`, `subscriptions_rotate_secret`, `subscriptions_deliveries`, `subscriptions_dead`, `subscriptions_requeue`, `subscriptions_replay` |
66
69
  | **Streams** (7) | `streams_tip`, `streams_events`, `streams_events_by_tx`, `streams_block_events`, `streams_canonical`, `streams_reorgs`, `streams_dumps` |
67
70
  | **Contracts** (2) | `contracts_find`, `contracts_get_abi` |
71
+ | **Instance** (1) | `instance_status` |
72
+ | **Archive** (5) | `archive_verify`, `archive_bootstrap`, `archive_repair`, `archive_latest`, `archive_quote` |
73
+ | **Setup** (1) | `setup` |
74
+ | **Credits** (1) | `credits_balance` (needs `SECONDLAYER_API_KEY`) |
68
75
  | **Account** (2) | `account_whoami`, `account_create_key` (only when pointed at `https://api.secondlayer.tools`) |
69
76
 
70
77
  Verify after mutating: `subgraphs_operations` for deploy/reindex/backfill/stop,
71
- `subscriptions_deliveries` for create/test/replay.
78
+ `subscriptions_deliveries` for create/test/replay. Empty index: `setup` or
79
+ `archive_bootstrap`, poll `instance_status` until decoders are ok, then
80
+ `archive_verify`, then `codegen_index_schema`.
72
81
 
73
82
  Periphery surfaces (single block/tx lookups, mempool, stacking, proofs,
74
83
  credits/caps, live Streams SSE) are REST-only: see the OpenAPI spec at the API
75
84
  host. Following the chain over MCP means polling `streams_events` with a cursor.
76
85
 
77
- Point the server at your instance with `SL_API_URL` (default
86
+ Point the server at your instance with `SECONDLAYER_API_URL` (default
78
87
  `http://127.0.0.1:3800`). Writes use `INSTANCE_TOKEN` from
79
88
  `secondlayer init`. `account_*` tools appear only when the server is pointed at
80
89
  `https://api.secondlayer.tools`.