@nonagon-link/mcp 0.1.0

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.
Files changed (3) hide show
  1. package/README.md +72 -0
  2. package/dist/server.js +1403 -0
  3. package/package.json +54 -0
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # @nonagon-link/mcp
2
+
3
+ MCP (Model Context Protocol) server for [NONAGON LINK](https://app.nnglink.ai) — lets AI agents discover paid APIs and pay for them with USDC over the [x402 protocol](https://www.x402.org) (Solana).
4
+
5
+ ## Tools
6
+
7
+ | Tool | Description |
8
+ |---|---|
9
+ | `search_listings` | Search the NONAGON LINK API catalog by keyword |
10
+ | `pay_and_call` | Call a paid API endpoint, automatically handling the x402 payment flow (402 → sign → retry) |
11
+ | `get_active_tokens` | List active access tokens for this session (masked summary only) |
12
+
13
+ ## Quick start (Claude Code / Claude Desktop)
14
+
15
+ Add to your MCP client config (e.g. `.claude/settings.json` or `claude_desktop_config.json`):
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "nonagon-link": {
21
+ "command": "npx",
22
+ "args": ["-y", "--ignore-scripts", "@nonagon-link/mcp@0.1.0"],
23
+ "env": {
24
+ "NONAGON_PRIVATE_KEY": "<Base58 Solana secret key>",
25
+ "NONAGON_LINK_BASE_URL": "https://api.nnglink.ai"
26
+ }
27
+ }
28
+ }
29
+ }
30
+ ```
31
+
32
+ > **Always pin an exact version** (`@nonagon-link/mcp@0.1.0`). Never use an unversioned `@nonagon-link/mcp` — your private key is passed to the process environment, so an unpinned install would expose it to whatever the latest published version is. `--ignore-scripts` additionally prevents dependency install scripts from running with your environment.
33
+
34
+ For stricter isolation, install once and reference the binary directly:
35
+
36
+ ```bash
37
+ npm install -g @nonagon-link/mcp@0.1.0
38
+ ```
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "nonagon-link": { "command": "nonagon-mcp", "env": { "NONAGON_PRIVATE_KEY": "..." } }
44
+ }
45
+ }
46
+ ```
47
+
48
+ ## Environment variables
49
+
50
+ | Variable | Required | Description |
51
+ |---|---|---|
52
+ | `NONAGON_PRIVATE_KEY` | ✅ | Agent's Solana secret key (Base58). Used to sign USDC payments |
53
+ | `NONAGON_NETWORK` | — | CAIP-2 network id. Defaults to Solana mainnet |
54
+ | `NONAGON_LINK_BASE_URL` | — | Catalog endpoint for `search_listings` (e.g. `https://api.nnglink.ai`). `https` only; `http` allowed for `localhost` in local development |
55
+ | `MCP_AUTH_TOKEN` | HTTP mode only | Bearer token for Streamable HTTP transport (32-byte random, base64url or hex) |
56
+ | `LOG_LEVEL` | — | pino log level. Defaults to `info` |
57
+
58
+ ## Security notes
59
+
60
+ - **Use a dedicated wallet with a small balance.** The private key in `env` authorizes real USDC payments. Do not reuse your main wallet.
61
+ - The private key is never written to logs; log output is redacted and URLs are masked. Access tokens are only ever shown masked.
62
+ - stdio transport is the default and recommended mode. HTTP mode (`--transport http`) binds to `127.0.0.1` only and requires `MCP_AUTH_TOKEN`.
63
+ - The MCP `serverInfo.version` reported over the protocol is independent of this npm package's version.
64
+
65
+ ## Documentation
66
+
67
+ - Setup & verification guide: https://app.nnglink.ai/docs/mcp
68
+ - Agent developer guide: https://app.nnglink.ai/docs/agent
69
+
70
+ ## License
71
+
72
+ Apache-2.0