@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 +20 -20
- package/dist/bin-http.js +92 -488
- package/dist/bin-http.js.map +12 -13
- package/dist/bin.js +92 -488
- package/dist/bin.js.map +12 -13
- package/dist/index.js +92 -488
- package/dist/index.js.map +12 -13
- package/package.json +3 -3
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 — `
|
|
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
|
-
| **
|
|
56
|
-
| **
|
|
57
|
-
| **
|
|
58
|
-
| **
|
|
59
|
-
| **
|
|
60
|
-
| **
|
|
61
|
-
| **
|
|
62
|
-
|
|
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` |
|
|
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
|
|