@crediolabs/policy-builder-mcp 0.1.0 → 0.1.1
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 +70 -0
- package/package.json +4 -3
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# @crediolabs/policy-builder-mcp
|
|
2
|
+
|
|
3
|
+
MCP server exposing the OpenZeppelin Accounts Policy Builder core over stdio and
|
|
4
|
+
Streamable HTTP. It wraps [`@crediolabs/policy-synth`](https://www.npmjs.com/package/@crediolabs/policy-synth)
|
|
5
|
+
so an agent can record a Soroban transaction and synthesise the minimal policy
|
|
6
|
+
that permits exactly that flow. MIT-licensed.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install @crediolabs/policy-builder-mcp
|
|
12
|
+
# or run without installing:
|
|
13
|
+
npx @crediolabs/policy-builder-mcp
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Run
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
policy-builder-mcp # stdio transport (default; Claude Desktop / local agents)
|
|
20
|
+
policy-builder-mcp --http # Streamable HTTP transport on localhost
|
|
21
|
+
policy-builder-mcp --http-port N # override the HTTP port (default 3001)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Use with an MCP client (e.g. Claude Desktop)
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"mcpServers": {
|
|
29
|
+
"policy-builder": {
|
|
30
|
+
"command": "npx",
|
|
31
|
+
"args": ["-y", "@crediolabs/policy-builder-mcp"]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Tools
|
|
38
|
+
|
|
39
|
+
- **`record_transaction`** — decode a Soroban transaction (on-chain `hash` **or**
|
|
40
|
+
base64 envelope `xdr`, plus `network`) into a `RecordedTransaction`.
|
|
41
|
+
- **`synthesize_policy`** — synthesise a proposed policy from either a
|
|
42
|
+
deterministic mandate (`source: "mandate"`) or a recording
|
|
43
|
+
(`source: "recording"`); the `source` field selects the front-end.
|
|
44
|
+
|
|
45
|
+
Each tool returns the core's structured result. On invalid input it returns a
|
|
46
|
+
machine-readable `ToolError` (never an uncaught throw), so the agent keeps a
|
|
47
|
+
usable, actionable payload.
|
|
48
|
+
|
|
49
|
+
## Programmatic use
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import { createMcpServer, startStdioServer, startHttpServer } from '@crediolabs/policy-builder-mcp'
|
|
53
|
+
|
|
54
|
+
await startStdioServer() // or: await startHttpServer({ port: 3001 })
|
|
55
|
+
|
|
56
|
+
// or wire the server into your own transport:
|
|
57
|
+
const server = createMcpServer()
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The server is stateless: a fresh instance is built per transport, and nothing
|
|
61
|
+
caches, queues, or holds key material.
|
|
62
|
+
|
|
63
|
+
## Status
|
|
64
|
+
|
|
65
|
+
The `record_transaction` and `synthesize_policy` tools are implemented and
|
|
66
|
+
test-covered. Install, on-chain verify, and simulate are later phases.
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
MIT.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crediolabs/policy-builder-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "MCP server exposing the OZ policy-synth core (record_transaction + synthesize_policy) over stdio and Streamable HTTP transports.",
|
|
6
6
|
"type": "module",
|
|
@@ -12,10 +12,11 @@
|
|
|
12
12
|
"bun": "./src/index.ts",
|
|
13
13
|
"import": "./dist/src/index.js",
|
|
14
14
|
"default": "./dist/src/index.js"
|
|
15
|
-
}
|
|
15
|
+
},
|
|
16
|
+
"./package.json": "./package.json"
|
|
16
17
|
},
|
|
17
18
|
"bin": {
|
|
18
|
-
"policy-builder-mcp": "
|
|
19
|
+
"policy-builder-mcp": "dist/bin/server.js"
|
|
19
20
|
},
|
|
20
21
|
"files": [
|
|
21
22
|
"dist",
|