@secondlayer/mcp 3.10.0 → 4.0.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
@@ -1,6 +1,10 @@
1
1
  # @secondlayer/mcp
2
2
 
3
- MCP server for Secondlayer's agent-native subgraph platform.
3
+ MCP server for Secondlayer's agent-native subgraph platform. Exposes the
4
+ golden-path tools only — Index reads, the subgraph lifecycle, subscriptions,
5
+ contract discovery/scaffolding, and key self-provisioning. Everything else
6
+ (single-record lookups, mempool, stacking, proofs, codegen, billing, projects,
7
+ live Streams reads) is available over REST `/v1` + OpenAPI.
4
8
 
5
9
  ## Install
6
10
 
@@ -10,7 +14,7 @@ bun add @secondlayer/mcp
10
14
 
11
15
  ## Auth
12
16
 
13
- Most reads are public — `datasets_*`, `index_*`, and `contracts_find` work with no key. Subgraph tools need an `SL_API_KEY`; 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 owning account's key (anon → 404). **`streams_*` requires an `SL_API_KEY`** (and the Index tools reject free-tier keys — Build+ for keyed access). Writes (deploy, publish/unpublish, reindex, delete, subscriptions) and account tools need a key: create one (prefixed `sk-sl_`) in the platform console at https://secondlayer.tools/platform/api-keys and set it as `SL_API_KEY`. Read `secondlayer://context` first — it reports auth state and read-auth tiers.
17
+ Most reads are public — `index_*` and `contracts_find` work with no key. Subgraph tools need an `SL_API_KEY`; 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 owning account's key (anon → 404). **`streams_dumps` requires an `SL_API_KEY`** (and the Index tools reject free-tier keys — Build+ for keyed access). Writes (deploy, publish/unpublish, reindex, delete, subscriptions) and account tools need a key: create one (prefixed `sk-sl_`) in the platform console at https://secondlayer.tools/platform/api-keys and set it as `SL_API_KEY`. Read `secondlayer://context` first — it reports auth state and read-auth tiers.
14
18
 
15
19
  ## Quick Start — Stdio (IDE)
16
20
 
@@ -52,14 +56,17 @@ bunx -p @secondlayer/mcp secondlayer-mcp-http
52
56
 
53
57
  | Domain | Tools |
54
58
  | --- | --- |
55
- | **Subgraphs** (16) | `subgraphs_list`, `subgraphs_get`, `subgraphs_spec`, `subgraphs_query`, `subgraphs_aggregate`, `subgraphs_reindex`, `subgraphs_operation`, `subgraphs_backfill`, `subgraphs_stop`, `subgraphs_gaps`, `subgraphs_delete`, `subgraphs_deploy`, `subgraphs_publish`, `subgraphs_unpublish`, `subgraphs_read_source`, `subgraphs_codegen` |
56
- | **Subscriptions** (12) | `subscriptions_list`, `subscriptions_get`, `subscriptions_create`, `subscriptions_update`, `subscriptions_pause`, `subscriptions_resume`, `subscriptions_delete`, `subscriptions_rotate_secret`, `subscriptions_replay`, `subscriptions_recent_deliveries`, `subscriptions_dead`, `subscriptions_requeue_dead` |
57
- | **Datasets** (2) | `datasets_list`, `datasets_query` |
58
- | **Index** (4) | `index_ft_transfers`, `index_nft_transfers`, `index_events`, `index_contract_calls` |
59
- | **Streams** (2) | `streams_tip`, `streams_events` |
60
- | **Contracts** (1) | `contracts_find` |
61
- | **Scaffold** (2) | `scaffold_from_contract`, `scaffold_from_abi` |
62
- | **Account** (4) | `account_whoami`, `account_update`, `account_billing`, `account_create_key` |
59
+ | **Index** (8) | `index_events`, `index_ft_transfers`, `index_nft_transfers`, `index_contract_calls`, `index_blocks`, `index_transactions`, `index_discover`, `batch_query` |
60
+ | **Subgraphs** (11) | `subgraphs_list`, `subgraphs_get`, `subgraphs_deploy`, `subgraphs_publish`, `subgraphs_unpublish`, `subgraphs_delete`, `subgraphs_query`, `subgraphs_backfill`, `subgraphs_reindex`, `subgraphs_stop`, `subgraphs_gaps` |
61
+ | **Subscriptions** (7) | `subscriptions_create`, `subscriptions_list`, `subscriptions_get`, `subscriptions_update`, `subscriptions_delete`, `subscriptions_test`, `subscriptions_replay` |
62
+ | **Streams** (1) | `streams_dumps` |
63
+ | **Contracts** (2) | `contracts_find`, `get_contract_abi` |
64
+ | **Scaffold** (1) | `scaffold_from_contract` |
65
+ | **Account** (2) | `account_whoami`, `account_create_key` |
66
+
67
+ Periphery surfaces (single block/tx lookups, mempool, stacking, proofs, usage,
68
+ codegen, billing/caps, projects, live Streams reads, delivery forensics) are
69
+ REST-only: see the OpenAPI spec at the API host.
63
70
 
64
71
  `account_create_key` mints a scoped `streams`/`index` read key — requires an
65
72
  account/owner key and returns the `sk-sl_` key **once**. **Key products:** an
@@ -86,22 +93,15 @@ subgraph (e.g. `[{ "type": "contract_call", "contractId": "SP....amm",
86
93
  - Filter operators: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `like`
87
94
  - Max limit: 200
88
95
 
89
- ### `subgraphs_aggregate`
90
-
91
- Scalar aggregates over the same filtered set as `subgraphs_query`:
92
-
93
- - `count` — `COUNT(*)` of matching rows
94
- - `countDistinct` — columns to count distinct values of
95
- - `sum` / `min` / `max` — numeric columns only (`uint`/`int` + system `_block_height`); returned as lossless strings
96
- - No aggregate requested → returns the row count.
97
-
98
96
  ## Resources
99
97
 
100
98
  | URI | Description |
101
99
  | --- | --- |
102
100
  | `secondlayer://context` | Live state — what exists (your subgraphs, subscriptions, account), what you can do, and read-auth tiers. Read first. |
103
- | `secondlayer://filters` | Filter types reference |
101
+ | `secondlayer://filters` | Subgraph source filter types and their fields |
104
102
  | `secondlayer://column-types` | Column type mappings and options |
103
+ | `secondlayer://traits` | SIP trait standards (valid `trait` values) |
104
+ | `secondlayer://chain-triggers` | Chain-subscription trigger types and fields |
105
105
 
106
106
  ## Error Handling
107
107