nanoparse-mcp 1.0.7 → 1.0.9

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 CHANGED
@@ -1,102 +1,67 @@
1
1
  # NanoParse MCP
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/nanoparse-mcp)](https://www.npmjs.com/package/nanoparse-mcp)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
3
+ **Give your AI agent clean, structured web content.** NanoParse MCP is a hosted Model Context Protocol server at `https://nanoparse.app/mcp` that turns any URL into clean Markdown your agent can actually use — with machine-readable trust signals attached.
5
4
 
6
- MCP client for [NanoParse](https://nanoparse.app) — pay-per-parse web content extraction for AI agents. No accounts, no API keys. Just paste a URL and get clean, structured Markdown back.
5
+ No install. No wallet key. No `.env`. Connect once and your agent can read the web.
7
6
 
8
- ## What this is
7
+ ## Quick start
9
8
 
10
- A thin MCP (Model Context Protocol) client that lets AI agents call NanoParse's hosted API. The client handles:
9
+ Add this to your MCP client config:
11
10
 
12
- - MCP tool registration (`nanoparse_fetch`)
13
- - HTTP calls to `nanoparse.app/fetch`
14
- - x402 micropayment signing (USDC on Base)
15
-
16
- The browser rendering, content scoring, and Markdown conversion stay on NanoParse's infrastructure — this repo is the client layer only.
17
-
18
- ## Install
19
-
20
- ```bash
21
- npx nanoparse-mcp
22
- ```
23
-
24
- Or install globally:
25
-
26
- ```bash
27
- npm install -g nanoparse-mcp
11
+ ```json
12
+ {
13
+ "mcpServers": {
14
+ "nanoparse": {
15
+ "url": "https://nanoparse.app/mcp"
16
+ }
17
+ }
18
+ }
28
19
  ```
29
20
 
30
- ### Prerequisites
31
-
32
- - Node.js 18+
33
- - A Base wallet with USDC (after your first 10 free parses)
34
- - Set `NANOPARSE_WALLET_KEY` in your environment
35
-
36
- ## Getting a wallet
21
+ Restart your client, and your agent auto-discovers two tools:
37
22
 
38
- If you don't already have a Base-compatible wallet for your agent, don't generate one by hand — use [NanoParse/agent-wallet-prompt](https://github.com/NanoParse/agent-wallet-prompt), a copy-paste prompt that walks your coding assistant through generating one safely with an audited library. Come back here once it's funded.
23
+ - **`nanoparse_fetch(url)`** — fetch any web page and get clean Markdown back
24
+ - **`nanoparse_status()`** — check free quota, wallet and USDC balance before spending
39
25
 
40
- ## Setup
26
+ That's it. Your agent can now fetch pages from inside any MCP-compatible client (Claude, Cursor, Hermes, Windsurf, and others).
41
27
 
42
- 1. Copy the environment template:
28
+ ## What you get
43
29
 
44
- ```bash
45
- cp .env.example .env
46
- ```
30
+ `nanoparse_fetch` renders the page in a real headless browser (JavaScript and all), isolates the actual article from nav, ads, and cookie banners, and returns:
47
31
 
48
- 2. Edit `.env` and add your Base wallet private key:
32
+ - **Clean Markdown** — GFM tables, callouts, math, and footnotes preserved
33
+ - **Metadata** — title, author, dates, language, word count, OpenGraph, schema.org JSON-LD
34
+ - **Litmus** — machine-readable signals your agent can reason over: source authority, freshness, structural trust, content density, syndication and paywall detection
49
35
 
50
- ```
51
- NANOPARSE_WALLET_KEY=0x_your_private_key_here
52
- ```
36
+ `nanoparse_status` tells your agent exactly where it stands: free parses remaining, wallet and USDC balance, and whether the next call will succeed without payment. Agents call it before spending.
53
37
 
54
- 3. Add to your MCP client config:
38
+ ## Payments
55
39
 
56
- ```json
57
- {
58
- "mcpServers": {
59
- "nanoparse": {
60
- "command": "npx",
61
- "args": ["nanoparse-mcp"]
62
- }
63
- }
64
- }
65
- ```
40
+ - **First 10 parses per device are free.** No account, no API key, no human required.
41
+ - **After that: $0.01 per parse** (flat, no subscriptions) via **x402** — an open micropayment protocol. Your agent's wallet signs the payment automatically. To give your agent a Coinbase wallet, run `npx @coinbase/payments-mcp` and connect it alongside NanoParse.
66
42
 
67
- Your agent will auto-discover the `nanoparse_fetch` tool.
43
+ ## How payments work under the hood
68
44
 
69
- ## Usage
45
+ When an agent without free quota calls `nanoparse_fetch`, the endpoint responds with an **HTTP 402 — Payment Required** carrying x402 payment instructions. The agent's wallet signs a $0.01 USDC (Base) transfer, the facilitator settles it, and the parse proceeds. The hosted endpoint handles the entire challenge → settlement flow — the agent never needs a private key on your machine.
70
46
 
71
- Your agent calls `nanoparse_fetch` with a URL:
47
+ ## Example
72
48
 
73
49
  ```
74
- nanoparse_fetch("https://example.com/article")
75
- ```
76
-
77
- Optional debug mode:
50
+ You: Fetch https://www.ft.com/content/... and summarize the argument.
78
51
 
52
+ Agent: [calls nanoparse_fetch(url)]
53
+ → clean Markdown + Litmus signals
54
+ → summarizes from primary content, cites freshness and authority
79
55
  ```
80
- nanoparse_fetch("https://example.com/article", debug=true)
81
- ```
82
-
83
- See [`examples/basic-usage.md`](./examples/basic-usage.md) for a full copy-paste runnable example.
84
-
85
- ### Pricing
86
-
87
- First 10 parses per device are free. After that, **$0.0175 per parse** via x402 micropayment in USDC on Base. See [nanoparse.app](https://nanoparse.app) for current pricing and API docs.
88
-
89
- ## Security
90
56
 
91
- - Your private key is read from `NANOPARSE_WALLET_KEY` at runtime and is **never logged, printed, or transmitted** except for signing x402 payment requests.
92
- - The `.env` file is excluded from git via `.gitignore`.
93
- - Payment signing uses [viem](https://viem.sh), an established, audited Ethereum library.
94
- - This client never constructs raw blockchain transactions — payment settlement is handled by the [x402 facilitator](https://x402.org).
57
+ ## Repository note
95
58
 
96
- ## Versioning
59
+ The `nanoparse-mcp` npm package previously published here was the first-generation local client, which held a wallet private key and signed x402 payments on your machine. It is retired: the hosted MCP endpoint now handles the full payment flow itself, so the local client is no longer needed. **Use the hosted endpoint above** — it is the current, supported integration.
97
60
 
98
- This project follows [Semantic Versioning](https://semver.org). See [`CHANGELOG.md`](./CHANGELOG.md) for release history.
61
+ ## Docs
99
62
 
100
- ## License
63
+ - Quick start & integration: [nanoparse.app/quickstart](https://nanoparse.app/quickstart)
64
+ - Compare & pricing: [nanoparse.app/compare](https://nanoparse.app/compare)
65
+ - API + MCP endpoint: [nanoparse.app](https://nanoparse.app)
101
66
 
102
- MIT — see [LICENSE](./LICENSE).
67
+ MIT licensed.
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextpro
5
5
  import { fetchPage } from "./fetch.js";
6
6
  const server = new Server({
7
7
  name: "nanoparse-mcp",
8
- version: "1.0.2",
8
+ version: "1.0.9",
9
9
  }, {
10
10
  capabilities: {
11
11
  tools: {},
@@ -16,7 +16,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
16
16
  {
17
17
  name: "nanoparse_fetch",
18
18
  description: "Fetch a web page and return clean, structured Markdown with metadata. " +
19
- "First 10 parses free per device. After that, pay $0.0175 USDC on Base via x402. " +
19
+ "First 10 parses free per device. After that, pay $0.01 USDC on Base via x402. " +
20
20
  "No account or API key required.",
21
21
  inputSchema: {
22
22
  type: "object",
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;IACE,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;CACjB,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CACF,CAAC;AAEF,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IAC5D,KAAK,EAAE;QACL;YACE,IAAI,EAAE,iBAAiB;YACvB,WAAW,EACT,wEAAwE;gBACxE,kFAAkF;gBAClF,iCAAiC;YACnC,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,GAAG,E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C,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nanoparse-mcp",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "MCP client for NanoParse — pay-per-parse web content extraction for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",