tereno-mcp 0.1.1 โ 0.1.3
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 +133 -49
- package/bin/tereno-mcp.mjs +5 -1
- package/images/logo.png +0 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,17 +1,53 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="images/logo.png" alt="Tereno" width="150" />
|
|
4
|
+
|
|
1
5
|
# tereno-mcp
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
### ๐ก๏ธ Check before you act โ an MCP server for Base, over x402
|
|
8
|
+
|
|
9
|
+
**Ask what it costs before you pay for it.** Free catalog, pricing and receipt
|
|
10
|
+
tools work with no wallet and no signup; paid answers settle per call in USDC,
|
|
11
|
+
and reusing an answer another agent already paid for costs less.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
[](https://www.npmjs.com/package/tereno-mcp)
|
|
16
|
+
[](https://registry.modelcontextprotocol.io)
|
|
17
|
+
[](https://base.org)
|
|
18
|
+
[](https://www.x402.org)
|
|
19
|
+
|
|
20
|
+
[](./LICENSE)
|
|
21
|
+
[](./package.json)
|
|
22
|
+
[](#-free-no-wallet-needed)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx -y tereno-mcp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## โก Why this exists
|
|
7
33
|
|
|
8
|
-
|
|
9
|
-
|
|
34
|
+
An agent that reads a contract, signs a transaction or scrapes a page is acting
|
|
35
|
+
on information it cannot verify. Most tools answer *what* something is. None of
|
|
36
|
+
them tell you how long that answer stays true.
|
|
10
37
|
|
|
11
|
-
|
|
38
|
+
`tereno-mcp` puts [Tereno](https://www.tereno.xyz) inside any MCP client. Every
|
|
39
|
+
paid answer comes back with the evidence behind it, the limits of that evidence,
|
|
40
|
+
and **the block it stops being valid at**.
|
|
12
41
|
|
|
13
|
-
|
|
14
|
-
|
|
42
|
+
- **No API key, no signup.** The agent's wallet *is* the identity.
|
|
43
|
+
- **Price before payment.** `tereno_price` tells you the cost and whether the
|
|
44
|
+
answer already exists, without a wallet and without committing to anything.
|
|
45
|
+
- **Cheaper when shared.** Deterministic answers are reused across agents: the
|
|
46
|
+
first caller pays to compute, everyone after pays the reuse price.
|
|
47
|
+
|
|
48
|
+
## ๐ Install
|
|
49
|
+
|
|
50
|
+
Add it to any MCP client โ Claude Desktop, Claude Code, Cursor, Cline, Windsurf:
|
|
15
51
|
|
|
16
52
|
```json
|
|
17
53
|
{
|
|
@@ -24,62 +60,110 @@ speaks MCP over stdio:
|
|
|
24
60
|
}
|
|
25
61
|
```
|
|
26
62
|
|
|
27
|
-
Nothing else to configure
|
|
63
|
+
Restart the client. Nothing else to configure โ the free tools work immediately.
|
|
28
64
|
|
|
29
|
-
## Free
|
|
65
|
+
## ๐ Free, no wallet needed
|
|
30
66
|
|
|
31
|
-
| Tool |
|
|
32
|
-
|
|
33
|
-
| `tereno_catalog` |
|
|
34
|
-
| `tereno_price` | What
|
|
35
|
-
| `tereno_receipt` | What a settled call actually
|
|
67
|
+
| Tool | The question it answers |
|
|
68
|
+
|---|---|
|
|
69
|
+
| ๐ `tereno_catalog` | What can Tereno answer, what does it cost, how long does each answer stay valid? |
|
|
70
|
+
| ๐ท๏ธ `tereno_price` | What would *this exact call* cost right now โ and does the answer already exist? |
|
|
71
|
+
| ๐งพ `tereno_receipt` | What did a settled call actually charge: tier, list price, credit applied, price paid? |
|
|
36
72
|
|
|
37
|
-
`tereno_price` is the one worth knowing about.
|
|
38
|
-
so an answer another agent already paid for costs less while it is still fresh:
|
|
73
|
+
`tereno_price` is the one worth knowing about. It names the reuse tier out loud:
|
|
39
74
|
|
|
40
75
|
```
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
76
|
+
hit another agent already paid to compute this and it is still fresh
|
|
77
|
+
partial the durable half survived; only the expired part is recomputed
|
|
78
|
+
miss nothing to reuse โ this call computes it, and the next asker pays less
|
|
44
79
|
```
|
|
45
80
|
|
|
46
|
-
## Paid
|
|
81
|
+
## ๐ณ Paid per call
|
|
82
|
+
|
|
83
|
+
| Tool | Price | The question it answers |
|
|
84
|
+
|---|---:|---|
|
|
85
|
+
| ๐ฆ `transaction_intent_guard` | $0.005 | **Is this safe to sign?** Simulation, gas, balance and allowance deltas, unlimited-approval flags |
|
|
86
|
+
| ๐ก๏ธ `contract_guard` | $0.001โ3 | Is this contract safe to interact with? (code, proxy, pause) |
|
|
87
|
+
| ๐ต๏ธ `contract_change` | $0.001โ2 | Did it change since last look? (rug-pull-after-audit detector) |
|
|
88
|
+
| ๐ช `token_metadata` | $0.001โ3 | What token is this, really? (name, symbol, decimals, supply) |
|
|
89
|
+
| ๐งฌ `contract_interface` | $0.001โ2 | ERC-20? NFT? Proxy? One bounded probe |
|
|
90
|
+
| โฝ `chain_snapshot` | $0.001โ2 | Latest Base block, base fee and suggested gas, zero parameters |
|
|
91
|
+
| ๐ `web_compile` | $0.001โ5 | Public URL โ bounded Markdown with resolved links, citations and a reusable artifact |
|
|
92
|
+
| ๐ `evidence_artifact` | $0.001โ3 | Can this public artifact be reused? Provenance, field validity, recomputation input |
|
|
93
|
+
| ๐ค `demand_pledge` | free | Name a capability you would pay for. Credit only after the same wallet pays for it later |
|
|
94
|
+
|
|
95
|
+
Calling a paid tool returns a `402` carrying the payment challenge in
|
|
96
|
+
`error.data.paymentRequired`. Sign it and retry with a `PAYMENT-SIGNATURE`
|
|
97
|
+
header. If your agent already has an x402 wallet, that retry is the normal flow
|
|
98
|
+
and **this package never touches a private key**.
|
|
99
|
+
|
|
100
|
+
> ๐ `transaction_intent_guard` is never cached, shared or resold. An unsigned
|
|
101
|
+
> transaction is intent, and it stays with the wallet that paid for it.
|
|
102
|
+
|
|
103
|
+
## โ๏ธ Configuration
|
|
104
|
+
|
|
105
|
+
| Env | Default | Purpose |
|
|
106
|
+
|---|---|---|
|
|
107
|
+
| `TERENO_WALLET` | โ | Base address announced before payment, so a challenge can be bound to the wallet that will settle it. Optional. |
|
|
108
|
+
| `TERENO_BASE_URL` | `https://www.tereno.xyz` | Point at another Tereno deployment. |
|
|
109
|
+
| `TERENO_TIMEOUT_MS` | `45000` | Upstream request timeout. |
|
|
110
|
+
| `TERENO_EVIDENCE_INSTALLATION_ID` | โ | Optional stable random id for this MCP installation. It is hashed only when resolving evidence received from another agent; never use a wallet or secret. |
|
|
47
111
|
|
|
48
|
-
|
|
49
|
-
`chain_snapshot`, `evidence_artifact`, `web_compile`, `transaction_intent_guard`.
|
|
112
|
+
## ๐ What this package does and does not do
|
|
50
113
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
needs a
|
|
114
|
+
It is a **stdio transport** in front of the hosted endpoint at
|
|
115
|
+
[`/api/mcp`](https://www.tereno.xyz/api/mcp). Messages are forwarded verbatim, so
|
|
116
|
+
the tool list, the prices and the payment challenge all come from the same place
|
|
117
|
+
an HTTP agent sees โ and this package needs no release when a capability changes.
|
|
55
118
|
|
|
56
|
-
|
|
57
|
-
|
|
119
|
+
The one thing it translates is payment: over HTTP the challenge arrives in a
|
|
120
|
+
response header, and stdio has no headers, so it is folded into the JSON-RPC
|
|
121
|
+
error payload where a client can still reach it.
|
|
58
122
|
|
|
59
|
-
|
|
123
|
+
**No private key is ever read, stored or transmitted.** There are no
|
|
124
|
+
dependencies, and the whole thing is one readable file โ [read it](./bin/tereno-mcp.mjs)
|
|
125
|
+
before you let it run on your machine.
|
|
60
126
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
| `TERENO_WALLET` | none | Base address announced before payment, so a challenge can be bound to the wallet that will settle it. Optional; every free tool works without it. |
|
|
64
|
-
| `TERENO_BASE_URL` | `https://www.tereno.xyz` | Point at another deployment. |
|
|
65
|
-
| `TERENO_TIMEOUT_MS` | `45000` | Upstream request timeout. |
|
|
127
|
+
If your client supports remote MCP servers, skip this package and point it
|
|
128
|
+
straight at `https://www.tereno.xyz/api/mcp`.
|
|
66
129
|
|
|
67
|
-
|
|
130
|
+
## ๐ฑ How it stays cheap โ the cooperative layer
|
|
68
131
|
|
|
69
|
-
|
|
132
|
+
Tereno is a **shared-cache coordination layer**, not just an API. The first agent
|
|
133
|
+
to pay for a given piece of verified work seeds it for the whole network; every
|
|
134
|
+
later agent that reuses that answer pays less, and the seeder earns a small,
|
|
135
|
+
non-transferable credit that discounts its own future calls.
|
|
70
136
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
agent sees, and this package does not need a release when a capability changes.
|
|
137
|
+
Safety is a public good with a private cost. By making the first computation earn
|
|
138
|
+
from every reuse, the network turns *"I paid to check this contract"* into *"I
|
|
139
|
+
lowered the price of checking it for everyone, and my own checks got cheaper."*
|
|
75
140
|
|
|
76
|
-
The
|
|
77
|
-
|
|
78
|
-
|
|
141
|
+
> The honest fine print: rewards are **non-transferable credits**, capped per
|
|
142
|
+
> artifact. They fund your agent's budget, they are not yield.
|
|
143
|
+
|
|
144
|
+
Discovery, scoring, reputation, pricing and the global cache live in the closed
|
|
145
|
+
Tereno backend. This server and its SDK
|
|
146
|
+
([`tereno-client`](https://www.npmjs.com/package/tereno-client)) are the public,
|
|
147
|
+
open interface to it.
|
|
148
|
+
|
|
149
|
+
## ๐ค Support & community
|
|
150
|
+
|
|
151
|
+
- ๐ฌ **Questions / setup** โ [Tereno Discord](https://discord.gg/YsgGSRBxn)
|
|
152
|
+
- ๐ **Bugs** โ [issues](https://github.com/tereno-xyz/tereno-mcp/issues) ยท โ ๏ธ never paste private keys or `.env`
|
|
153
|
+
- ๐ **Vulnerabilities** โ [report privately](https://github.com/tereno-xyz/tereno-mcp/security/advisories/new)
|
|
154
|
+
|
|
155
|
+
## ๐ Links
|
|
156
|
+
|
|
157
|
+
[Live catalog](https://www.tereno.xyz/api/v1/capabilities) ยท
|
|
158
|
+
[OpenAPI](https://www.tereno.xyz/openapi.yaml) ยท
|
|
159
|
+
[MCP registry entry](https://registry.modelcontextprotocol.io/v0/servers?search=tereno) ยท
|
|
160
|
+
[plugin-tereno for ElizaOS](https://github.com/RobMartello/plugin-tereno) ยท
|
|
161
|
+
[tereno-client SDK](https://www.npmjs.com/package/tereno-client)
|
|
162
|
+
|
|
163
|
+
---
|
|
79
164
|
|
|
80
|
-
|
|
81
|
-
it at `https://www.tereno.xyz/api/mcp` directly.
|
|
165
|
+
<div align="center">
|
|
82
166
|
|
|
83
|
-
|
|
167
|
+
**[tereno.xyz](https://www.tereno.xyz)** ยท Verdicts before signatures, for agents on Base.
|
|
84
168
|
|
|
85
|
-
|
|
169
|
+
</div>
|
package/bin/tereno-mcp.mjs
CHANGED
|
@@ -15,10 +15,13 @@ import { createInterface } from "node:readline";
|
|
|
15
15
|
|
|
16
16
|
// Travels in the user-agent, and the demand panel counts installs by it, so it
|
|
17
17
|
// has to track the published version rather than drift from it.
|
|
18
|
-
const VERSION = "0.1.
|
|
18
|
+
const VERSION = "0.1.3";
|
|
19
19
|
const BASE_URL = (process.env.TERENO_BASE_URL || "https://www.tereno.xyz").replace(/\/+$/, "");
|
|
20
20
|
const ENDPOINT = BASE_URL + "/api/mcp";
|
|
21
21
|
const WALLET = process.env.TERENO_WALLET?.trim();
|
|
22
|
+
// Stable opaque id, supplied by the operator. The hosted server hashes it only
|
|
23
|
+
// when evidence received from another agent is resolved; it is never a wallet.
|
|
24
|
+
const EVIDENCE_INSTALLATION_ID = process.env.TERENO_EVIDENCE_INSTALLATION_ID?.trim();
|
|
22
25
|
const TIMEOUT_MS = Number(process.env.TERENO_TIMEOUT_MS || 45_000);
|
|
23
26
|
const PAYMENT_REQUIRED_HEADER = "payment-required";
|
|
24
27
|
|
|
@@ -42,6 +45,7 @@ async function forward(request) {
|
|
|
42
45
|
// Identifies the caller before payment, so a challenge can be bound to the
|
|
43
46
|
// wallet that will settle it. Optional: everything free works without it.
|
|
44
47
|
if (WALLET) headers["x-agent-wallet"] = WALLET;
|
|
48
|
+
if (EVIDENCE_INSTALLATION_ID) headers["x-tereno-evidence-installation"] = EVIDENCE_INSTALLATION_ID;
|
|
45
49
|
|
|
46
50
|
const response = await fetch(ENDPOINT, {
|
|
47
51
|
method: "POST", headers, body: JSON.stringify(request), signal: controller.signal,
|
package/images/logo.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tereno-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"mcpName": "xyz.tereno/tereno",
|
|
5
5
|
"description": "MCP server for Tereno on Base: check a contract, a transaction or a web page before you act on it. Free catalog, pricing and receipt tools; paid answers settle per call with x402 in USDC.",
|
|
6
6
|
"type": "module",
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"bin",
|
|
12
|
-
"
|
|
12
|
+
"images",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
13
15
|
],
|
|
14
16
|
"engines": {
|
|
15
17
|
"node": ">=18"
|