x402scan-mcp 0.0.4 → 0.0.5
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/index.js +15 -0
- package/package.json +2 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -742,6 +742,7 @@ async function queryEndpoint(url, httpClient, options = {}) {
|
|
|
742
742
|
}
|
|
743
743
|
|
|
744
744
|
// src/tools/query_endpoint.ts
|
|
745
|
+
import { extractDiscoveryInfoV1, isDiscoverableV1 } from "@x402/extensions/bazaar";
|
|
745
746
|
function registerQueryEndpointTool(server) {
|
|
746
747
|
server.tool(
|
|
747
748
|
"query_endpoint",
|
|
@@ -810,6 +811,20 @@ function registerQueryEndpointTool(server) {
|
|
|
810
811
|
examples: bazaar.examples,
|
|
811
812
|
hasBazaarExtension: true
|
|
812
813
|
};
|
|
814
|
+
} else if (pr.x402Version === 1 && result.rawBody) {
|
|
815
|
+
const v1Body = result.rawBody;
|
|
816
|
+
const firstAccept = v1Body.accepts?.[0];
|
|
817
|
+
if (firstAccept && isDiscoverableV1(firstAccept)) {
|
|
818
|
+
const discoveryInfo = extractDiscoveryInfoV1(firstAccept);
|
|
819
|
+
if (discoveryInfo) {
|
|
820
|
+
response.bazaar = {
|
|
821
|
+
info: discoveryInfo,
|
|
822
|
+
schema: null,
|
|
823
|
+
hasBazaarExtension: true,
|
|
824
|
+
sourceVersion: 1
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
}
|
|
813
828
|
}
|
|
814
829
|
if (pr.extensions?.["sign-in-with-x"]) {
|
|
815
830
|
const siwx = pr.extensions["sign-in-with-x"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x402scan-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Generic MCP server for calling x402-protected APIs with automatic payment handling",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
24
24
|
"@x402/core": "^2.0.0",
|
|
25
25
|
"@x402/evm": "^2.0.0",
|
|
26
|
+
"@x402/extensions": "^2.1.0",
|
|
26
27
|
"siwe": "^2.3.2",
|
|
27
28
|
"viem": "^2.31.3",
|
|
28
29
|
"zod": "^3.25.1"
|