@agtnames/mcp 1.1.0 → 1.1.1
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 +1 -1
- package/dist/server.js +12 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ From a checkout: `claude mcp add agt -- node packages/mcp/dist/index.js`; agains
|
|
|
30
30
|
|---|---|
|
|
31
31
|
| `agt_resolve` | owner, expiry, active/perpetual, on-chain records, verified manifest (under `untrusted`) |
|
|
32
32
|
| `agt_manifest` | the manifest document + `verified` / `reasons` |
|
|
33
|
-
| `agt_endpoint` | URL for `mcp` / `a2a` / `http` / `ws` — verified manifest first, resolver record second |
|
|
33
|
+
| `agt_endpoint` | URL for `mcp` / `a2a` / `http` / `ws` — verified manifest first, resolver record second — plus `pricing` (`free` / `freemium` / `paid` / `contact`, from the verified manifest only) |
|
|
34
34
|
| `agt_available` | can the name be registered right now |
|
|
35
35
|
| `agt_namehash` | node + tokenId (no network) |
|
|
36
36
|
|
package/dist/server.js
CHANGED
|
@@ -77,6 +77,16 @@ export const LIMITS = { str: 512, url: 2048, list: 50, depth: 4, key: 64 };
|
|
|
77
77
|
// C0 controls + DEL, built from code points (no escape literals in source)
|
|
78
78
|
const CONTROL_CHARS = new RegExp("[" + String.fromCharCode(0) + "-" + String.fromCharCode(31) + String.fromCharCode(127) + "]", "g");
|
|
79
79
|
export const clean = (s, max) => s.replace(CONTROL_CHARS, "").slice(0, max);
|
|
80
|
+
/**
|
|
81
|
+
* `pricing.model` from a VERIFIED manifest, sanitized; null when unverified or absent. Lets a client tell a free
|
|
82
|
+
* agent from a paid one before it calls the endpoint, without fetching the whole manifest.
|
|
83
|
+
*/
|
|
84
|
+
export function pricingModel(manifest, verified) {
|
|
85
|
+
if (!verified || !manifest || typeof manifest !== "object")
|
|
86
|
+
return null;
|
|
87
|
+
const model = manifest.pricing?.model;
|
|
88
|
+
return typeof model === "string" && model ? clean(model, LIMITS.key) : null;
|
|
89
|
+
}
|
|
80
90
|
/** Bound third-party JSON: strings capped (URLs longer), lists/objects capped with a visible marker, depth capped. */
|
|
81
91
|
export function sanitize(v, depth = 0) {
|
|
82
92
|
if (depth > LIMITS.depth)
|
|
@@ -182,7 +192,7 @@ export function buildServer(cfg, deps = {}) {
|
|
|
182
192
|
}));
|
|
183
193
|
server.registerTool("agt_endpoint", {
|
|
184
194
|
title: "Get an agent endpoint",
|
|
185
|
-
description: "Get an agent's endpoint URL for a protocol (mcp, a2a, http, ws). Prefers the verified manifest; falls back to the on-chain resolver record. `verified: false` means the URL is unverified third-party data.",
|
|
195
|
+
description: "Get an agent's endpoint URL for a protocol (mcp, a2a, http, ws) plus its pricing model (free, freemium, paid, contact) when the manifest verifies. Prefers the verified manifest; falls back to the on-chain resolver record. `verified: false` means the URL is unverified third-party data.",
|
|
186
196
|
inputSchema: { name: nameSchema, protocol: z.enum(["mcp", "a2a", "http", "ws"]).describe("Endpoint protocol") },
|
|
187
197
|
annotations: READ,
|
|
188
198
|
}, guarded(async ({ name, protocol }) => {
|
|
@@ -190,7 +200,7 @@ export function buildServer(cfg, deps = {}) {
|
|
|
190
200
|
const fromManifest = r.verified ? r.manifest?.endpoints?.find((e) => e.protocol === protocol)?.url ?? null : null;
|
|
191
201
|
const fromRecord = r.records.endpoints[protocol] ?? null;
|
|
192
202
|
const url = fromManifest ?? fromRecord;
|
|
193
|
-
return { name: r.name, protocol, url: url ? clean(url, LIMITS.url) : null, source: fromManifest ? "verified-manifest" : fromRecord ? "resolver-record" : null, verified: !!fromManifest, reasons: r.reasons, notice: NOTICE };
|
|
203
|
+
return { name: r.name, protocol, url: url ? clean(url, LIMITS.url) : null, source: fromManifest ? "verified-manifest" : fromRecord ? "resolver-record" : null, verified: !!fromManifest, pricing: pricingModel(r.manifest, r.verified), reasons: r.reasons, notice: NOTICE };
|
|
194
204
|
}));
|
|
195
205
|
server.registerTool("agt_available", {
|
|
196
206
|
title: "Check availability",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agtnames/mcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "MCP server for .agt agent names: resolve, verify and discover agents by name against AGT Registry v2. Works with any MCP-compatible client (Claude Code, Cursor, custom agents).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "https://github.com/ds1/agt-site.git",
|
|
24
|
+
"url": "git+https://github.com/ds1/agt-site.git",
|
|
25
25
|
"directory": "packages/mcp"
|
|
26
26
|
},
|
|
27
27
|
"homepage": "https://agtnames.com/docs/claude-code",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"prepublishOnly": "node scripts/check-publish-deps.mjs && npm run build && npm test"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@agtnames/resolver": "^1.0.
|
|
35
|
+
"@agtnames/resolver": "^1.0.3",
|
|
36
36
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
37
37
|
"zod": "^3.25.0"
|
|
38
38
|
},
|