list-smith-mcp 0.1.0__tar.gz

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.
@@ -0,0 +1,8 @@
1
+ node_modules/
2
+ dist/
3
+ .venv/
4
+ __pycache__/
5
+ *.egg-info/
6
+ .pytest_cache/
7
+ .env
8
+ *.key
@@ -0,0 +1,167 @@
1
+ Metadata-Version: 2.5
2
+ Name: list-smith-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server for ListSmith — pay-per-call x402 listing grades and repairs over x402 ($0.10 / $0.50 USDC on Base)
5
+ Author: Jobfile Studio
6
+ License-Expression: MIT
7
+ Keywords: agents,base,bazaar,discovery,listing,mcp,usdc,x402
8
+ Requires-Python: >=3.10
9
+ Requires-Dist: eth-account>=0.11
10
+ Requires-Dist: httpx>=0.27
11
+ Requires-Dist: mcp<2,>=1.2
12
+ Provides-Extra: dev
13
+ Requires-Dist: pytest>=8; extra == 'dev'
14
+ Description-Content-Type: text/markdown
15
+
16
+ <!-- mcp-name: io.github.quincygb/list-smith-mcp -->
17
+ # list-smith-mcp
18
+
19
+ An [MCP](https://modelcontextprotocol.io) server (stdio transport) that
20
+ exposes **ListSmith** as native tools for any MCP host — Claude
21
+ Desktop, Cursor, or your own agent runtime.
22
+
23
+ ListSmith grades and repairs the Bazaar discovery metadata of x402
24
+ services. **`/v1/grade`** ($0.10) itemizes what is broken in a route's
25
+ discovery metadata — hollow schemas, failed SDK validation,
26
+ over-500-char descriptions, wrong asset addresses. **`/v1/fix`**
27
+ ($0.50) returns a repaired, validator-passed discovery package inferred
28
+ from one real sample output. Both are paid in USDC on Base via the
29
+ [x402 protocol](https://x402.org) — no accounts, no API keys; the
30
+ payment is the authentication.
31
+
32
+ ## The tools
33
+
34
+ **`list_grade`** — diagnosis only, no repaired content:
35
+
36
+ | Input | Type | Notes |
37
+ |---|---|---|
38
+ | `resource_url` | string (required) | Full URL of the x402 resource to grade |
39
+ | `sample_output` | any (optional) | One real response body from the endpoint; when supplied, it is also checked against the endpoint's published output schema |
40
+
41
+ Output: `resource_url`, `graded_at`, `reachable`, `http_status`,
42
+ `x402_valid`, `terms`, `extension_present`, `sdk_validation`,
43
+ `schema_quality`, `defects` (with severities), `score` (0–100), and
44
+ `fix_available`.
45
+
46
+ **`list_fix`** — the repair:
47
+
48
+ | Input | Type | Notes |
49
+ |---|---|---|
50
+ | `resource_url` | string (required) | Full URL of the x402 resource to repair |
51
+ | `sample_output` | any (required) | One real response body from the endpoint. The repaired output schema is inferred from this sample only — nothing is invented |
52
+ | `name` | string (optional) | Display name for the generated description; derived from the URL when omitted |
53
+ | `category` | string (optional) | Category (e.g. token-risk, search, data, media, monitoring) used to phrase the description's use-when sentence |
54
+
55
+ Output: `resource_url`, `graded_at`, `ok`, `failure`, `score_before`,
56
+ `defects`, `package` (description, repaired Bazaar extension, OpenAPI
57
+ and well-known snippets, instructions, validation results — shipped
58
+ only if it passes both x402 SDK validators), and `notes`.
59
+
60
+ ## Install
61
+
62
+ ```bash
63
+ pip install list-smith-mcp # once published; or from a checkout:
64
+ pip install ./mcp-list-smith # (this directory, inside token-verdict-tools)
65
+ ```
66
+
67
+ Requires Python ≥ 3.10. The server pins the MCP v1 SDK API
68
+ (`mcp>=1.2,<2`).
69
+
70
+ ## Configuration
71
+
72
+ All configuration is the **operator's own environment** — whoever runs
73
+ this server supplies their own wallet. No key material ships in this
74
+ package, and the package author never sees your key.
75
+
76
+ | Env var | Required | Purpose |
77
+ |---|---|---|
78
+ | `AGENT_PRIVATE_KEY` | for paid calls | EVM private key (`0x...`) of a wallet holding USDC on Base. Used locally to sign the x402 EIP-3009 authorization. |
79
+ | `AGENT_KEY_FILE` | alternative | Path to a file containing that key. |
80
+ | `LIST_SMITH_URL` | no | Service base URL override (default: production). |
81
+ | `LIST_SMITH_GRADE_MAX_AMOUNT_UNITS` | no | Spend guard for `/v1/grade` in USDC micro-units (default `100000` = $0.10, the known price). |
82
+ | `LIST_SMITH_FIX_MAX_AMOUNT_UNITS` | no | Spend guard for `/v1/fix` in USDC micro-units (default `500000` = $0.50, the known price). |
83
+
84
+ Each route is capped at its own price — the client refuses to sign
85
+ anything above the route's guard. **Without a signer configured the
86
+ tools never pay.** On a 402 they return the parsed challenge as a
87
+ structured error — `error: "payment_required"` with the full `accepts`
88
+ array (scheme, network, asset, amount, payTo) — so the calling agent
89
+ can see the price and decide what to do, or settle the challenge with
90
+ its own x402 client.
91
+
92
+ ## MCP host configuration
93
+
94
+ Claude Desktop (`claude_desktop_config.json`) — same shape for other
95
+ stdio MCP hosts:
96
+
97
+ ```json
98
+ {
99
+ "mcpServers": {
100
+ "list-smith": {
101
+ "command": "list-smith-mcp",
102
+ "env": {
103
+ "AGENT_PRIVATE_KEY": "0xYOUR_OWN_WALLET_KEY"
104
+ }
105
+ }
106
+ }
107
+ }
108
+ ```
109
+
110
+ From a checkout instead of an install:
111
+
112
+ ```json
113
+ {
114
+ "mcpServers": {
115
+ "list-smith": {
116
+ "command": "python",
117
+ "args": ["-m", "list_smith_mcp"],
118
+ "env": {
119
+ "PYTHONPATH": "/path/to/token-verdict-tools/mcp-list-smith/src",
120
+ "AGENT_KEY_FILE": "/path/to/your/agent.key"
121
+ }
122
+ }
123
+ }
124
+ }
125
+ ```
126
+
127
+ Prefer `AGENT_KEY_FILE` over inlining a key in a config file when your
128
+ host setup allows it.
129
+
130
+ ## How payment works
131
+
132
+ The client mirrors the standard x402 v2 flow (the same flow used for
133
+ the fleet's own live cataloging payments):
134
+
135
+ 1. `POST /v1/grade` or `/v1/fix` unpaid → HTTP 402, challenge
136
+ base64-encoded in the `payment-required` header.
137
+ 2. Pick the `exact` / `eip155:8453` entry from `accepts`.
138
+ 3. Build an EIP-3009 `TransferWithAuthorization` (`validAfter: 0`,
139
+ `validBefore: now + maxTimeoutSeconds`, random 32-byte nonce) and
140
+ sign it as EIP-712 typed data against the USDC domain the challenge
141
+ advertises (`extra.name` / `extra.version`).
142
+ 4. Retry the identical POST with the payload in the `PAYMENT-SIGNATURE`
143
+ header. The service verifies and settles through its facilitator
144
+ (PayAI) server-side; the settlement receipt comes back in the
145
+ `payment-response` header.
146
+
147
+ ## Tests
148
+
149
+ ```bash
150
+ pip install -e ".[dev]"
151
+ pytest
152
+ ```
153
+
154
+ All payments mocked (httpx `MockTransport`, throwaway signer generated
155
+ at test time). The 402 fixtures are the real challenges captured from
156
+ production; the paid-flow tests verify the EIP-712 signatures actually
157
+ recover to the signer address, for both routes.
158
+
159
+ ## Security notes
160
+
161
+ - Your private key is read from your environment at runtime and used
162
+ only to sign payment authorizations locally. It is never transmitted —
163
+ the x402 payload contains a signature, not a key.
164
+ - The per-route spend guards cap any single call at the configured
165
+ amounts (defaults: exactly the $0.10 grade and $0.50 fix prices).
166
+ - Run this with a dedicated agent wallet holding only working funds,
167
+ the same way you would fund any agent.
@@ -0,0 +1,152 @@
1
+ <!-- mcp-name: io.github.quincygb/list-smith-mcp -->
2
+ # list-smith-mcp
3
+
4
+ An [MCP](https://modelcontextprotocol.io) server (stdio transport) that
5
+ exposes **ListSmith** as native tools for any MCP host — Claude
6
+ Desktop, Cursor, or your own agent runtime.
7
+
8
+ ListSmith grades and repairs the Bazaar discovery metadata of x402
9
+ services. **`/v1/grade`** ($0.10) itemizes what is broken in a route's
10
+ discovery metadata — hollow schemas, failed SDK validation,
11
+ over-500-char descriptions, wrong asset addresses. **`/v1/fix`**
12
+ ($0.50) returns a repaired, validator-passed discovery package inferred
13
+ from one real sample output. Both are paid in USDC on Base via the
14
+ [x402 protocol](https://x402.org) — no accounts, no API keys; the
15
+ payment is the authentication.
16
+
17
+ ## The tools
18
+
19
+ **`list_grade`** — diagnosis only, no repaired content:
20
+
21
+ | Input | Type | Notes |
22
+ |---|---|---|
23
+ | `resource_url` | string (required) | Full URL of the x402 resource to grade |
24
+ | `sample_output` | any (optional) | One real response body from the endpoint; when supplied, it is also checked against the endpoint's published output schema |
25
+
26
+ Output: `resource_url`, `graded_at`, `reachable`, `http_status`,
27
+ `x402_valid`, `terms`, `extension_present`, `sdk_validation`,
28
+ `schema_quality`, `defects` (with severities), `score` (0–100), and
29
+ `fix_available`.
30
+
31
+ **`list_fix`** — the repair:
32
+
33
+ | Input | Type | Notes |
34
+ |---|---|---|
35
+ | `resource_url` | string (required) | Full URL of the x402 resource to repair |
36
+ | `sample_output` | any (required) | One real response body from the endpoint. The repaired output schema is inferred from this sample only — nothing is invented |
37
+ | `name` | string (optional) | Display name for the generated description; derived from the URL when omitted |
38
+ | `category` | string (optional) | Category (e.g. token-risk, search, data, media, monitoring) used to phrase the description's use-when sentence |
39
+
40
+ Output: `resource_url`, `graded_at`, `ok`, `failure`, `score_before`,
41
+ `defects`, `package` (description, repaired Bazaar extension, OpenAPI
42
+ and well-known snippets, instructions, validation results — shipped
43
+ only if it passes both x402 SDK validators), and `notes`.
44
+
45
+ ## Install
46
+
47
+ ```bash
48
+ pip install list-smith-mcp # once published; or from a checkout:
49
+ pip install ./mcp-list-smith # (this directory, inside token-verdict-tools)
50
+ ```
51
+
52
+ Requires Python ≥ 3.10. The server pins the MCP v1 SDK API
53
+ (`mcp>=1.2,<2`).
54
+
55
+ ## Configuration
56
+
57
+ All configuration is the **operator's own environment** — whoever runs
58
+ this server supplies their own wallet. No key material ships in this
59
+ package, and the package author never sees your key.
60
+
61
+ | Env var | Required | Purpose |
62
+ |---|---|---|
63
+ | `AGENT_PRIVATE_KEY` | for paid calls | EVM private key (`0x...`) of a wallet holding USDC on Base. Used locally to sign the x402 EIP-3009 authorization. |
64
+ | `AGENT_KEY_FILE` | alternative | Path to a file containing that key. |
65
+ | `LIST_SMITH_URL` | no | Service base URL override (default: production). |
66
+ | `LIST_SMITH_GRADE_MAX_AMOUNT_UNITS` | no | Spend guard for `/v1/grade` in USDC micro-units (default `100000` = $0.10, the known price). |
67
+ | `LIST_SMITH_FIX_MAX_AMOUNT_UNITS` | no | Spend guard for `/v1/fix` in USDC micro-units (default `500000` = $0.50, the known price). |
68
+
69
+ Each route is capped at its own price — the client refuses to sign
70
+ anything above the route's guard. **Without a signer configured the
71
+ tools never pay.** On a 402 they return the parsed challenge as a
72
+ structured error — `error: "payment_required"` with the full `accepts`
73
+ array (scheme, network, asset, amount, payTo) — so the calling agent
74
+ can see the price and decide what to do, or settle the challenge with
75
+ its own x402 client.
76
+
77
+ ## MCP host configuration
78
+
79
+ Claude Desktop (`claude_desktop_config.json`) — same shape for other
80
+ stdio MCP hosts:
81
+
82
+ ```json
83
+ {
84
+ "mcpServers": {
85
+ "list-smith": {
86
+ "command": "list-smith-mcp",
87
+ "env": {
88
+ "AGENT_PRIVATE_KEY": "0xYOUR_OWN_WALLET_KEY"
89
+ }
90
+ }
91
+ }
92
+ }
93
+ ```
94
+
95
+ From a checkout instead of an install:
96
+
97
+ ```json
98
+ {
99
+ "mcpServers": {
100
+ "list-smith": {
101
+ "command": "python",
102
+ "args": ["-m", "list_smith_mcp"],
103
+ "env": {
104
+ "PYTHONPATH": "/path/to/token-verdict-tools/mcp-list-smith/src",
105
+ "AGENT_KEY_FILE": "/path/to/your/agent.key"
106
+ }
107
+ }
108
+ }
109
+ }
110
+ ```
111
+
112
+ Prefer `AGENT_KEY_FILE` over inlining a key in a config file when your
113
+ host setup allows it.
114
+
115
+ ## How payment works
116
+
117
+ The client mirrors the standard x402 v2 flow (the same flow used for
118
+ the fleet's own live cataloging payments):
119
+
120
+ 1. `POST /v1/grade` or `/v1/fix` unpaid → HTTP 402, challenge
121
+ base64-encoded in the `payment-required` header.
122
+ 2. Pick the `exact` / `eip155:8453` entry from `accepts`.
123
+ 3. Build an EIP-3009 `TransferWithAuthorization` (`validAfter: 0`,
124
+ `validBefore: now + maxTimeoutSeconds`, random 32-byte nonce) and
125
+ sign it as EIP-712 typed data against the USDC domain the challenge
126
+ advertises (`extra.name` / `extra.version`).
127
+ 4. Retry the identical POST with the payload in the `PAYMENT-SIGNATURE`
128
+ header. The service verifies and settles through its facilitator
129
+ (PayAI) server-side; the settlement receipt comes back in the
130
+ `payment-response` header.
131
+
132
+ ## Tests
133
+
134
+ ```bash
135
+ pip install -e ".[dev]"
136
+ pytest
137
+ ```
138
+
139
+ All payments mocked (httpx `MockTransport`, throwaway signer generated
140
+ at test time). The 402 fixtures are the real challenges captured from
141
+ production; the paid-flow tests verify the EIP-712 signatures actually
142
+ recover to the signer address, for both routes.
143
+
144
+ ## Security notes
145
+
146
+ - Your private key is read from your environment at runtime and used
147
+ only to sign payment authorizations locally. It is never transmitted —
148
+ the x402 payload contains a signature, not a key.
149
+ - The per-route spend guards cap any single call at the configured
150
+ amounts (defaults: exactly the $0.10 grade and $0.50 fix prices).
151
+ - Run this with a dedicated agent wallet holding only working funds,
152
+ the same way you would fund any agent.
@@ -0,0 +1,33 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "list-smith-mcp"
7
+ version = "0.1.0"
8
+ description = "MCP server for ListSmith — pay-per-call x402 listing grades and repairs over x402 ($0.10 / $0.50 USDC on Base)"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ authors = [{ name = "Jobfile Studio" }]
13
+ keywords = ["mcp", "x402", "base", "usdc", "bazaar", "listing", "discovery", "agents"]
14
+ dependencies = [
15
+ # mcp 2.x renamed FastMCP -> MCPServer; this package targets the v1
16
+ # SDK API that current MCP hosts and docs are built against.
17
+ "mcp>=1.2,<2",
18
+ "httpx>=0.27",
19
+ "eth-account>=0.11",
20
+ ]
21
+
22
+ [project.optional-dependencies]
23
+ dev = ["pytest>=8"]
24
+
25
+ [project.scripts]
26
+ list-smith-mcp = "list_smith_mcp.server:main"
27
+
28
+ [tool.hatch.build.targets.wheel]
29
+ packages = ["src/list_smith_mcp"]
30
+
31
+ [tool.pytest.ini_options]
32
+ pythonpath = ["src"]
33
+ testpaths = ["tests"]
@@ -0,0 +1 @@
1
+ {"$schema":"https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json","description":"MCP server for ListSmith — x402 listing grades ($0.10) and repairs ($0.50) on Base","name":"io.github.quincygb/list-smith-mcp","packages":[{"environmentVariables":[{"description":"EVM private key (0x...) of a wallet holding USDC on Base. Used locally to sign the x402 EIP-3009 authorization. For paid calls.","format":"string","isRequired":false,"isSecret":true,"name":"AGENT_PRIVATE_KEY"},{"description":"Path to a file containing that key (alternative to AGENT_PRIVATE_KEY).","format":"filepath","isRequired":false,"isSecret":false,"name":"AGENT_KEY_FILE"},{"description":"Service base URL override (default: production).","format":"string","isRequired":false,"isSecret":false,"name":"LIST_SMITH_URL"},{"default":"100000","description":"Spend guard per grade call in USDC micro-units (default 100000 = $0.10, the known price). The client refuses to sign anything priced above it.","format":"number","isRequired":false,"isSecret":false,"name":"LIST_SMITH_GRADE_MAX_AMOUNT_UNITS"},{"default":"500000","description":"Spend guard per fix call in USDC micro-units (default 500000 = $0.50, the known price). The client refuses to sign anything priced above it.","format":"number","isRequired":false,"isSecret":false,"name":"LIST_SMITH_FIX_MAX_AMOUNT_UNITS"}],"identifier":"list-smith-mcp","registryType":"pypi","transport":{"type":"stdio"},"version":"0.1.0"}],"repository":{"source":"github","url":"https://github.com/QuincyGB/token-verdict-tools"},"title":"ListSmith","version":"0.1.0"}
@@ -0,0 +1,8 @@
1
+ """ListSmith MCP server + x402 client.
2
+
3
+ Wraps https://list-smith-production.up.railway.app (POST /v1/grade
4
+ $0.10 and POST /v1/fix $0.50, USDC on Base, x402 v2) so MCP hosts can
5
+ call it as native tools.
6
+ """
7
+
8
+ __version__ = "0.1.0"
@@ -0,0 +1,4 @@
1
+ from .server import main
2
+
3
+ if __name__ == "__main__":
4
+ main()