subgraph-registry-mcp 0.8.21 → 0.8.23
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/data/openapi.json +1 -1
- package/data/registry.db +0 -0
- package/openapi.yaml +1 -1
- package/package.json +2 -2
- package/src/index.js +13 -6
package/data/openapi.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Subgraph Registry",
|
|
5
5
|
"description": "Agent-friendly subgraph discovery on The Graph Network. 14,700+ classified subgraphs with semantic search, reliability scoring, schema-evolution tracking, and x402 query URLs ($0.01 USDC on Base, no API key).",
|
|
6
|
-
"version": "0.8.
|
|
6
|
+
"version": "0.8.23",
|
|
7
7
|
"license": {
|
|
8
8
|
"name": "MIT"
|
|
9
9
|
},
|
package/data/registry.db
CHANGED
|
Binary file
|
package/openapi.yaml
CHANGED
|
@@ -5,7 +5,7 @@ openapi: "3.1.0"
|
|
|
5
5
|
info:
|
|
6
6
|
title: "Subgraph Registry"
|
|
7
7
|
description: "Agent-friendly subgraph discovery on The Graph Network. 14,700+ classified subgraphs with semantic search, reliability scoring, schema-evolution tracking, and x402 query URLs ($0.01 USDC on Base, no API key)."
|
|
8
|
-
version: "0.8.
|
|
8
|
+
version: "0.8.23"
|
|
9
9
|
license:
|
|
10
10
|
name: "MIT"
|
|
11
11
|
contact:
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "subgraph-registry-mcp",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.23",
|
|
4
4
|
"mcpName": "io.github.PaulieB14/subgraph-registry-mcp",
|
|
5
|
-
"description": "MCP server for agent-friendly subgraph discovery on The Graph Network. 15,
|
|
5
|
+
"description": "MCP server for agent-friendly subgraph discovery on The Graph Network. 15,254 classified subgraphs with x402 query URLs ($0.01 USDC on Base, no API key required), reliability scoring, and protocol classification.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
8
|
"subgraph-registry-mcp": "src/index.js"
|
package/src/index.js
CHANGED
|
@@ -50,7 +50,7 @@ const GITHUB_DB_URL =
|
|
|
50
50
|
// 3. Paste the new hash here and bump package.json version
|
|
51
51
|
// 4. Update SKILL.md "Verifying the registry" section
|
|
52
52
|
const EXPECTED_DB_SHA256 =
|
|
53
|
-
"
|
|
53
|
+
"9ebf78b72b45338dcc04326ad9d9caf4bda0e323b50ce5f381f106afdd551839";
|
|
54
54
|
// Skip-verification escape hatch (set to "1" only if you're rebuilding the DB
|
|
55
55
|
// locally and know what you're doing — never set in agent-runtime defaults).
|
|
56
56
|
const SKIP_VERIFY = process.env.SUBGRAPH_REGISTRY_SKIP_VERIFY === "1";
|
|
@@ -221,7 +221,7 @@ function searchSubgraphs({
|
|
|
221
221
|
const sql = `
|
|
222
222
|
SELECT id, display_name, description, auto_description, domain, protocol_type, network,
|
|
223
223
|
reliability_score, ipfs_hash, entity_count, canonical_entities,
|
|
224
|
-
powered_by_substreams, active_allocation_count
|
|
224
|
+
powered_by_substreams, active_allocation_count, example_query
|
|
225
225
|
FROM subgraphs
|
|
226
226
|
${where}
|
|
227
227
|
ORDER BY reliability_score DESC
|
|
@@ -249,6 +249,9 @@ function searchSubgraphs({
|
|
|
249
249
|
canonical_entities: JSON.parse(r.canonical_entities),
|
|
250
250
|
powered_by_substreams: Boolean(r.powered_by_substreams),
|
|
251
251
|
active_allocation_count: r.active_allocation_count || 0,
|
|
252
|
+
// Ready-to-run GraphQL generated from this subgraph's actual schema — so an
|
|
253
|
+
// agent can POST it to query_url_x402 immediately, no get_subgraph_detail round-trip.
|
|
254
|
+
example_query: r.example_query || null,
|
|
252
255
|
...buildQueryEndpoints(r.id),
|
|
253
256
|
});
|
|
254
257
|
if (results.length >= limit) break;
|
|
@@ -257,7 +260,7 @@ function searchSubgraphs({
|
|
|
257
260
|
return {
|
|
258
261
|
total: results.length,
|
|
259
262
|
subgraphs: results,
|
|
260
|
-
query_instructions: "Two ways to query: (a) RECOMMENDED — POST GraphQL to query_url_x402 and pay $0.01 USDC on Base per query via x402 (no API key required; gateway returns HTTP 402 with a payment manifest, use an x402 client like @graphprotocol/client-x402 to sign and retry). (b) LEGACY — replace [api-key] in query_url with a Graph API key from https://thegraph.com/studio/apikeys/.
|
|
263
|
+
query_instructions: "Two ways to query: (a) RECOMMENDED — POST GraphQL to query_url_x402 and pay $0.01 USDC on Base per query via x402 (no API key required; gateway returns HTTP 402 with a payment manifest, use an x402 client like @graphprotocol/client-x402 to sign and retry). (b) LEGACY — replace [api-key] in query_url with a Graph API key from https://thegraph.com/studio/apikeys/. Each result includes a ready-to-run `example_query` generated from that subgraph's real schema — POST it to query_url_x402 as-is, or adapt the entity/fields. Use get_subgraph_detail for the full schema.",
|
|
261
264
|
};
|
|
262
265
|
}
|
|
263
266
|
|
|
@@ -320,7 +323,7 @@ function recommendSubgraph({ goal, chain = "" }) {
|
|
|
320
323
|
const where = `WHERE ${conditions.join(" AND ")}`;
|
|
321
324
|
const sql = `
|
|
322
325
|
SELECT id, display_name, description, auto_description, domain, protocol_type, network,
|
|
323
|
-
reliability_score, ipfs_hash, canonical_entities, active_allocation_count
|
|
326
|
+
reliability_score, ipfs_hash, canonical_entities, active_allocation_count, example_query
|
|
324
327
|
FROM subgraphs
|
|
325
328
|
${where}
|
|
326
329
|
ORDER BY reliability_score DESC
|
|
@@ -357,6 +360,7 @@ function recommendSubgraph({ goal, chain = "" }) {
|
|
|
357
360
|
ipfs_hash: r.ipfs_hash,
|
|
358
361
|
canonical_entities: JSON.parse(r.canonical_entities),
|
|
359
362
|
active_allocation_count: r.active_allocation_count || 0,
|
|
363
|
+
example_query: r.example_query || null,
|
|
360
364
|
schema_changed_at: stab.schema_changed_at,
|
|
361
365
|
schema_stable_days: stab.schema_stable_days,
|
|
362
366
|
...buildQueryEndpoints(r.id),
|
|
@@ -604,7 +608,9 @@ async function semanticSearchSubgraphs({
|
|
|
604
608
|
// SQL pre-filter shaves ~14k → <1k rows for narrow queries (e.g.
|
|
605
609
|
// "lending positions on Arbitrum"). Cosine math runs only on the
|
|
606
610
|
// post-filter set.
|
|
607
|
-
|
|
611
|
+
// Exclude the handful of null-ipfs "shell" rows — they carry embeddings but
|
|
612
|
+
// are unqueryable (no deployment) so they must not surface as recommendations.
|
|
613
|
+
const conditions = ["embedding IS NOT NULL", "ipfs_hash != ''", "ipfs_hash IS NOT NULL"];
|
|
608
614
|
const params = [];
|
|
609
615
|
if (!include_unserved) {
|
|
610
616
|
conditions.push("active_allocation_count > 0");
|
|
@@ -631,7 +637,7 @@ async function semanticSearchSubgraphs({
|
|
|
631
637
|
`SELECT id, display_name, description, auto_description, domain,
|
|
632
638
|
protocol_type, network, reliability_score, ipfs_hash,
|
|
633
639
|
entity_count, canonical_entities, powered_by_substreams,
|
|
634
|
-
active_allocation_count, embedding
|
|
640
|
+
active_allocation_count, example_query, embedding
|
|
635
641
|
FROM subgraphs
|
|
636
642
|
${where}`,
|
|
637
643
|
)
|
|
@@ -666,6 +672,7 @@ async function semanticSearchSubgraphs({
|
|
|
666
672
|
canonical_entities: JSON.parse(r.canonical_entities),
|
|
667
673
|
powered_by_substreams: Boolean(r.powered_by_substreams),
|
|
668
674
|
active_allocation_count: r.active_allocation_count || 0,
|
|
675
|
+
example_query: r.example_query || null,
|
|
669
676
|
semantic_score: Number(score.toFixed(4)),
|
|
670
677
|
...buildQueryEndpoints(r.id),
|
|
671
678
|
});
|