@verusidx/identity-mcp 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 VerusIDX Contributors
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,93 @@
1
+ # @verusidx/identity-mcp
2
+
3
+ MCP server for creating, managing, querying, and signing with VerusIDs. Covers the full identity lifecycle — registration, updates, revocation, recovery, timelocks — plus VDXF key resolution and cryptographic signing/verification.
4
+
5
+ ## Setup
6
+
7
+ **Prerequisite:** `@verusidx/chain-mcp` must be configured and `refresh_chains` called at least once so the chain registry exists.
8
+
9
+ Add to your MCP client config (e.g., Claude Code `claude_desktop_config.json`):
10
+
11
+ ```json
12
+ {
13
+ "mcpServers": {
14
+ "verusidx-identity": {
15
+ "command": "npx",
16
+ "args": ["@verusidx/identity-mcp"],
17
+ "env": {}
18
+ }
19
+ }
20
+ }
21
+ ```
22
+
23
+ **Alternative: local install.** If you prefer a pinned version or offline use, install into a project directory with `npm install @verusidx/identity-mcp` (or `pnpm add` / `yarn add`) and point your config at the local path instead of using `npx`.
24
+
25
+ ### Environment Variables
26
+
27
+ | Variable | Default | Description |
28
+ |---|---|---|
29
+ | `VERUSIDX_READ_ONLY` | `false` | Set to `true` to disable write tools. Read tools and signing tools (`signdata`, `verifysignature`) remain available. |
30
+ | `VERUSIDX_AUDIT_LOG` | `true` | Set to `false` to disable audit logging of write operations. |
31
+ | `VERUSIDX_AUDIT_DIR` | OS default | Custom directory for audit log files. |
32
+
33
+ ### Read-Only Mode
34
+
35
+ Set `VERUSIDX_READ_ONLY=true` to disable write tools. In read-only mode, 7 tools remain available:
36
+
37
+ - All read tools (`getidentity`, `getidentitycontent`, `getidentityhistory`, `getvdxfid`, `listidentities`)
38
+ - Signing tools (`signdata`, `verifysignature`) — signing reads the private key but does not spend funds or change blockchain/wallet state
39
+
40
+ Write tools (`registernamecommitment`, `registeridentity`, `updateidentity`, `revokeidentity`, `recoveridentity`, `setidentitytimelock`) are not registered and won't appear in the tool list.
41
+
42
+ You can set read-only mode independently per MCP server. For example, keep identity-mcp read-write while running send-mcp in read-only mode.
43
+
44
+ ## Tools
45
+
46
+ ### Always available (including read-only mode)
47
+
48
+ | Tool | Description |
49
+ |---|---|
50
+ | `getidentity` | Look up a VerusID by name or i-address — current state, authorities, content, wallet relationship |
51
+ | `getidentitycontent` | Get identity content/data with optional VDXF key filter and height range (cumulative) |
52
+ | `getidentityhistory` | Full revision history — one snapshot per update transaction |
53
+ | `getvdxfid` | Resolve a VDXF URI to its on-chain i-address, with optional key/hash/index binding |
54
+ | `listidentities` | List wallet's VerusIDs — spendable, signable, and/or watch-only |
55
+ | `signdata` | Sign data with a VerusID or t-address (message, file, hex, base64, hash, or MMR) |
56
+ | `verifysignature` | Verify a signature produced by `signdata` |
57
+
58
+ ### Write tools (disabled in read-only mode)
59
+
60
+ | Tool | Description |
61
+ |---|---|
62
+ | `registernamecommitment` | Step 1 of ID registration — create a name commitment transaction |
63
+ | `registeridentity` | Step 2 of ID registration — register using a confirmed commitment |
64
+ | `updateidentity` | Update identity fields (addresses, content, authorities) |
65
+ | `revokeidentity` | Revoke an identity (safety mechanism for key compromise) |
66
+ | `recoveridentity` | Recover a revoked/compromised identity with new keys |
67
+ | `setidentitytimelock` | Set or modify a spending timelock on an identity |
68
+
69
+ ## Identity Registration (Two-Step)
70
+
71
+ Registering a new VerusID is a two-step process:
72
+
73
+ 1. **`registernamecommitment`** — creates a commitment that reserves the name without revealing it (prevents front-running). The commitment data is automatically saved to `~/.verusidx/commitments/<chain>/<name>.json`.
74
+
75
+ 2. **Wait 1 block** for the commitment to confirm.
76
+
77
+ 3. **`registeridentity`** — registers the identity using the confirmed commitment. On success, the saved commitment file is cleaned up.
78
+
79
+ The commitment file persists across conversations. If a session ends between steps 1 and 2, the next session can pick up where it left off.
80
+
81
+ ## Timelock Safety
82
+
83
+ The `updateidentity`, `registeridentity`, and `recoveridentity` tools warn that `timelock` must only be set to `0` in the identity definition. Setting `timelock` to any other value can lock the identity — potentially making it unspendable for an extremely long time or permanently. Use `setidentitytimelock` instead, which provides safe `unlockatblock` and `setunlockdelay` controls.
84
+
85
+ ## Audit Logging
86
+
87
+ All write operations are logged to date-stamped JSONL files in the audit directory. Each entry records the tool name, chain, parameters, result, and success status. Logs are append-only with `0600` permissions.
88
+
89
+ ## Requirements
90
+
91
+ - Node.js >= 18.0.0
92
+ - `@verusidx/chain-mcp` installed and `refresh_chains` called (chain registry must exist)
93
+ - At least one Verus daemon running for RPC tools
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/build/index.js ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import { registerTools } from './tools.js';
5
+ const server = new McpServer({
6
+ name: 'verusidx-identity-mcp',
7
+ version: '0.1.0',
8
+ });
9
+ registerTools(server);
10
+ const transport = new StdioServerTransport();
11
+ await server.connect(transport);
12
+ process.on('SIGINT', async () => {
13
+ await server.close();
14
+ process.exit(0);
15
+ });
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,uBAAuB;IAC7B,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,aAAa,CAAC,MAAM,CAAC,CAAC;AAEtB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAEhC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerTools(server: McpServer): void;
3
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmFzE,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAojBrD"}
package/build/tools.js ADDED
@@ -0,0 +1,571 @@
1
+ import { z } from 'zod';
2
+ import { mkdirSync, writeFileSync, readFileSync, unlinkSync, readdirSync, rmdirSync } from 'node:fs';
3
+ import { join, dirname } from 'node:path';
4
+ import { rpcCall, auditLog, isReadOnly, assertWriteEnabled, VerusError, getCommitmentsDir, } from '@verusidx/shared';
5
+ // ---------------------------------------------------------------------------
6
+ // Response helpers
7
+ // ---------------------------------------------------------------------------
8
+ function ok(data) {
9
+ return {
10
+ content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
11
+ };
12
+ }
13
+ function fail(category, message) {
14
+ return {
15
+ content: [{ type: 'text', text: JSON.stringify({ error: category, message }, null, 2) }],
16
+ isError: true,
17
+ };
18
+ }
19
+ function handleError(err) {
20
+ if (err instanceof VerusError) {
21
+ return fail(err.category, err.message);
22
+ }
23
+ return fail('INTERNAL_ERROR', err instanceof Error ? err.message : 'Unknown error');
24
+ }
25
+ // ---------------------------------------------------------------------------
26
+ // Commitment file helpers
27
+ // ---------------------------------------------------------------------------
28
+ function getCommitmentPath(chain, name) {
29
+ return join(getCommitmentsDir(), chain, `${name}.json`);
30
+ }
31
+ function saveCommitment(chain, name, data) {
32
+ const filePath = getCommitmentPath(chain, name);
33
+ mkdirSync(dirname(filePath), { recursive: true });
34
+ writeFileSync(filePath, JSON.stringify({ ...data, savedAt: new Date().toISOString() }, null, 2), { mode: 0o600 });
35
+ }
36
+ function loadCommitment(chain, name) {
37
+ const filePath = getCommitmentPath(chain, name);
38
+ try {
39
+ const raw = readFileSync(filePath, 'utf-8');
40
+ return JSON.parse(raw);
41
+ }
42
+ catch {
43
+ return null;
44
+ }
45
+ }
46
+ function deleteCommitment(chain, name) {
47
+ const filePath = getCommitmentPath(chain, name);
48
+ try {
49
+ unlinkSync(filePath);
50
+ }
51
+ catch { /* ignore */ }
52
+ // Clean up empty chain directory
53
+ const chainDir = dirname(filePath);
54
+ try {
55
+ const remaining = readdirSync(chainDir);
56
+ if (remaining.length === 0)
57
+ rmdirSync(chainDir);
58
+ }
59
+ catch { /* ignore */ }
60
+ // Clean up empty commitments directory
61
+ const commitmentsDir = getCommitmentsDir();
62
+ try {
63
+ const remaining = readdirSync(commitmentsDir);
64
+ if (remaining.length === 0)
65
+ rmdirSync(commitmentsDir);
66
+ }
67
+ catch { /* ignore */ }
68
+ }
69
+ const SERVER_NAME = 'verusidx-identity-mcp';
70
+ // ---------------------------------------------------------------------------
71
+ // Tool registration
72
+ // ---------------------------------------------------------------------------
73
+ export function registerTools(server) {
74
+ // ------ Read-only tools (always registered) ------
75
+ server.tool('getidentity', 'Look up a VerusID by name or i-address. Returns the identity\'s current state including primary addresses, signing authorities, content data (contentmultimap), revocation/recovery authorities, and wallet relationship (canspendfor/cansignfor). Optionally retrieve the identity as it existed at a specific block height. Use this to check if an identity exists, inspect its configuration, or verify wallet authority before performing write operations.', {
76
+ chain: z.string().describe('Chain to query (e.g., "VRSC", "vrsctest")'),
77
+ identity: z.string().describe('VerusID name (e.g., "alice@") or i-address'),
78
+ height: z.number().optional().describe('Return identity as of this block height. Default: current height. Pass -1 to include mempool.'),
79
+ txproof: z.boolean().optional().describe('If true, returns a proof of the identity. Default: false.'),
80
+ txproofheight: z.number().optional().describe('Height from which to generate the proof. Default: same as height.'),
81
+ }, async ({ chain, identity, height, txproof, txproofheight }) => {
82
+ try {
83
+ const params = [identity];
84
+ if (height !== undefined || txproof !== undefined || txproofheight !== undefined) {
85
+ params.push(height ?? 0);
86
+ }
87
+ if (txproof !== undefined || txproofheight !== undefined) {
88
+ params.push(txproof ?? false);
89
+ }
90
+ if (txproofheight !== undefined) {
91
+ params.push(txproofheight);
92
+ }
93
+ const result = await rpcCall(chain, 'getidentity', params);
94
+ return ok(result);
95
+ }
96
+ catch (err) {
97
+ return handleError(err);
98
+ }
99
+ });
100
+ server.tool('getidentitycontent', 'Get identity content/data with optional VDXF key filter and height range. Returns the cumulative content state — all content across all updates within the specified range. Unlike getidentityhistory, this does not return per-revision snapshots. Use this to read structured data stored on an identity (profiles, timestamps, application data) without needing to process the full revision history.', {
101
+ chain: z.string().describe('Chain to query (e.g., "VRSC", "vrsctest")'),
102
+ identity: z.string().describe('VerusID name (e.g., "alice@") or i-address'),
103
+ heightstart: z.number().optional().describe('Only return content from this height forward (inclusive). Default: 0.'),
104
+ heightend: z.number().optional().describe('Only return content up to this height (inclusive). Default: 0 (max height). Pass -1 to include mempool.'),
105
+ txproofs: z.boolean().optional().describe('If true, returns proofs. Default: false.'),
106
+ txproofheight: z.number().optional().describe('Height from which to generate proofs.'),
107
+ vdxfkey: z.string().optional().describe('Filter to a specific VDXF key. The key is automatically bound to the identity and multimap key.'),
108
+ keepdeleted: z.boolean().optional().describe('If true, include deleted items. Default: false.'),
109
+ }, async ({ chain, identity, heightstart, heightend, txproofs, txproofheight, vdxfkey, keepdeleted }) => {
110
+ try {
111
+ // getidentitycontent identity heightstart heightend txproofs txproofheight vdxfkey keepdeleted
112
+ const params = [identity];
113
+ params.push(heightstart ?? 0);
114
+ params.push(heightend ?? 0);
115
+ params.push(txproofs ?? false);
116
+ params.push(txproofheight ?? 0);
117
+ if (vdxfkey !== undefined || keepdeleted !== undefined) {
118
+ params.push(vdxfkey ?? '');
119
+ }
120
+ if (keepdeleted !== undefined) {
121
+ params.push(keepdeleted);
122
+ }
123
+ const result = await rpcCall(chain, 'getidentitycontent', params);
124
+ return ok(result);
125
+ }
126
+ catch (err) {
127
+ return handleError(err);
128
+ }
129
+ });
130
+ server.tool('getidentityhistory', 'Get the full revision history of a VerusID. Returns an array of identity snapshots, one per update transaction. Each entry shows the identity state as it was set in that specific transaction, along with the block hash, height, and transaction details. Use this to audit changes to an identity over time — primary address changes (transfers), content updates, authority changes, etc. Note: each history entry\'s contentmultimap shows only the content set in that specific update, not the cumulative state.', {
131
+ chain: z.string().describe('Chain to query (e.g., "VRSC", "vrsctest")'),
132
+ identity: z.string().describe('VerusID name (e.g., "alice@") or i-address'),
133
+ heightstart: z.number().optional().describe('Only return history from this height forward (inclusive). Default: 0.'),
134
+ heightend: z.number().optional().describe('Only return history up to this height (inclusive). Default: 0 (max height). Pass -1 to include mempool.'),
135
+ txproofs: z.boolean().optional().describe('If true, returns proofs. Default: false.'),
136
+ txproofheight: z.number().optional().describe('Height from which to generate proofs.'),
137
+ }, async ({ chain, identity, heightstart, heightend, txproofs, txproofheight }) => {
138
+ try {
139
+ const params = [identity];
140
+ params.push(heightstart ?? 0);
141
+ params.push(heightend ?? 0);
142
+ params.push(txproofs ?? false);
143
+ if (txproofheight !== undefined) {
144
+ params.push(txproofheight);
145
+ }
146
+ const result = await rpcCall(chain, 'getidentityhistory', params);
147
+ return ok(result);
148
+ }
149
+ catch (err) {
150
+ return handleError(err);
151
+ }
152
+ });
153
+ server.tool('getvdxfid', 'Get the VDXF key ID from a URI string. Converts a human-readable VDXF URI (e.g., "vrsc::system.currency.export") into its on-chain i-address representation. Optionally combine with additional data (another VDXF key, a 256-bit hash, or an index number) to derive bound keys. Use this to resolve VDXF key names to i-addresses before querying getidentitycontent with a vdxfkey filter.', {
154
+ chain: z.string().describe('Chain to query (e.g., "VRSC", "vrsctest")'),
155
+ vdxfuri: z.string().describe('VDXF URI string (e.g., "vrsc::system.currency.export", "idname::userdefinedgroup.subgroup.name")'),
156
+ vdxfkey: z.string().optional().describe('VDXF key or i-address to combine via hash'),
157
+ uint256: z.string().optional().describe('256-bit hex hash to combine with the key'),
158
+ indexnum: z.number().optional().describe('Integer to combine with the key'),
159
+ }, async ({ chain, vdxfuri, vdxfkey, uint256, indexnum }) => {
160
+ try {
161
+ // getvdxfid "vdxfuri" '{"vdxfkey":..., "uint256":..., "indexnum":...}'
162
+ const params = [vdxfuri];
163
+ if (vdxfkey !== undefined || uint256 !== undefined || indexnum !== undefined) {
164
+ const bindObj = {};
165
+ if (vdxfkey !== undefined)
166
+ bindObj.vdxfkey = vdxfkey;
167
+ if (uint256 !== undefined)
168
+ bindObj.uint256 = uint256;
169
+ if (indexnum !== undefined)
170
+ bindObj.indexnum = indexnum;
171
+ params.push(bindObj);
172
+ }
173
+ const result = await rpcCall(chain, 'getvdxfid', params);
174
+ return ok(result);
175
+ }
176
+ catch (err) {
177
+ return handleError(err);
178
+ }
179
+ });
180
+ server.tool('listidentities', 'List VerusIDs in the local wallet. Returns all identities that this wallet can spend for, sign for, or watch. Use this to discover which identities are available before performing identity operations. By default includes identities we can spend for and sign for, but not watch-only.', {
181
+ chain: z.string().describe('Chain to query (e.g., "VRSC", "vrsctest")'),
182
+ includecanspend: z.boolean().optional().describe('Include identities we can spend/authorize for. Default: true.'),
183
+ includecansign: z.boolean().optional().describe('Include identities we can only sign for but not spend. Default: true.'),
184
+ includewatchonly: z.boolean().optional().describe('Include identities we can neither sign nor spend, but are watched or are co-signers. Default: false.'),
185
+ }, async ({ chain, includecanspend, includecansign, includewatchonly }) => {
186
+ try {
187
+ // listidentities (includecanspend) (includecansign) (includewatchonly)
188
+ const params = [];
189
+ if (includecanspend !== undefined || includecansign !== undefined || includewatchonly !== undefined) {
190
+ params.push(includecanspend ?? true);
191
+ }
192
+ if (includecansign !== undefined || includewatchonly !== undefined) {
193
+ params.push(includecansign ?? true);
194
+ }
195
+ if (includewatchonly !== undefined) {
196
+ params.push(includewatchonly);
197
+ }
198
+ const result = await rpcCall(chain, 'listidentities', params);
199
+ return ok(result);
200
+ }
201
+ catch (err) {
202
+ return handleError(err);
203
+ }
204
+ });
205
+ // ------ Signing tools (available in read-only mode) ------
206
+ server.tool('signdata', 'Sign data with a VerusID or transparent address. Generates a hash of the provided data and signs it. Supports multiple input modes (message, file, hex, base64, pre-computed hash) and hash algorithms (sha256, sha256D, blake2b, keccak256). Can sign a single piece of data or build a Merkle Mountain Range (MMR) over multiple items. For multi-sig identities, pass an existing partial signature to accumulate signatures. Available in read-only mode — signing does not spend funds or change blockchain/wallet state.', {
207
+ chain: z.string().describe('Chain to sign on (e.g., "VRSC", "vrsctest")'),
208
+ address: z.string().describe('VerusID name or t-address to sign with. A t-address produces a simple signature.'),
209
+ message: z.string().optional().describe('Text message to sign.'),
210
+ filename: z.string().optional().describe('File path to sign.'),
211
+ messagehex: z.string().optional().describe('Hex-encoded data to sign.'),
212
+ messagebase64: z.string().optional().describe('Base64-encoded data to sign.'),
213
+ datahash: z.string().optional().describe('Pre-computed 256-bit hex hash to sign directly.'),
214
+ mmrdata: z.array(z.record(z.unknown())).optional().describe('Array of data objects for MMR signing. Each element: {"filename" or "message" or "serializedhex" or "serializedbase64" or "vdxfdata" or "datahash": "value"}.'),
215
+ mmrsalt: z.array(z.string()).optional().describe('Array of salt strings to protect privacy of MMR leaf nodes.'),
216
+ mmrhashtype: z.string().optional().describe('Hash type for MMR: "sha256", "sha256D", "blake2b", "keccak256". Default: "blake2b".'),
217
+ prefixstring: z.string().optional().describe('Extra string hashed during signing — must be supplied for verification.'),
218
+ vdxfkeys: z.array(z.string()).optional().describe('Array of VDXF keys or i-addresses to bind to the signature.'),
219
+ vdxfkeynames: z.array(z.string()).optional().describe('Array of VDXF key names or friendly name IDs (no i-addresses).'),
220
+ boundhashes: z.array(z.string()).optional().describe('Array of hex hashes to bind to the signature.'),
221
+ hashtype: z.string().optional().describe('Hash algorithm: "sha256" (default), "sha256D", "blake2b", "keccak256".'),
222
+ signature: z.string().optional().describe('Existing base64 signature for multi-sig accumulation.'),
223
+ encrypttoaddress: z.string().optional().describe('Sapling address to encrypt data to.'),
224
+ createmmr: z.boolean().optional().describe('If true (or if multiple items are provided), returns MMR data and root signature.'),
225
+ }, async ({ chain, address, message, filename, messagehex, messagebase64, datahash, mmrdata, mmrsalt, mmrhashtype, prefixstring, vdxfkeys, vdxfkeynames, boundhashes, hashtype, signature, encrypttoaddress, createmmr }) => {
226
+ try {
227
+ // signdata builds a JSON object parameter
228
+ const sigObj = { address };
229
+ if (message !== undefined)
230
+ sigObj.message = message;
231
+ if (filename !== undefined)
232
+ sigObj.filename = filename;
233
+ if (messagehex !== undefined)
234
+ sigObj.messagehex = messagehex;
235
+ if (messagebase64 !== undefined)
236
+ sigObj.messagebase64 = messagebase64;
237
+ if (datahash !== undefined)
238
+ sigObj.datahash = datahash;
239
+ if (mmrdata !== undefined)
240
+ sigObj.mmrdata = mmrdata;
241
+ if (mmrsalt !== undefined)
242
+ sigObj.mmrsalt = mmrsalt;
243
+ if (mmrhashtype !== undefined)
244
+ sigObj.mmrhashtype = mmrhashtype;
245
+ if (prefixstring !== undefined)
246
+ sigObj.prefixstring = prefixstring;
247
+ if (vdxfkeys !== undefined)
248
+ sigObj.vdxfkeys = vdxfkeys;
249
+ if (vdxfkeynames !== undefined)
250
+ sigObj.vdxfkeynames = vdxfkeynames;
251
+ if (boundhashes !== undefined)
252
+ sigObj.boundhashes = boundhashes;
253
+ if (hashtype !== undefined)
254
+ sigObj.hashtype = hashtype;
255
+ if (signature !== undefined)
256
+ sigObj.signature = signature;
257
+ if (encrypttoaddress !== undefined)
258
+ sigObj.encrypttoaddress = encrypttoaddress;
259
+ if (createmmr !== undefined)
260
+ sigObj.createmmr = createmmr;
261
+ const result = await rpcCall(chain, 'signdata', [sigObj]);
262
+ return ok(result);
263
+ }
264
+ catch (err) {
265
+ return handleError(err);
266
+ }
267
+ });
268
+ server.tool('verifysignature', 'Verify a signature produced by signdata. Checks that the signature is valid for the given data and identity/address. By default, validates against the identity\'s keys at the block height stored in the signature — use checklatest to verify against the identity\'s current keys instead.', {
269
+ chain: z.string().describe('Chain to verify on (e.g., "VRSC", "vrsctest")'),
270
+ address: z.string().describe('VerusID name or t-address to verify against.'),
271
+ message: z.string().optional().describe('Text message that was signed.'),
272
+ filename: z.string().optional().describe('File path that was signed.'),
273
+ messagehex: z.string().optional().describe('Hex-encoded data that was signed.'),
274
+ messagebase64: z.string().optional().describe('Base64-encoded data that was signed.'),
275
+ datahash: z.string().optional().describe('Pre-computed 256-bit hex hash that was signed.'),
276
+ prefixstring: z.string().optional().describe('Prefix string used during signing (must match).'),
277
+ vdxfkeys: z.array(z.string()).optional().describe('VDXF keys bound during signing (must match).'),
278
+ vdxfkeynames: z.array(z.string()).optional().describe('VDXF key names bound during signing (must match).'),
279
+ boundhashes: z.array(z.string()).optional().describe('Hashes bound during signing (must match).'),
280
+ hashtype: z.string().optional().describe('Hash algorithm used during signing. Default: "sha256".'),
281
+ signature: z.string().describe('Base64-encoded signature to verify.'),
282
+ checklatest: z.boolean().optional().describe('If true, verify against the identity\'s current keys. Default: false (verify against keys at the signing height stored in the signature).'),
283
+ }, async ({ chain, address, message, filename, messagehex, messagebase64, datahash, prefixstring, vdxfkeys, vdxfkeynames, boundhashes, hashtype, signature, checklatest }) => {
284
+ try {
285
+ // verifysignature builds a JSON object parameter
286
+ // Daemon param spec uses "address" key (despite example showing "identity")
287
+ const verifyObj = { address, signature };
288
+ // Daemon bug: verifysignature hashes "message" differently than signdata,
289
+ // producing a different hash for the same string. Convert message to messagehex
290
+ // so the raw bytes are hashed identically to signdata.
291
+ if (message !== undefined)
292
+ verifyObj.messagehex = Buffer.from(message, 'utf8').toString('hex');
293
+ if (filename !== undefined)
294
+ verifyObj.filename = filename;
295
+ if (messagehex !== undefined)
296
+ verifyObj.messagehex = messagehex;
297
+ if (messagebase64 !== undefined)
298
+ verifyObj.messagebase64 = messagebase64;
299
+ if (datahash !== undefined)
300
+ verifyObj.datahash = datahash;
301
+ if (prefixstring !== undefined)
302
+ verifyObj.prefixstring = prefixstring;
303
+ if (vdxfkeys !== undefined)
304
+ verifyObj.vdxfkeys = vdxfkeys;
305
+ if (vdxfkeynames !== undefined)
306
+ verifyObj.vdxfkeynames = vdxfkeynames;
307
+ if (boundhashes !== undefined)
308
+ verifyObj.boundhashes = boundhashes;
309
+ if (hashtype !== undefined)
310
+ verifyObj.hashtype = hashtype;
311
+ if (checklatest !== undefined)
312
+ verifyObj.checklatest = checklatest;
313
+ const result = await rpcCall(chain, 'verifysignature', [verifyObj]);
314
+ return ok(result);
315
+ }
316
+ catch (err) {
317
+ return handleError(err);
318
+ }
319
+ });
320
+ // ------ Write tools (registered only when not read-only) ------
321
+ if (!isReadOnly()) {
322
+ server.tool('registernamecommitment', 'Step 1 of identity registration. Creates a name commitment transaction that reserves a name without revealing it. The commitment hides the name itself while ensuring miners cannot front-run the registration. After this tool succeeds, wait 1 block before calling registeridentity (step 2). The commitment data is saved to disk so it persists across conversations — if a session ends before registration, the next session can pick up the commitment. Names must not have leading, trailing, or multiple consecutive spaces and must not include: \\ / : * ? " < > | @', {
323
+ chain: z.string().describe('Chain to register on (e.g., "VRSC", "vrsctest")'),
324
+ name: z.string().describe('The unique name to commit to. Creating a commitment is not a registration — if the name already exists, the daemon will reject the transaction.'),
325
+ controladdress: z.string().describe('Address that will control this commitment. Must be present in the current wallet. This is not necessarily the address that will control the actual identity.'),
326
+ referralidentity: z.string().optional().describe('Friendly name or i-address of a referral identity, used to lower network cost of the ID.'),
327
+ parentnameorid: z.string().optional().describe('Parent name or currency i-address. Dictates issuance rules and pricing. Only for PBaaS sub-identities.'),
328
+ sourceoffunds: z.string().optional().describe('Address to use as source of funds. Default: transparent wildcard "*".'),
329
+ }, async ({ chain, name, controladdress, referralidentity, parentnameorid, sourceoffunds }) => {
330
+ try {
331
+ assertWriteEnabled();
332
+ // registernamecommitment "name" "controladdress" ("referralidentity") ("parentnameorid") ("sourceoffunds")
333
+ const params = [name, controladdress];
334
+ if (referralidentity !== undefined || parentnameorid !== undefined || sourceoffunds !== undefined) {
335
+ params.push(referralidentity ?? '');
336
+ }
337
+ if (parentnameorid !== undefined || sourceoffunds !== undefined) {
338
+ params.push(parentnameorid ?? '');
339
+ }
340
+ if (sourceoffunds !== undefined) {
341
+ params.push(sourceoffunds);
342
+ }
343
+ const result = await rpcCall(chain, 'registernamecommitment', params);
344
+ // Save commitment to disk for cross-session persistence
345
+ saveCommitment(chain, name, result);
346
+ auditLog({
347
+ server: SERVER_NAME,
348
+ tool: 'registernamecommitment',
349
+ chain,
350
+ params: { name, controladdress, referralidentity, parentnameorid },
351
+ result,
352
+ success: true,
353
+ });
354
+ return ok(result);
355
+ }
356
+ catch (err) {
357
+ return handleError(err);
358
+ }
359
+ });
360
+ server.tool('registeridentity', 'Step 2 of identity registration. Uses a confirmed name commitment to register the identity on-chain. The commitment must have been mined (wait 1 block after registernamecommitment). The tool checks for saved commitment data from a previous registernamecommitment call — if available, the agent does not need to pass the commitment details manually. On successful registration, the saved commitment file is cleaned up. IDENTITY DEFINITION: Keep it minimal — only include fields you are explicitly setting to non-default values. Omit revocationauthority/recoveryauthority to default to self. TIMELOCK: Do NOT include timelock in the identity JSON unless you deliberately intend to set an absolute block height lock. Omitting timelock defaults to 0 (unlocked). To configure timelocks safely after registration, use setidentitytimelock which provides setunlockdelay and unlockatblock controls. Setting a timelock value here creates an absolute block height lock that CANNOT be removed by updateidentity — only by revoke+recover. Omit privateaddress unless explicitly assigning one. SAFETY: NEVER set revocationauthority to another identity while leaving recoveryauthority as self — if the identity is revoked by the external authority, it cannot recover itself (recovery requires the recovery authority to act, and a revoked identity cannot authorize its own recovery). This bricks the identity. If delegating revocation, always also delegate recovery to a different identity. POSITIONAL PARAMS: The daemon RPC is positional: registeridentity jsonidregistration (returntx) (feeoffer) (sourceoffunds). If passing sourceoffunds, you must also fill returntx and feeoffer. FEE DISCOVERY: Call getcurrency (chain-mcp) on the parent currency to find idregistrationfees. For basket currencies, if idimportfees is a satoshi-scale value it encodes a reserve currency index: 0.00000000 = first reserve (index 0), 0.00000001 = second reserve (index 1), etc. The idregistrationfees amount is then denominated in that reserve currency — calculate how much of the basket currency equals that amount at current conversion prices. Example: idregistrationfees=15 + idimportfees=0.00000001 (index 1=USD) means 15 USD worth of the basket currency. Default idimportfees (e.g., 0.02) means the fee is in the basket currency itself, but defaults may differ per chain — check getcurrency to verify. FEE SHORTCUT: If unsure of the exact fee (especially with reserve-denominated fees and referral discounts), pass feeoffer=0.00000001 — the daemon will reject and return the minimum required fee in the error message, then retry with that amount.', {
361
+ chain: z.string().describe('Chain to register on (e.g., "VRSC", "vrsctest")'),
362
+ jsonidregistration: z.record(z.unknown()).describe('Registration object containing: txid (from registernamecommitment), namereservation {name, salt, referral}, and identity definition {name, parent, primaryaddresses, minimumsignatures}. Only include revocationauthority/recoveryauthority if delegating to a DIFFERENT identity (defaults to self) — accepts friendly name (e.g., "alice@") or i-address. TIMELOCK: Do NOT include timelock unless you deliberately intend to set an absolute block height lock. An absolute lock CANNOT be removed by updateidentity — only by revoke+recover. If setting a timelock, ensure revocationauthority and recoveryauthority are set to identities that can perform the revoke+recover to remove it. Omit timelock to default to 0 (unlocked). Use setidentitytimelock after registration for safe timelock configuration. Omit privateaddress unless explicitly assigning one.'),
363
+ returntx: z.boolean().optional().describe('If true, return the signed transaction hex instead of broadcasting. Default: false.'),
364
+ feeoffer: z.number().optional().describe('Amount to offer miner/staker for the registration fee. Default: standard price.'),
365
+ sourceoffunds: z.string().optional().describe('Address to use as source of funds. Default: transparent wildcard "*".'),
366
+ }, async ({ chain, jsonidregistration, returntx, feeoffer, sourceoffunds }) => {
367
+ try {
368
+ assertWriteEnabled();
369
+ // registeridentity jsonidregistration (returntx) (feeoffer) (sourceoffunds)
370
+ const params = [jsonidregistration];
371
+ if (returntx !== undefined || feeoffer !== undefined || sourceoffunds !== undefined) {
372
+ params.push(returntx ?? false);
373
+ }
374
+ if (feeoffer !== undefined || sourceoffunds !== undefined) {
375
+ params.push(feeoffer ?? 0);
376
+ }
377
+ if (sourceoffunds !== undefined) {
378
+ params.push(sourceoffunds);
379
+ }
380
+ const result = await rpcCall(chain, 'registeridentity', params);
381
+ // Clean up commitment file on success
382
+ const idName = jsonidregistration.namereservation
383
+ ? jsonidregistration.namereservation.name
384
+ : undefined;
385
+ if (idName) {
386
+ deleteCommitment(chain, idName);
387
+ }
388
+ auditLog({
389
+ server: SERVER_NAME,
390
+ tool: 'registeridentity',
391
+ chain,
392
+ params: { name: idName, returntx },
393
+ result,
394
+ success: true,
395
+ });
396
+ return ok(result);
397
+ }
398
+ catch (err) {
399
+ return handleError(err);
400
+ }
401
+ });
402
+ server.tool('updateidentity', 'Update an identity\'s fields — primary addresses, content, authorities, or any other mutable property. The wallet must hold authority to update (either primary authority, or token authority if tokenupdate is true). Pass the full identity definition with the desired changes. Fields not included revert to defaults — to preserve existing values, first read them with getidentity and include them in the update. Always include "parent" in the identity definition. PRIVATEADDRESS BEHAVIOR: Omit privateaddress entirely to preserve the existing one (carried over). Pass null to clear/remove it. Include a new zs1... address to change it. Empty string "" does NOT clear — daemon treats it the same as omitting. TIMELOCK: Do NOT include timelock in the identity JSON unless you deliberately intend to set an absolute block height lock. An absolute lock CANNOT be removed by updateidentity — only by revoke+recover. If setting a timelock, ensure revocationauthority and recoveryauthority are set to identities that can perform the revoke+recover to remove it. Omit timelock entirely to preserve the current value. Setting timelock to 0 is ONLY valid when there is no active timelock — it will be rejected if any timelock (delay or absolute) is currently set. Use setidentitytimelock for safe timelock configuration. SAFETY: NEVER set revocationauthority to another identity while leaving recoveryauthority as self — if revoked by the external authority, the identity cannot recover itself (a revoked identity cannot authorize its own recovery). This bricks the identity. If delegating revocation, always also delegate recovery to a different identity.', {
403
+ chain: z.string().describe('Chain to update on (e.g., "VRSC", "vrsctest")'),
404
+ jsonidentity: z.record(z.unknown()).describe('New identity definition. Must include "name" at minimum. Always include "parent" to ensure correct namespace resolution. revocationauthority/recoveryauthority accept friendly name (e.g., "alice@") or i-address.'),
405
+ returntx: z.boolean().optional().describe('If true, return signed transaction hex instead of broadcasting. Default: false.'),
406
+ tokenupdate: z.boolean().optional().describe('If true, use the tokenized ID control token for authority. Default: false.'),
407
+ feeoffer: z.number().optional().describe('Non-standard fee amount.'),
408
+ sourceoffunds: z.string().optional().describe('Address to source funds from, to preserve privacy.'),
409
+ }, async ({ chain, jsonidentity, returntx, tokenupdate, feeoffer, sourceoffunds }) => {
410
+ try {
411
+ assertWriteEnabled();
412
+ // updateidentity jsonidentity (returntx) (tokenupdate) (feeoffer) (sourceoffunds)
413
+ const params = [jsonidentity];
414
+ if (returntx !== undefined || tokenupdate !== undefined || feeoffer !== undefined || sourceoffunds !== undefined) {
415
+ params.push(returntx ?? false);
416
+ }
417
+ if (tokenupdate !== undefined || feeoffer !== undefined || sourceoffunds !== undefined) {
418
+ params.push(tokenupdate ?? false);
419
+ }
420
+ if (feeoffer !== undefined || sourceoffunds !== undefined) {
421
+ params.push(feeoffer ?? 0);
422
+ }
423
+ if (sourceoffunds !== undefined) {
424
+ params.push(sourceoffunds);
425
+ }
426
+ const result = await rpcCall(chain, 'updateidentity', params);
427
+ const idName = jsonidentity.name;
428
+ auditLog({
429
+ server: SERVER_NAME,
430
+ tool: 'updateidentity',
431
+ chain,
432
+ params: { name: idName, returntx, tokenupdate },
433
+ result,
434
+ success: true,
435
+ });
436
+ return ok(result);
437
+ }
438
+ catch (err) {
439
+ return handleError(err);
440
+ }
441
+ });
442
+ server.tool('revokeidentity', 'Revoke an identity, making it unable to spend funds or sign transactions. Only the revocation authority (or token revocation authority) can perform this action. A revoked identity can only be restored by the recovery authority using recoveridentity. This is a safety mechanism — use it if the identity\'s private keys are compromised.', {
443
+ chain: z.string().describe('Chain to revoke on (e.g., "VRSC", "vrsctest")'),
444
+ identity: z.string().describe('VerusID name (e.g., "alice@") or i-address to revoke'),
445
+ returntx: z.boolean().optional().describe('If true, return signed transaction hex instead of broadcasting. Default: false.'),
446
+ tokenrevoke: z.boolean().optional().describe('If true, use the tokenized ID control token to revoke. Default: false.'),
447
+ feeoffer: z.number().optional().describe('Non-standard fee amount.'),
448
+ sourceoffunds: z.string().optional().describe('Address to source funds from, to preserve privacy.'),
449
+ }, async ({ chain, identity, returntx, tokenrevoke, feeoffer, sourceoffunds }) => {
450
+ try {
451
+ assertWriteEnabled();
452
+ // revokeidentity "identity" (returntx) (tokenrevoke) (feeoffer) (sourceoffunds)
453
+ const params = [identity];
454
+ if (returntx !== undefined || tokenrevoke !== undefined || feeoffer !== undefined || sourceoffunds !== undefined) {
455
+ params.push(returntx ?? false);
456
+ }
457
+ if (tokenrevoke !== undefined || feeoffer !== undefined || sourceoffunds !== undefined) {
458
+ params.push(tokenrevoke ?? false);
459
+ }
460
+ if (feeoffer !== undefined || sourceoffunds !== undefined) {
461
+ params.push(feeoffer ?? 0);
462
+ }
463
+ if (sourceoffunds !== undefined) {
464
+ params.push(sourceoffunds);
465
+ }
466
+ const result = await rpcCall(chain, 'revokeidentity', params);
467
+ auditLog({
468
+ server: SERVER_NAME,
469
+ tool: 'revokeidentity',
470
+ chain,
471
+ params: { identity, returntx, tokenrevoke },
472
+ result,
473
+ success: true,
474
+ });
475
+ return ok(result);
476
+ }
477
+ catch (err) {
478
+ return handleError(err);
479
+ }
480
+ });
481
+ server.tool('recoveridentity', 'Recover a revoked or compromised identity. Only the recovery authority (or token recovery authority) can perform this. Typically used to set new primary addresses after a key compromise, effectively transferring control to new keys. Pass the full identity definition with the desired recovery state (new primary addresses, etc.). Always include "parent" in the identity definition. PRIVATEADDRESS BEHAVIOR: Omit privateaddress entirely to preserve the existing one (carried over). Pass null to clear/remove it. Include a new zs1... address to change it. Empty string "" does NOT clear — daemon treats it the same as omitting. TIMELOCK: Do NOT include timelock in the identity JSON unless you deliberately intend to set an absolute block height lock or clear an existing one. Omitting timelock resets it to 0 (unlocked) — timelock does NOT carry over like privateaddress does. To clear a timelock via recovery, simply omit the timelock field. If setting a timelock value, ensure revocationauthority and recoveryauthority are set to identities that can perform a future revoke+recover to remove it, since absolute locks CANNOT be removed by updateidentity. Use setidentitytimelock after recovery for safe timelock configuration. SAFETY: When setting new authorities during recovery, NEVER set revocationauthority to another identity while leaving recoveryauthority as self — if later revoked by the external authority, the identity cannot recover itself. This bricks the identity. If delegating revocation, always also delegate recovery to a different identity.', {
482
+ chain: z.string().describe('Chain to recover on (e.g., "VRSC", "vrsctest")'),
483
+ jsonidentity: z.record(z.unknown()).describe('New identity definition for the recovered state. Always include "parent" for correct namespace resolution. revocationauthority/recoveryauthority accept friendly name (e.g., "alice@") or i-address.'),
484
+ returntx: z.boolean().optional().describe('If true, return signed transaction hex instead of broadcasting. Default: false.'),
485
+ tokenrecover: z.boolean().optional().describe('If true, use the tokenized ID control token to recover. Default: false.'),
486
+ feeoffer: z.number().optional().describe('Non-standard fee amount.'),
487
+ sourceoffunds: z.string().optional().describe('Address to source funds from, to preserve privacy.'),
488
+ }, async ({ chain, jsonidentity, returntx, tokenrecover, feeoffer, sourceoffunds }) => {
489
+ try {
490
+ assertWriteEnabled();
491
+ // recoveridentity jsonidentity (returntx) (tokenrecover) (feeoffer) (sourceoffunds)
492
+ const params = [jsonidentity];
493
+ if (returntx !== undefined || tokenrecover !== undefined || feeoffer !== undefined || sourceoffunds !== undefined) {
494
+ params.push(returntx ?? false);
495
+ }
496
+ if (tokenrecover !== undefined || feeoffer !== undefined || sourceoffunds !== undefined) {
497
+ params.push(tokenrecover ?? false);
498
+ }
499
+ if (feeoffer !== undefined || sourceoffunds !== undefined) {
500
+ params.push(feeoffer ?? 0);
501
+ }
502
+ if (sourceoffunds !== undefined) {
503
+ params.push(sourceoffunds);
504
+ }
505
+ const result = await rpcCall(chain, 'recoveridentity', params);
506
+ const idName = jsonidentity.name;
507
+ auditLog({
508
+ server: SERVER_NAME,
509
+ tool: 'recoveridentity',
510
+ chain,
511
+ params: { name: idName, returntx, tokenrecover },
512
+ result,
513
+ success: true,
514
+ });
515
+ return ok(result);
516
+ }
517
+ catch (err) {
518
+ return handleError(err);
519
+ }
520
+ });
521
+ server.tool('setidentitytimelock', 'Set or modify a timelock on a VerusID. Timelocking restricts when an identity can spend funds on this chain. This only affects the identity on the current chain. Two modes:\n\n- setunlockdelay: Set a delay (in blocks) that must pass after an unlock request. Sets flags=2 (delay lock active), timelock=N (the delay in blocks). The identity cannot spend until an unlock is triggered and the delay passes.\n\n- unlockatblock: Set an absolute block height at which the identity unlocks. When used with unlockatblock=0 on a delay-locked identity (flags=2), it TRIGGERS the unlock countdown — the daemon converts the delay into an absolute block height (approximately current_block + delay) and clears the delay flag. This is the standard way to initiate unlocking a delay-locked identity. unlockatblock=0 does NOT work on absolute block height locks (flags=0, timelock > 0) — those can only be removed by revoke+recover.\n\nExactly one of unlockatblock or setunlockdelay must be specified.\n\nTIMELOCK WORKFLOW: 1) Set delay: setunlockdelay=N → identity locked with N-block delay. 2) Trigger unlock: unlockatblock=0 → countdown starts, identity unlocks at ~current_block+N. 3) Wait for block to pass. 4) Identity can spend again. To cancel a countdown (e.g., attacker triggered unlock), the revocation authority can revoke — revocation destroys the countdown entirely. Then recover to restore the identity with no timelock.\n\nREMOVING TIMELOCKS: Delay locks (flags=2) can be cleared by revoke+recover (omit timelock in recovery JSON). Absolute locks (flags=0, timelock > 0) can ONLY be cleared by revoke+recover. updateidentity CANNOT modify or remove any timelock once set.', {
522
+ chain: z.string().describe('Chain to set timelock on (e.g., "VRSC", "vrsctest")'),
523
+ identity: z.string().describe('VerusID name (e.g., "alice@") or i-address'),
524
+ unlockatblock: z.number().optional().describe('Absolute block height to unlock at. Mutually exclusive with setunlockdelay.'),
525
+ setunlockdelay: z.number().optional().describe('Number of blocks to delay after unlock request. Mutually exclusive with unlockatblock.'),
526
+ returntx: z.boolean().optional().describe('If true, return signed transaction hex instead of broadcasting. Default: false.'),
527
+ feeoffer: z.number().optional().describe('Non-standard fee amount.'),
528
+ sourceoffunds: z.string().optional().describe('Address to source funds from, to preserve privacy.'),
529
+ }, async ({ chain, identity, unlockatblock, setunlockdelay, returntx, feeoffer, sourceoffunds }) => {
530
+ try {
531
+ assertWriteEnabled();
532
+ if (unlockatblock === undefined && setunlockdelay === undefined) {
533
+ return fail('INVALID_PARAMS', 'Exactly one of unlockatblock or setunlockdelay must be specified.');
534
+ }
535
+ if (unlockatblock !== undefined && setunlockdelay !== undefined) {
536
+ return fail('INVALID_PARAMS', 'unlockatblock and setunlockdelay are mutually exclusive — specify only one.');
537
+ }
538
+ // setidentitytimelock "identity" (unlockatblock | setunlockdelay) (returntx) (feeoffer) (sourceoffunds)
539
+ const timelockObj = {};
540
+ if (unlockatblock !== undefined)
541
+ timelockObj.unlockatblock = unlockatblock;
542
+ if (setunlockdelay !== undefined)
543
+ timelockObj.setunlockdelay = setunlockdelay;
544
+ const params = [identity, timelockObj];
545
+ if (returntx !== undefined || feeoffer !== undefined || sourceoffunds !== undefined) {
546
+ params.push(returntx ?? false);
547
+ }
548
+ if (feeoffer !== undefined || sourceoffunds !== undefined) {
549
+ params.push(feeoffer ?? 0);
550
+ }
551
+ if (sourceoffunds !== undefined) {
552
+ params.push(sourceoffunds);
553
+ }
554
+ const result = await rpcCall(chain, 'setidentitytimelock', params);
555
+ auditLog({
556
+ server: SERVER_NAME,
557
+ tool: 'setidentitytimelock',
558
+ chain,
559
+ params: { identity, unlockatblock, setunlockdelay, returntx },
560
+ result,
561
+ success: true,
562
+ });
563
+ return ok(result);
564
+ }
565
+ catch (err) {
566
+ return handleError(err);
567
+ }
568
+ });
569
+ }
570
+ }
571
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAc,MAAM,SAAS,CAAC;AACjH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EACL,OAAO,EACP,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,SAAS,EAAE,CAAC,IAAa;IACvB,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,E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Ac,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;gBAClD,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;oBACpF,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,CAAC;gBACjC,CAAC;gBACD,IAAI,QAAQ,KAAK,SAAS,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;oBAC1D,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC;gBAC7B,CAAC;gBACD,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;oBAChC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;gBAC7B,CAAC;gBAED,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,EAAE,qBAAqB,EAAE,MAAM,CAAC,CAAC;gBAEnE,QAAQ,CAAC;oBACP,MAAM,EAAE,WAAW;oBACnB,IAAI,EAAE,qBAAqB;oBAC3B,KAAK;oBACL,MAAM,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE;oBAC7D,MAAM;oBACN,OAAO,EAAE,IAAI;iBACd,CAAC,CAAC;gBAEH,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;YACpB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@verusidx/identity-mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for VerusID identity management — create, update, revoke, recover, sign, and query Verus identities",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "verusidx-identity-mcp": "./build/index.js"
9
+ },
10
+ "files": [
11
+ "build"
12
+ ],
13
+ "engines": {
14
+ "node": ">=18.0.0"
15
+ },
16
+ "dependencies": {
17
+ "@modelcontextprotocol/sdk": "^1.27.0",
18
+ "zod": "^3.23.0",
19
+ "@verusidx/shared": "0.1.0"
20
+ },
21
+ "devDependencies": {
22
+ "@types/node": "^22.0.0",
23
+ "typescript": "^5.7.0",
24
+ "vitest": "^3.0.0"
25
+ },
26
+ "scripts": {
27
+ "build": "tsc",
28
+ "test": "vitest run"
29
+ }
30
+ }