@veyanet/mcp 1.0.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,28 @@
1
+ # Changelog
2
+
3
+ All notable changes to the `@veyanet/mcp` package will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ---
8
+
9
+ ## [1.0.0] — 2026-09-07
10
+
11
+ ### Added
12
+ - **Canonical Package Release**: Official `@veyanet/mcp` Streamable HTTP Model Context Protocol server for VEYA on Robinhood Chain.
13
+ - **Public MCP URL**: Production paste endpoint `https://mcp.veyanet.tech/mcp` with landing `/` and honesty `/health`.
14
+ - **Public Tools**: `veya_describe`, `veya_ping_chain`, `veya_hash_blake3`, `veya_verify_transaction`, `veya_api_health`, and `veya_writes_status` when writes are disabled.
15
+ - **Authenticated Write Tools**: `veya_store_commitment`, `veya_attest_execution`, `veya_register_environment` gated by `MCP_API_KEY` + relayer private key and Bearer authorization.
16
+ - **SDK Bridge**: All chain crypto/verify/write paths delegate to `@veyanet/sdk` (`VeyaClient` / `EvmAnchor`) with chain id **46630** guards on writes.
17
+ - **Documentation Suite**: Publish-grade README (SDK-parity structure) plus `docs/` hub covering network pins, quickstart, architecture, tools, verification, deployment, configuration, transport, authentication, and SDK bridge.
18
+ - **Operator Scripts**: `npm test` (config + `/health` honesty) and `npm run smoke` (live initialize + tool calls).
19
+ - **Security Policy**: Coordinated disclosure via `security@veyanet.tech`; secrets hygiene for `.env` / Bearer / relayer keys.
20
+
21
+ ### Security
22
+ - Fail-closed writes when keys unset or Bearer mismatches.
23
+ - Honesty fields refuse FHE / mainnet / ERC-20 claims.
24
+ - CORS allowlist for credentialed browser Origins; empty allowlist rejects unknown Origins.
25
+
26
+ ### Notes
27
+ - Monorepo directory name `robinhood/hosted-mcp/` is layout-only next to the stdio MCP; the published product name is **VEYA MCP** / `@veyanet/mcp`.
28
+ - Stdio operator MCP remains `veya-anchor/packages/mcp/`.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 VEYA Network
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,502 @@
1
+ <div align="center">
2
+ <img src="./assets/logo.png" width="400" alt="VEYA Logo" />
3
+
4
+ # VEYA MCP
5
+
6
+ **The official Model Context Protocol server for post-quantum agent tools, chain verification, sealed-execution honesty, and protocol settlement on Robinhood Chain.**
7
+
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+ [![Package](https://img.shields.io/badge/@veyanet/mcp-1.0.0-cb3837.svg?style=flat-edge)](./package.json)
10
+ [![Node Version](https://img.shields.io/badge/Node-%3E%3D20-green.svg?style=flat-edge)](https://nodejs.org)
11
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Strict-blue?style=flat-edge)](https://www.typescriptlang.org/)
12
+ [![MCP Endpoint](https://img.shields.io/badge/MCP-mcp.veyanet.tech-0ea5e9.svg?style=flat-edge)](https://mcp.veyanet.tech/mcp)
13
+
14
+ **[Official Website](https://veyanet.tech)** • **[X (Twitter)](https://x.com/withveya)** • **[Public MCP URL](https://mcp.veyanet.tech/mcp)** • **[Documentation Index](./docs/README.md)** • **[Network Specifications](./docs/NETWORK_PIN.md)** • **[Security Policy](./SECURITY.md)**
15
+
16
+ </div>
17
+
18
+ ---
19
+
20
+ ## 💡 Information: What is VEYA?
21
+
22
+ The **VEYA Protocol** is a decentralized, cryptographically shielded execution layer engineered for post-quantum resilient autonomous agent fleets on **Robinhood Chain**. Traditional LLM agent frameworks suffer from severe structural vulnerabilities: because agents require private execution contexts—such as API integration credentials, proprietary system prompts, treasury authority, and policy rules—running them in standard host runtimes exposes sensitive state in plaintext to host operators, database administrators, and network intermediaries.
23
+
24
+ VEYA solves this security gap by establishing client-side cryptographic boundaries and post-quantum attestation primitives. Sensitive agent workloads are protected through local post-quantum key generation (**ML-DSA-44**), quantum-resistant session negotiation (**Kyber-768**), high-throughput cryptographic digests (**BLAKE3-256**), sealed execution with **AES-256-GCM** (software sealed-node — not Intel SGX / AWS Nitro / live FHE), and **2-of-3 multi-node consensus**. Settlement today is Robinhood Chain **testnet 46630**. Mainnet is Phase 3.
25
+
26
+ ### The VEYA MCP Server
27
+
28
+ The `@veyanet/mcp` package is the canonical **Model Context Protocol** surface for VEYA. It speaks Streamable HTTP so Claude, Cursor, and other MCP clients can paste a single URL and invoke VEYA tools without cloning `@veyanet/sdk` or running a local stdio binary. Cryptography, chain-id guards, and receipt parsing are delegated to `@veyanet/sdk`; this package owns the HTTP transport, tool registration, Bearer write gates, and the public honesty card.
29
+
30
+ By connecting an MCP client to `@veyanet/mcp`, you enable the following core capabilities:
31
+ * **Paste-URL Access**: Connect via `https://mcp.veyanet.tech/mcp` (Streamable HTTP) with no local process for strangers.
32
+ * **Public Read Tools**: Describe the stack honestly, ping Robinhood Chain, compute BLAKE3 digests, verify `Veya.sol` transactions, and probe `https://api.veyanet.tech/health`.
33
+ * **Fail-Closed Writes**: Optional on-chain tools (`storeCommitment`, `attestExecution`, `registerEnvironment`) require `MCP_API_KEY` + relayer key and `Authorization: Bearer`.
34
+ * **SDK-Backed Settlement**: Every chain call uses `@veyanet/sdk` (`VeyaClient` / `EvmAnchor`) with chain id **46630** pins.
35
+ * **Operator Stdio Sibling**: Local stdio MCP remains at `veya-anchor/packages/mcp/` for process-local operators; public clients use this HTTP MCP.
36
+
37
+ | Surface | Path in tree | How users connect |
38
+ |---------|--------------|-------------------|
39
+ | **MCP (primary)** | `robinhood/hosted-mcp/` (`@veyanet/mcp`) | Paste `https://mcp.veyanet.tech/mcp` |
40
+ | Stdio (operators) | `veya-anchor/packages/mcp/` | Local `veya-mcp` process |
41
+ | SDK | `robinhood/sdk/` (`@veyanet/sdk`) | Library import |
42
+
43
+ ---
44
+
45
+ ## 📖 Table of Contents
46
+
47
+ 1. [Architectural Design Philosophy](#-architectural-design-philosophy)
48
+ 2. [High-Level MCP Data Flow](#-high-level-mcp-data-flow)
49
+ 3. [Installation & Environmental Requirements](#-installation--environmental-requirements)
50
+ 4. [Server Configuration & Initialization](#-server-configuration--initialization)
51
+ 5. [Connect in Claude / Cursor](#-connect-in-claude--cursor)
52
+ 6. [Core Tools Overview](#-core-tools-overview)
53
+ * [Honesty & Discovery](#1-honesty--discovery)
54
+ * [Chain Read & Verify](#2-chain-read--verify)
55
+ * [BLAKE3 Commitment Helper](#3-blake3-commitment-helper)
56
+ * [Product API Health](#4-product-api-health)
57
+ * [Authenticated On-Chain Writes](#5-authenticated-on-chain-writes)
58
+ 7. [Comprehensive Quickstart](#-comprehensive-quickstart)
59
+ 8. [Transport, Auth & Reliability](#-transport-auth--reliability)
60
+ 9. [Advanced Cryptography Boundaries](#-advanced-cryptography-boundaries)
61
+ 10. [Operator Diagnostics & CLI Tools](#-operator-diagnostics--cli-tools)
62
+ 11. [Documentation Directory Index](#-documentation-directory-index)
63
+ 12. [Frequently Asked Questions (FAQ)](#-frequently-asked-questions-faq)
64
+ 13. [Contributing & Security Guidelines](#-contributing--security-guidelines)
65
+ 14. [License](#-license)
66
+
67
+ ---
68
+
69
+ ## 🛡️ Architectural Design Philosophy
70
+
71
+ The design of `@veyanet/mcp` is governed by the paradigm of **Thin Protocol Gate over Thick Cryptographic Client**. In naive MCP servers, business logic, secrets, and chain writes are mixed into tool handlers with soft auth. VEYA separates those concerns: the MCP process is a transport and policy shell; `@veyanet/sdk` remains the cryptographic engine that executes hashing, verification, and `EvmAnchor` writes.
72
+
73
+ This core philosophy is implemented through three primary architectural pillars:
74
+
75
+ ### 1. Streamable HTTP as the Public Contract
76
+ Strangers and agent runtimes connect with a single URL. The server implements MCP Streamable HTTP (`POST /mcp`) using `@modelcontextprotocol/sdk`. No stdio binary is required for the public path. Operators who need a local process keep the stdio sibling under Anchor.
77
+
78
+ ### 2. Fail-Closed Write Surface
79
+ On-chain write tools are registered only when **both** `MCP_API_KEY` and `VEYA_RELAYER_PRIVATE_KEY` (or `VEYA_DEPLOYER_PRIVATE_KEY`) are present. Every write invocation still requires `Authorization: Bearer <MCP_API_KEY>`. If either key is missing, the server exposes public reads plus `veya_writes_status` — it does not silently accept chain mutations.
80
+
81
+ ### 3. Honesty Before Marketing
82
+ `GET /health` and `veya_describe` state Robinhood **testnet 46630**, sealed = **AES-256-GCM** (not FHE), not mainnet, and whether writes are enabled. The MCP will not invent quorum, claim TEE hardware attestation, or present `Veya.sol` as an ERC-20.
83
+
84
+ ---
85
+
86
+ ## ⚡ High-Level MCP Data Flow
87
+
88
+ The following diagram illustrates how `@veyanet/mcp` accepts Streamable HTTP tool calls, gates writes, and settles through `@veyanet/sdk` onto Robinhood Chain:
89
+
90
+ ```mermaid
91
+ flowchart TB
92
+ subgraph ClientSpace["MCP Client (Claude / Cursor / Agent Runtime)"]
93
+ PasteURL["Paste https://mcp.veyanet.tech/mcp"]
94
+ ToolCall["veya_* tool invocation"]
95
+ end
96
+
97
+ subgraph McpBoundary["@veyanet/mcp Streamable HTTP"]
98
+ Landing["GET /"]
99
+ Health["GET /health"]
100
+ PostMcp["POST /mcp"]
101
+ Auth{"Authorization: Bearer MCP_API_KEY?"}
102
+ PublicTools["Public tools"]
103
+ WriteTools["Write tools"]
104
+ end
105
+
106
+ subgraph SdkBoundary["@veyanet/sdk"]
107
+ ReadClient["VeyaClient read / verify / hash"]
108
+ EvmAnchor["EvmAnchor writes + eth_chainId guard"]
109
+ end
110
+
111
+ subgraph ApiBoundary["VEYA Product API"]
112
+ ApiHealth["https://api.veyanet.tech/health"]
113
+ end
114
+
115
+ subgraph Blockchain["Protocol Settlement (Robinhood Chain testnet 46630)"]
116
+ VeyaSol["Veya.sol\nCommitments · Environments · Attestations"]
117
+ end
118
+
119
+ PasteURL --> PostMcp
120
+ ToolCall --> PostMcp
121
+ PostMcp --> Auth
122
+ Auth -->|"no key / public tools"| PublicTools
123
+ Auth -->|"Bearer match + keys set"| WriteTools
124
+ PublicTools --> ReadClient
125
+ PublicTools -->|"veya_api_health"| ApiHealth
126
+ WriteTools --> EvmAnchor
127
+ ReadClient --> VeyaSol
128
+ EvmAnchor --> VeyaSol
129
+ Landing --> McpBoundary
130
+ Health --> McpBoundary
131
+ ```
132
+
133
+ ---
134
+
135
+ ## 📦 Installation & Environmental Requirements
136
+
137
+ ### Runtime Compatibility & Prerequisites
138
+ The `@veyanet/mcp` server is engineered for modern Node.js and ESM builds via `tsup`:
139
+
140
+ * **Node.js Runtime**: Version **20.0.0** or higher (`engines.node >= 20`).
141
+ * **TypeScript**: Version **5.0** or higher targeting `ES2022` / `ESNext` for local development.
142
+ * **Sibling SDK**: `@veyanet/sdk` resolved via `file:../sdk` — build the SDK before installing this package.
143
+ * **Network**: Outbound HTTPS to Robinhood Chain RPC (and optionally `api.veyanet.tech`).
144
+
145
+ ### Package Installation (Monorepo)
146
+
147
+ ```bash
148
+ cd robinhood/sdk
149
+ npm install
150
+ npm run build
151
+
152
+ cd ../hosted-mcp
153
+ npm install
154
+ npm run build
155
+ ```
156
+
157
+ Start the server:
158
+
159
+ ```bash
160
+ npm start
161
+ # → http://127.0.0.1:8788/mcp
162
+ # → http://127.0.0.1:8788/health
163
+ ```
164
+
165
+ Binary entry after build: `veya-mcp` → `./dist/cli.js`.
166
+
167
+ ---
168
+
169
+ ## 🔑 Server Configuration & Initialization
170
+
171
+ The process loads configuration from environment variables with Robinhood testnet defaults. Copy `.env.example` to `.env` for local overrides. **Never commit `.env`.**
172
+
173
+ ### Configuration Resolution Cascade
174
+ Parameters resolve from process environment first, then package defaults (testnet **46630**, public RPC, `Veya.sol` address, `PUBLIC_MCP_URL=https://mcp.veyanet.tech/mcp`).
175
+
176
+ ```typescript
177
+ import { loadConfig, createHttpApp, startHttpServer } from "@veyanet/mcp";
178
+
179
+ // 1. Zero-config start (testnet defaults)
180
+ startHttpServer();
181
+
182
+ // 2. Explicit config for operators
183
+ const cfg = loadConfig();
184
+ const app = createHttpApp(cfg);
185
+ app.listen(cfg.port, cfg.host);
186
+ ```
187
+
188
+ ### Environment Variables Reference
189
+
190
+ | Variable Name | Description | Default / Fallback |
191
+ |---------------|-------------|--------------------|
192
+ | `PUBLIC_MCP_URL` | Public paste URL advertised in landing + health | `https://mcp.veyanet.tech/mcp` |
193
+ | `PORT` | Listen port | `8788` |
194
+ | `HOST` | Bind address | `0.0.0.0` |
195
+ | `ROBINHOOD_RPC_URL` | Network JSON-RPC endpoint | Public testnet RPC |
196
+ | `ROBINHOOD_CHAIN_ID` | Network chain ID | `46630` |
197
+ | `ROBINHOOD_EXPLORER_URL` | Block explorer base URL | Public testnet explorer |
198
+ | `VEYA_CONTRACT_ADDRESS` | `Veya.sol` protocol contract | Testnet deploy address |
199
+ | `VEYA_API_URL` | Product API base for `veya_api_health` | `https://api.veyanet.tech` |
200
+ | `MCP_API_KEY` | Bearer secret for write tools | unset → reads only |
201
+ | `VEYA_RELAYER_PRIVATE_KEY` | Payer key for on-chain writes | unset → reads only |
202
+ | `VEYA_DEPLOYER_PRIVATE_KEY` | Alternate payer env name | same role as relayer |
203
+ | `CORS_ORIGIN` | Comma-separated Origin allowlist | empty = reject credentialed browser Origin |
204
+ | `NODE_ENV` | Runtime mode | `development` |
205
+
206
+ ---
207
+
208
+ ## 🔌 Connect in Claude / Cursor
209
+
210
+ ### Production (strangers / public clients)
211
+
212
+ Paste into a custom MCP connector using **Streamable HTTP** transport:
213
+
214
+ ```text
215
+ https://mcp.veyanet.tech/mcp
216
+ ```
217
+
218
+ No API key is required for public tools. Write tools only appear or succeed when the server operator enabled keys and the client sends Bearer auth.
219
+
220
+ ### Claude CLI (local development)
221
+
222
+ ```bash
223
+ claude mcp add veya --transport http http://127.0.0.1:8788/mcp
224
+ ```
225
+
226
+ ### Cursor IDE
227
+
228
+ Settings → MCP → Add custom MCP server / connector → URL:
229
+
230
+ ```text
231
+ https://mcp.veyanet.tech/mcp
232
+ ```
233
+
234
+ For local verification use `http://127.0.0.1:8788/mcp` against `npm start`.
235
+
236
+ ### Landing Page
237
+
238
+ `GET https://mcp.veyanet.tech/` (or local `/`) returns a minimal HTML page with the paste URL, health link, and honesty line (testnet 46630 · AES-256-GCM · not mainnet).
239
+
240
+ ---
241
+
242
+ ## 🧩 Core Tools Overview
243
+
244
+ The `@veyanet/mcp` tool surface is split into public reads and authenticated writes. Each tool returns MCP text content (typically JSON) for agent consumption.
245
+
246
+ ### 1. Honesty & Discovery
247
+
248
+ ```text
249
+ Tool: veya_describe
250
+ Args: (none)
251
+ ```
252
+
253
+ Returns the honesty card: package name `@veyanet/mcp`, public URL, settlement (chain id, contract, RPC, explorer), product API, sealed = AES-256-GCM (not FHE), mainnet deferred to Phase 3, write policy, and pointer to the stdio sibling.
254
+
255
+ ```text
256
+ Tool: veya_writes_status
257
+ Args: (none)
258
+ ```
259
+
260
+ Present when write tools are **disabled**. Reports that `MCP_API_KEY` + `VEYA_RELAYER_PRIVATE_KEY` must be set to enable on-chain tools.
261
+
262
+ ### 2. Chain Read & Verify
263
+
264
+ ```text
265
+ Tool: veya_ping_chain
266
+ Args: (none)
267
+ ```
268
+
269
+ Uses `@veyanet/sdk` `VeyaClient.pingChain()` against the configured RPC. Confirms chain id matches config (**46630** on testnet) and returns block metadata.
270
+
271
+ ```text
272
+ Tool: veya_verify_transaction
273
+ Args: txHash (0x…, min 66 chars)
274
+ ```
275
+
276
+ Parses `Veya.sol` receipt events via SDK `verifyTransaction` (CommitmentStored / ExecutionAttested / related). Use a real Robinhood explorer hash.
277
+
278
+ **Example known testnet commitment tx:**
279
+
280
+ ```text
281
+ 0xd68ab19671f0a3be63651cb6d6e24f5decf591da981708502827bca3689d31d8
282
+ ```
283
+
284
+ ### 3. BLAKE3 Commitment Helper
285
+
286
+ ```text
287
+ Tool: veya_hash_blake3
288
+ Args: data (string, min length 1)
289
+ ```
290
+
291
+ Computes a BLAKE3-256 hex digest through the SDK. Useful before an authenticated `veya_store_commitment` or for local commitment previews.
292
+
293
+ ### 4. Product API Health
294
+
295
+ ```text
296
+ Tool: veya_api_health
297
+ Args: (none)
298
+ ```
299
+
300
+ `GET {VEYA_API_URL}/health` (default `https://api.veyanet.tech/health`). Returns HTTP status and JSON body. The API may report `degraded` when validators/sealed are down — that is honest, not a failure of this MCP process.
301
+
302
+ ### 5. Authenticated On-Chain Writes
303
+
304
+ Enabled only when **both** server env keys exist. Client must send:
305
+
306
+ ```http
307
+ Authorization: Bearer <MCP_API_KEY>
308
+ ```
309
+
310
+ | Tool | Primary args | On-chain method |
311
+ |------|----------------|-----------------|
312
+ | `veya_store_commitment` | `environmentUuidHex`, `commitmentHex` | `storeCommitment` |
313
+ | `veya_attest_execution` | `environmentUuidHex`, `blake3HashHex`, `mldsaSigHex` | `attestExecution` |
314
+ | `veya_register_environment` | `environmentUuidHex`, `pqPubkeyHashHex`, `envType` | `registerEnvironment` |
315
+
316
+ Writes go through SDK `EvmAnchor`, which calls `ensureRobinhoodChain()` before submit so a mis-pointed RPC cannot silently land on another EVM.
317
+
318
+ ---
319
+
320
+ ## 🚀 Comprehensive Quickstart
321
+
322
+ ### A. Stranger path (no keys, no clone)
323
+
324
+ 1. Open Claude or Cursor MCP settings.
325
+ 2. Add Streamable HTTP URL: `https://mcp.veyanet.tech/mcp`.
326
+ 3. Ask the agent to run `veya_describe`.
327
+ 4. Ask the agent to run `veya_ping_chain` and confirm chain id **46630**.
328
+ 5. Ask the agent to run `veya_verify_transaction` with a known `Veya.sol` tx hash.
329
+
330
+ ### B. Developer path (local process)
331
+
332
+ ```bash
333
+ cd robinhood/sdk && npm install && npm run build
334
+ cd ../hosted-mcp && npm install && npm run build
335
+ cp .env.example .env # do not commit .env
336
+ npm start
337
+ ```
338
+
339
+ In another terminal:
340
+
341
+ ```bash
342
+ npm test
343
+ npm run smoke
344
+ ```
345
+
346
+ Smoke starts an in-process server, performs MCP initialize + `tools/list`, then calls `veya_describe` and `veya_ping_chain` against live RPC.
347
+
348
+ ### C. Operator write path (funded testnet key)
349
+
350
+ 1. Set `MCP_API_KEY` to a long random secret.
351
+ 2. Set `VEYA_RELAYER_PRIVATE_KEY` to a funded Robinhood **testnet** key.
352
+ 3. Restart the process; confirm `/health` shows `"writesEnabled": true`.
353
+ 4. From an MCP client that can set headers, call write tools with `Authorization: Bearer <MCP_API_KEY>`.
354
+ 5. Confirm the returned `txHash` on the Robinhood testnet explorer.
355
+
356
+ ---
357
+
358
+ ## ⚠️ Transport, Auth & Reliability
359
+
360
+ ### HTTP Endpoints
361
+
362
+ | Method | Path | Purpose |
363
+ |--------|------|---------|
364
+ | `GET` | `/` | Landing HTML with paste URL |
365
+ | `GET` | `/health` | Honesty JSON (service, version, chain, writesEnabled, sealed) |
366
+ | `POST` | `/mcp` | Stateless Streamable HTTP MCP |
367
+ | `POST` | `/mcp/session` | Optional sessionful path (`MCP-Session-Id`) |
368
+
369
+ ### CORS
370
+ `CORS_ORIGIN` is an allowlist. Empty allowlist rejects credentialed browser `Origin` values. Server-to-server MCP clients (no Origin) are unaffected.
371
+
372
+ ### Auth Model
373
+ * Public tools: no Bearer required.
374
+ * Write tools: Bearer must equal `MCP_API_KEY`; relayer key must be configured; mismatch throws and fails the tool call.
375
+ * Relayer private keys never appear in tool responses or `/health`.
376
+
377
+ ### Failure Modes
378
+ * Wrong RPC chain id on writes → SDK `CHAIN_MISMATCH` (fail closed).
379
+ * Missing write keys → write tools not registered (or `veya_writes_status` only).
380
+ * Bad Bearer → unauthorized error on write tools.
381
+ * Downstream API degraded → `veya_api_health` returns honest body; MCP itself can still be `status: ok`.
382
+
383
+ ---
384
+
385
+ ## 🔒 Advanced Cryptography Boundaries
386
+
387
+ `@veyanet/mcp` does **not** re-implement PQ algorithms. It calls `@veyanet/sdk`, which provides:
388
+
389
+ ### 1. ML-DSA-44 Post-Quantum Identity (FIPS 204)
390
+ Used when operators submit attestation signature bytes through `veya_attest_execution`. Verification of ML-DSA remains off-chain in the SDK / auditors; the chain stores bounded attestation bytes and hashes.
391
+
392
+ ### 2. BLAKE3-256 Digesting
393
+ `veya_hash_blake3` and commitment writes use 32-byte digests. Use-mode human content proofs on the product site may use SHA-256 for browser convenience; MCP commitment helpers follow the SDK BLAKE3 path.
394
+
395
+ ### 3. AES-256-GCM Sealed Execution
396
+ Sealed execution is **not** executed inside this MCP process by default. Honesty strings state sealed = AES-256-GCM elsewhere in the stack. This is **not** Intel SGX, **not** AWS Nitro, and **not** live FHE (TFHE is a later phase).
397
+
398
+ ### 4. Chain Id Guard
399
+ `EvmAnchor.ensureRobinhoodChain()` runs before on-chain writes so MCP operators cannot accidentally settle on the wrong EVM.
400
+
401
+ ---
402
+
403
+ ## 🛠️ Operator Diagnostics & CLI Tools
404
+
405
+ The package ships with verification scripts for operators and publishers:
406
+
407
+ ```bash
408
+ # Typecheck
409
+ npm run lint
410
+
411
+ # Unit + HTTP /health honesty (service name, chainId, AES string)
412
+ npm test
413
+
414
+ # Live MCP initialize + tools/list + ping (needs network)
415
+ npm run smoke
416
+
417
+ # Production-style process
418
+ npm run build && npm start
419
+ ```
420
+
421
+ Health probe:
422
+
423
+ ```bash
424
+ curl -s https://mcp.veyanet.tech/health | jq .
425
+ # or local:
426
+ curl -s http://127.0.0.1:8788/health | jq .
427
+ ```
428
+
429
+ Expected honesty fields include `service: "@veyanet/mcp"`, `chainId: 46630`, `sealed` mentioning `AES-256-GCM`, and `writesEnabled` boolean.
430
+
431
+ Production TLS for `mcp.veyanet.tech`: see **[Deployment Guide](./docs/DEPLOYMENT.md)** and tree doc `docs/phase2/MCP.md`.
432
+
433
+ ---
434
+
435
+ ## 📚 Documentation Directory Index
436
+
437
+ This README serves as the entry point. For detailed operational and integrator material, refer to the documentation directory:
438
+
439
+ | Document | Topic | Description |
440
+ |----------|-------|-------------|
441
+ | **[Documentation Hub](./docs/README.md)** | Index | Master catalog and reading paths for strangers vs operators. |
442
+ | **[Network Specifications](./docs/NETWORK_PIN.md)** | Network | Chain id, RPC, explorer, `Veya.sol` address, public MCP URL. |
443
+ | **[Quickstart Guide](./docs/QUICKSTART.md)** | Tutorial | Paste URL → first tools → local loop → smoke. |
444
+ | **[System Architecture](./docs/ARCHITECTURE.md)** | Security | Trust boundaries between MCP, SDK, API, and chain. |
445
+ | **[Tools Reference](./docs/TOOLS.md)** | Reference | Every `veya_*` tool, args, and auth requirements. |
446
+ | **[Verification Guide](./docs/VERIFICATION.md)** | Audit | How to prove a commitment via MCP + explorer. |
447
+ | **[Deployment Guide](./docs/DEPLOYMENT.md)** | Operations | nginx, env, systemd, TLS for `mcp.veyanet.tech`. |
448
+ | **[Configuration Reference](./docs/CONFIGURATION.md)** | Config | Full environment variable cascade and defaults. |
449
+ | **[HTTP Transport](./docs/TRANSPORT.md)** | Protocol | Streamable HTTP, sessions, CORS, Accept headers. |
450
+ | **[Authentication & Writes](./docs/AUTHENTICATION.md)** | Security | Bearer model, key custody, fail-closed writes. |
451
+ | **[SDK Relationship](./docs/SDK_BRIDGE.md)** | Integration | What MCP calls in `@veyanet/sdk` and what it does not. |
452
+ | **[Changelog](./CHANGELOG.md)** | History | Package version history. |
453
+ | **[Security Policy](./SECURITY.md)** | Security | Disclosure and secrets hygiene. |
454
+
455
+ ---
456
+
457
+ ## ❓ Frequently Asked Questions (FAQ)
458
+
459
+ ### 1. Do I need an API key to try VEYA MCP?
460
+ **No** for public tools (`veya_describe`, `veya_ping_chain`, `veya_hash_blake3`, `veya_verify_transaction`, `veya_api_health`). Write tools require the server operator to enable keys and the client to send `Authorization: Bearer <MCP_API_KEY>`.
461
+
462
+ ### 2. Does the MCP store or transmit my private keys to clients?
463
+ **No.** Relayer / deployer keys stay in server process memory for write tools only. They are never returned in tool payloads or `/health`. `MCP_API_KEY` is a shared Bearer secret for authorized writers — treat it like a production password.
464
+
465
+ ### 3. Is Veya.sol an ERC-20 token?
466
+ **No.** `Veya.sol` is a protocol contract for environments, agents, commitments, spending limits (wei), nullifiers, and attestations. It does not implement ERC-20.
467
+
468
+ ### 4. Is sealed execution FHE or hardware TEE?
469
+ **No.** Product honesty is **AES-256-GCM** sealed-node cryptography. Not live FHE/TFHE (later phase). Not Intel SGX / AWS Nitro as the product path.
470
+
471
+ ### 5. How is MCP different from `@veyanet/sdk`?
472
+ The SDK is a TypeScript library you import. MCP is a network service that exposes selected SDK capabilities as MCP tools over Streamable HTTP so agents can paste a URL.
473
+
474
+ ### 6. Where is the stdio MCP?
475
+ Local operator stdio lives at `veya-anchor/packages/mcp/`. Public Claude / Cursor users should use `https://mcp.veyanet.tech/mcp`.
476
+
477
+ ### 7. What happens if Robinhood RPC is down?
478
+ `veya_ping_chain` and verify tools fail with transport / RPC errors. `/health` can still report the MCP process as up while chain tools fail — operators should monitor both.
479
+
480
+ ### 8. Can I point this server at another chain id?
481
+ Only if you change `ROBINHOOD_CHAIN_ID`, RPC, explorer, and contract together. SDK write guards will reject chain id mismatch. Mainnet is not a VEYA settlement claim until Phase 3.
482
+
483
+ ---
484
+
485
+ ## 🤝 Contributing & Security Guidelines
486
+
487
+ ### Contribution Standards
488
+ We welcome contributions to `@veyanet/mcp`. Pull requests must preserve security integrity:
489
+ * **Fail-Closed Writes**: Do not register on-chain tools without both API key and relayer key; do not accept writes without Bearer match.
490
+ * **Honesty Enforcement**: Do not add tool copy that claims FHE, mainnet settlement, ERC-20, or invented quorum.
491
+ * **Secret Hygiene**: Reject changes that log `MCP_API_KEY`, relayer keys, or dump `.env` into docs.
492
+ * **SDK Boundary**: Prefer calling `@veyanet/sdk` over re-implementing hashing, verify, or `EvmAnchor` inside tool handlers.
493
+
494
+ ### Vulnerability Disclosure Policy
495
+ If you discover a security vulnerability, **do not file a public GitHub issue**.
496
+ Submit findings confidentially to **security@veyanet.tech**. See our [Security Policy](./SECURITY.md) for full details.
497
+
498
+ ---
499
+
500
+ ## 📄 License
501
+
502
+ This package is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for legal details.
package/SECURITY.md ADDED
@@ -0,0 +1,72 @@
1
+ <div align="center">
2
+
3
+ # VEYA MCP | Security Policy
4
+
5
+ **Coordinated disclosure for `@veyanet/mcp` on Robinhood Chain.**
6
+
7
+ **[README](./README.md)** • **[Authentication](./docs/AUTHENTICATION.md)** • **[Architecture](./docs/ARCHITECTURE.md)** • **[SDK Security](../sdk/SECURITY.md)**
8
+
9
+ </div>
10
+
11
+ ---
12
+
13
+ ## Supported versions
14
+
15
+ | Version | Supported |
16
+ |---------|-----------|
17
+ | 1.0.x | Yes |
18
+
19
+ ---
20
+
21
+ ## Secrets that must never be published
22
+
23
+ | Secret | Storage |
24
+ |--------|---------|
25
+ | `.env` | Server only (gitignored) |
26
+ | `MCP_API_KEY` | Server env / secret manager |
27
+ | `VEYA_RELAYER_PRIVATE_KEY` | Server env / secret manager |
28
+ | `VEYA_DEPLOYER_PRIVATE_KEY` | Server env / secret manager |
29
+
30
+ `.env.example` is the only environment template that belongs in git. It must not contain real keys.
31
+
32
+ ---
33
+
34
+ ## In-scope vulnerability classes
35
+
36
+ * Bypass of Bearer write gate (unauthenticated `storeCommitment` / `attestExecution` / `registerEnvironment`)
37
+ * Leakage of relayer private key or `MCP_API_KEY` via tool output, logs, or `/health`
38
+ * CORS misconfiguration that exfiltrates credentialed browser sessions (if any)
39
+ * Chain settlement against a mismatched chain id when writes are enabled
40
+ * Honesty violations that cause clients to believe FHE / mainnet / ERC-20 are live
41
+
42
+ ## Out of scope (report to the right component)
43
+
44
+ * Product API JWT / guest auth bugs → backend
45
+ * SDK cryptographic implementation bugs → `@veyanet/sdk` (still welcome via the same email; identify the package)
46
+ * Robinhood Chain infrastructure outages
47
+
48
+ ---
49
+
50
+ ## Reporting a vulnerability
51
+
52
+ Do not open public GitHub issues for security vulnerabilities.
53
+
54
+ Report privately to **security@veyanet.tech**.
55
+
56
+ Include:
57
+ * Summary and impact
58
+ * Component (`@veyanet/mcp` transport, auth, specific tool)
59
+ * Reproduction against `mcp.veyanet.tech` or a local build
60
+ * Node version and whether writes were enabled
61
+
62
+ Acknowledgment target: 72 hours. Coordinated disclosure before public detail appears in [CHANGELOG.md](./CHANGELOG.md).
63
+
64
+ ---
65
+
66
+ ## Operator hardening checklist
67
+
68
+ * Prefer read-only public MCP; private instance for writes
69
+ * `chmod 600` on `.env`
70
+ * Forward `Authorization` through TLS proxy
71
+ * Monitor explorer for unexpected relayer txs
72
+ * Rotate Bearer and relayer key on suspicion
Binary file
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node