@peac/mcp-server 0.10.13 → 0.11.2
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 +109 -15
- package/dist/cli.cjs +634 -27
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.ts +5 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.mjs +634 -27
- package/dist/cli.mjs.map +1 -1
- package/dist/http-transport.d.ts +65 -0
- package/dist/http-transport.d.ts.map +1 -0
- package/dist/index.cjs +53 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +53 -6
- package/dist/index.mjs.map +1 -1
- package/dist/infra/constants.d.ts +7 -1
- package/dist/infra/constants.d.ts.map +1 -1
- package/dist/infra/path-safety.d.ts +3 -1
- package/dist/infra/path-safety.d.ts.map +1 -1
- package/dist/infra/policy.d.ts +9 -95
- package/dist/infra/policy.d.ts.map +1 -1
- package/dist/schemas/bundle.d.ts +4 -48
- package/dist/schemas/bundle.d.ts.map +1 -1
- package/dist/schemas/decode.d.ts +3 -33
- package/dist/schemas/decode.d.ts.map +1 -1
- package/dist/schemas/inspect.d.ts +4 -68
- package/dist/schemas/inspect.d.ts.map +1 -1
- package/dist/schemas/issue.d.ts +8 -89
- package/dist/schemas/issue.d.ts.map +1 -1
- package/dist/schemas/verify.d.ts +4 -66
- package/dist/schemas/verify.d.ts.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/session-manager.d.ts +59 -0
- package/dist/session-manager.d.ts.map +1 -0
- package/package.json +10 -6
- package/server.json +23 -0
- package/smithery.yaml +36 -0
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)
|
|
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)
|
|
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
|
|
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
|
|
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>
|
|
147
|
-
--issuer-id <uri>
|
|
148
|
-
--bundle-dir <path>
|
|
149
|
-
--policy <path>
|
|
150
|
-
--jwks-file <path>
|
|
151
|
-
|
|
152
|
-
|
|
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.
|
|
238
|
+
version: '0.11.0',
|
|
203
239
|
policyHash,
|
|
204
240
|
protocolVersion: '2025-11-25',
|
|
205
241
|
},
|
|
@@ -212,17 +248,75 @@ if (result.structured.ok) {
|
|
|
212
248
|
|
|
213
249
|
## MCP SDK Compatibility
|
|
214
250
|
|
|
215
|
-
This package pins `@modelcontextprotocol/sdk`
|
|
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
|
|
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)
|
|
226
320
|
|
|
227
321
|
## License
|
|
228
322
|
|