@peac/mcp-server 0.10.13 → 0.11.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/.mcp.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "mcpServers": {
3
+ "peac": {
4
+ "command": "npx",
5
+ "args": ["-y", "@peac/mcp-server"],
6
+ "env": {}
7
+ }
8
+ }
9
+ }
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @peac/mcp-server
2
2
 
3
- Verify, issue, and bundle PEAC receipts in any MCP client (Claude Desktop, Cursor, Windsurf) -- locally, offline, no API keys.
3
+ Verify, issue, and bundle PEAC receipts in any MCP client (Claude Desktop, Cursor, Windsurf): locally, offline, no API keys.
4
4
 
5
5
  ## Quick Start
6
6
 
@@ -117,13 +117,13 @@ Note: stdout is reserved for JSON-RPC messages. All diagnostics, banners, and er
117
117
 
118
118
  ## Two Operating Modes
119
119
 
120
- **Pure mode** (default) -- verify, inspect, and decode receipts anywhere. No keys, no filesystem writes, no configuration needed. Safe for any environment.
120
+ **Pure mode** (default): verify, inspect, and decode receipts anywhere. No keys, no filesystem writes, no configuration needed. Safe for any environment.
121
121
 
122
122
  ```bash
123
123
  npx -y @peac/mcp-server
124
124
  ```
125
125
 
126
- **Issuer mode** -- additionally issue receipts and create signed evidence bundles. Requires explicit operator opt-in via CLI flags. Privileged tools are only visible and callable when their prerequisites are configured:
126
+ **Issuer mode**: additionally issue receipts and create signed evidence bundles. Requires explicit operator opt-in via CLI flags. Privileged tools are only visible and callable when their prerequisites are configured:
127
127
 
128
128
  - `--issuer-key` + `--issuer-id` enables `peac_issue`
129
129
  - `--bundle-dir` additionally enables `peac_create_bundle`
@@ -135,7 +135,36 @@ npx -y @peac/mcp-server \
135
135
  --bundle-dir ./bundles
136
136
  ```
137
137
 
138
- Evidence bundles are self-contained directories with canonical manifests (sorted keys, SHA-256 receipt hashes, content-addressable `bundle_id`) and signed provenance (`manifest.jws`). The `bundle_id` is deterministic -- same receipts and policy always produce the same ID regardless of when the bundle is created. Manifest content includes `created_at`, so the signature differs across runs. Bundles can be verified offline, diffed, cached, and used for audits, disputes, or SOC 2 evidence collection.
138
+ Evidence bundles are self-contained directories with canonical manifests (sorted keys, SHA-256 receipt hashes, content-addressable `bundle_id`) and signed provenance (`manifest.jws`). The `bundle_id` is deterministic: same receipts and policy always produce the same ID regardless of when the bundle is created. Manifest content includes `created_at`, so the signature differs across runs. Bundles can be verified offline, diffed, cached, and used for audits, disputes, or SOC 2 evidence collection.
139
+
140
+ ## Transports
141
+
142
+ ### stdio (default)
143
+
144
+ Standard MCP transport for local/CLI usage. JSON-RPC over stdin/stdout.
145
+
146
+ ```bash
147
+ npx -y @peac/mcp-server
148
+ ```
149
+
150
+ ### Streamable HTTP (v0.11.0+)
151
+
152
+ Remote transport for network-accessible MCP servers. Session-isolated with per-session `McpServer` + transport pairs (CVE-2026-25536 defense).
153
+
154
+ ```bash
155
+ npx -y @peac/mcp-server --transport http --port 3000
156
+ ```
157
+
158
+ Endpoints:
159
+
160
+ - `POST /mcp`: JSON-RPC tool calls (requires `Mcp-Session-Id` after initialization)
161
+ - `DELETE /mcp`: terminate session
162
+ - `GET /health`: health check (no auth)
163
+ - `GET /.well-known/oauth-protected-resource[/<path>]`: RFC 9728 PRM (when configured)
164
+
165
+ Security defaults: localhost-only bind, CORS deny-all, 1MB request body limit, per-session + per-IP rate limiting (100 req/min), session TTL (30 min), max 100 concurrent sessions.
166
+
167
+ See [HTTP Transport Security](../../docs/security/HTTP-TRANSPORT-SECURITY.md) for the full security model.
139
168
 
140
169
  ## CLI Options
141
170
 
@@ -143,13 +172,20 @@ Evidence bundles are self-contained directories with canonical manifests (sorted
143
172
  peac-mcp-server [options]
144
173
 
145
174
  Options:
146
- --issuer-key <ref> Issuer signing key (env:VAR or file:/path to Ed25519 JWK)
147
- --issuer-id <uri> Issuer identifier URI (required with --issuer-key)
148
- --bundle-dir <path> Directory for evidence bundle output
149
- --policy <path> Policy configuration file (JSON)
150
- --jwks-file <path> JWKS file for verifier key resolution
151
- -V, --version Output version number
152
- -h, --help Display help
175
+ --issuer-key <ref> Issuer signing key (env:VAR or file:/path to Ed25519 JWK)
176
+ --issuer-id <uri> Issuer identifier URI (required with --issuer-key)
177
+ --bundle-dir <path> Directory for evidence bundle output
178
+ --policy <path> Policy configuration file (JSON)
179
+ --jwks-file <path> JWKS file for verifier key resolution
180
+ --transport <type> Transport: stdio (default) or http
181
+ --port <number> HTTP port (default: 3000, http only)
182
+ --host <address> HTTP bind address (default: 127.0.0.1)
183
+ --cors-origins <list> Allowed CORS origins (comma-separated)
184
+ --authorization-servers <l> OAuth authorization server URIs (enables PRM)
185
+ --public-url <url> Canonical public URL (required for PRM)
186
+ --trust-proxy <preset> Trust X-Forwarded-For (off/loopback/linklocal/private/all)
187
+ -V, --version Output version number
188
+ -h, --help Display help
153
189
  ```
154
190
 
155
191
  ## Policy Configuration
@@ -199,7 +235,7 @@ const result = await handleVerify({
199
235
  input: { jws: 'eyJ...', public_key_base64url: '...' },
200
236
  policy,
201
237
  context: {
202
- version: '0.10.13',
238
+ version: '0.11.0',
203
239
  policyHash,
204
240
  protocolVersion: '2025-11-25',
205
241
  },
@@ -212,17 +248,82 @@ if (result.structured.ok) {
212
248
 
213
249
  ## MCP SDK Compatibility
214
250
 
215
- This package pins `@modelcontextprotocol/sdk` with a tilde range (patch-only updates). The SDK and workspace may use different Zod versions; schemas are structurally compatible at runtime. If upgrading the SDK, verify tool registration still works by running `pnpm --filter @peac/mcp-server test`. See `package.json` for actual pinned versions.
251
+ This package pins `@modelcontextprotocol/sdk` at `~1.27.0` (>= 1.26.0 required for CVE-2026-25536 fix). The SDK peer dependency accepts Zod `^3.25 || ^4.0`; the workspace uses Zod 4. If upgrading the SDK, verify tool registration still works by running `pnpm --filter @peac/mcp-server test`. See `package.json` for actual pinned versions.
252
+
253
+ ## How to Verify a Receipt
254
+
255
+ 1. Add the MCP server to your agent (see Quick Start above).
256
+ 2. Provide the receipt JWS and a public key (base64url-encoded Ed25519).
257
+ 3. Call `peac_verify` and check the `ok` field in the response.
258
+
259
+ ```text
260
+ > "Verify this receipt: eyJhbGci... with public key MCowBQYDK2..."
261
+ ```
262
+
263
+ The tool returns structured content with `ok: true/false`, claim details, and the verification report.
264
+
265
+ ## How to Issue a Receipt
266
+
267
+ Issuance requires an Ed25519 signing key. Start the server with `--issuer-key` and `--issuer-id`:
268
+
269
+ ```bash
270
+ npx -y @peac/mcp-server --issuer-key env:PEAC_KEY --issuer-id https://your-service.example.com
271
+ ```
272
+
273
+ Then call `peac_issue` with the receipt claims (amount, currency, rail, reference, audience).
274
+
275
+ ## Use with Claude Desktop
276
+
277
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
278
+
279
+ ```json
280
+ {
281
+ "mcpServers": {
282
+ "peac": {
283
+ "command": "npx",
284
+ "args": ["-y", "@peac/mcp-server"]
285
+ }
286
+ }
287
+ }
288
+ ```
289
+
290
+ Restart Claude Desktop. The PEAC tools appear in the tool picker.
291
+
292
+ ## Use with Cursor
293
+
294
+ Add to `.cursor/mcp.json` at your project root:
295
+
296
+ ```json
297
+ {
298
+ "mcpServers": {
299
+ "peac": {
300
+ "command": "npx",
301
+ "args": ["-y", "@peac/mcp-server"]
302
+ }
303
+ }
304
+ }
305
+ ```
306
+
307
+ Restart Cursor. PEAC tools are available in chat.
216
308
 
217
309
  ## Architecture
218
310
 
219
311
  - **DD-51**: Pure handlers with no MCP SDK dependency
220
- - **DD-52**: No ambient key discovery -- explicit `--issuer-key` only
312
+ - **DD-52**: No ambient key discovery: explicit `--issuer-key` only
221
313
  - **DD-53**: Static policy loaded once at startup with SHA-256 hash
222
314
  - **DD-54**: Structured outputs (`structuredContent` + `text`) on every response
223
315
  - **DD-55**: No URLs resolved from tool inputs (SSRF prevention)
224
316
  - **DD-57**: Core modules (`handlers/`, `schemas/`, `infra/`) have zero MCP SDK imports
225
- - **DD-58**: Line-buffered stdout fence validates JSON-RPC 2.0 output
317
+ - **DD-58**: Line-buffered stdout fence validates JSON-RPC 2.0 output (stdio only)
318
+ - **DD-119**: Streamable HTTP as additive remote transport (session-isolated)
319
+ - **DD-123**: HTTP security boundaries (CORS, rate limiting, Origin/Host validation)
320
+
321
+ ## Links
322
+
323
+ - Protocol: [peacprotocol.org](https://www.peacprotocol.org)
324
+ - GitHub: [peacprotocol/peac](https://github.com/peacprotocol/peac)
325
+ - npm: [@peac/mcp-server](https://www.npmjs.com/package/@peac/mcp-server)
326
+ - Built by [Originary](https://www.originary.xyz)
226
327
 
227
328
  ## License
228
329