@aikdna/kdna-mcp-server 0.3.1 → 0.4.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 CHANGED
@@ -23,7 +23,7 @@ server provides a lower-level bridge for structured tool calls.
23
23
  | `kdna.inspect` | Inspect a `.kdna` asset | File path | Structured metadata |
24
24
  | `kdna.verify` | Verify asset integrity state | File path | Pass/fail with reasons |
25
25
  | `kdna.plan-load` | Return Core LoadPlan before loading | File path, optional password or entitlement state | LoadPlan JSON |
26
- | `kdna.load` | Load an authorized `.kdna` profile | File path, optional profile | Runtime Capsule |
26
+ | `kdna.load` | Load an authorized `.kdna` profile | File path, optional profile, password, or entitlement state | Runtime Capsule |
27
27
  | `kdna.available-local` | List local `.kdna` assets | Root directory | Local asset inventory |
28
28
  | `kdna.match` | Rank candidate assets for a task string | Task description | Scored list with fit signals |
29
29
 
package/bin/kdna-mcp.mjs CHANGED
@@ -51,6 +51,8 @@ const tools = [
51
51
  assetPath: { type: 'string' },
52
52
  profile: { type: 'string', enum: ['index', 'compact', 'scenario', 'full'] },
53
53
  input: { type: 'string' },
54
+ password: { type: 'string' },
55
+ entitlementStatus: { type: 'string', enum: ['active', 'expired', 'revoked', 'offline_grace'] },
54
56
  },
55
57
  },
56
58
  },
@@ -90,14 +92,6 @@ const tools = [
90
92
  },
91
93
  },
92
94
  },
93
- {
94
- name: 'kdna.available',
95
- description: 'Legacy: list assets from a local Registry domains.json file.',
96
- inputSchema: {
97
- type: 'object',
98
- properties: { registryFile: { type: 'string' } },
99
- },
100
- },
101
95
  ];
102
96
 
103
97
  function send(id, result, error) {
@@ -167,20 +161,6 @@ function findLocalAssets(root = defaultAssetRoot(), maxDepth = 3) {
167
161
  return found;
168
162
  }
169
163
 
170
- function listRegistry(registryFile) {
171
- const file = registryFile || process.env.KDNA_REGISTRY_FILE;
172
- if (!file) return [];
173
- const registry = JSON.parse(fs.readFileSync(file, 'utf8'));
174
- const domains = Array.isArray(registry.domains) ? registry.domains : Object.values(registry.domains || {});
175
- return domains.map((d) => ({
176
- legacy_registry: true,
177
- name: d.name,
178
- version: d.version,
179
- asset_url: d.asset_url,
180
- asset_digest: d.asset_digest,
181
- }));
182
- }
183
-
184
164
  function runCliPlanLoad(args = {}) {
185
165
  const cliArgs = ['plan-load', args.assetPath, '--json'];
186
166
  if (args.hasPassword) cliArgs.push('--has-password');
@@ -237,6 +217,8 @@ async function callTool(name, args = {}) {
237
217
  profile: args.profile || 'compact',
238
218
  as: 'json',
239
219
  input: args.input || '',
220
+ password: args.password,
221
+ entitlement: args.entitlementStatus ? { status: args.entitlementStatus } : undefined,
240
222
  }));
241
223
  }
242
224
  if (name === 'kdna.plan-load') {
@@ -248,9 +230,6 @@ async function callTool(name, args = {}) {
248
230
  if (name === 'kdna.available-local') {
249
231
  return textResult(findLocalAssets(args.root, args.maxDepth || 3));
250
232
  }
251
- if (name === 'kdna.available') {
252
- return textResult(listRegistry(args.registryFile));
253
- }
254
233
  throw new Error(`Unknown tool: ${name}`);
255
234
  }
256
235
 
@@ -278,9 +257,11 @@ async function handle(message) {
278
257
  const rl = readline.createInterface({ input: process.stdin });
279
258
  rl.on('line', async (line) => {
280
259
  if (!line.trim()) return;
260
+ let message;
281
261
  try {
282
- await handle(JSON.parse(line));
262
+ message = JSON.parse(line);
263
+ await handle(message);
283
264
  } catch (e) {
284
- send(undefined, null, e);
265
+ send(message?.id ?? null, null, e);
285
266
  }
286
267
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aikdna/kdna-mcp-server",
3
- "version": "0.3.1",
3
+ "version": "0.4.1",
4
4
  "description": "MCP server for loading, inspecting, verifying, and matching KDNA .kdna assets.",
5
5
  "type": "module",
6
6
  "homepage": "https://aikdna.com",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "license": "Apache-2.0",
36
36
  "dependencies": {
37
- "@aikdna/kdna-core": "0.15.12",
37
+ "@aikdna/kdna-core": "0.17.0",
38
38
  "ajv": "^8.20.0",
39
39
  "ajv-formats": "^3.0.1"
40
40
  },