agentinit 1.6.0 → 1.7.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/CHANGELOG.md +14 -0
- package/README.md +93 -10
- package/dist/agentinit-1.7.0.tgz +0 -0
- package/dist/cli.js +315 -36
- package/dist/commands/apply.d.ts.map +1 -1
- package/dist/commands/apply.js +2 -2
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/verifyMcp.d.ts.map +1 -1
- package/dist/commands/verifyMcp.js +26 -4
- package/dist/commands/verifyMcp.js.map +1 -1
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/mcp.d.ts +1 -0
- package/dist/constants/mcp.d.ts.map +1 -1
- package/dist/constants/mcp.js +2 -0
- package/dist/constants/mcp.js.map +1 -1
- package/dist/core/mcpClient.d.ts +124 -6
- package/dist/core/mcpClient.d.ts.map +1 -1
- package/dist/core/mcpClient.js +385 -39
- package/dist/core/mcpClient.js.map +1 -1
- package/dist/lib/utils/index.d.ts +3 -1
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/index.js +4 -1
- package/dist/lib/utils/index.js.map +1 -1
- package/dist/types/index.d.ts +10 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/jsonSchema.d.ts +31 -0
- package/dist/types/jsonSchema.d.ts.map +1 -0
- package/dist/types/jsonSchema.js +6 -0
- package/dist/types/jsonSchema.js.map +1 -0
- package/dist/utils/packageVersion.d.ts +105 -0
- package/dist/utils/packageVersion.d.ts.map +1 -0
- package/dist/utils/packageVersion.js +219 -0
- package/dist/utils/packageVersion.js.map +1 -0
- package/package.json +1 -1
- package/dist/agentinit-1.6.0.tgz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [1.7.0](https://github.com/agentinit/agentinit/compare/v1.6.0...v1.7.0) (2025-10-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* resolve TypeScript errors in MCP verifier ([469f886](https://github.com/agentinit/agentinit/commit/469f886ad0b6517b2eb1622b84a6b24b39614f3f))
|
|
7
|
+
* **tests:** remove duplicate getServerVersion properties in mock objects ([26106a7](https://github.com/agentinit/agentinit/commit/26106a7ddaad77a6e3ef37802bf01c8e2e580839))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* add automatic MCP server version detection ([3980599](https://github.com/agentinit/agentinit/commit/3980599539b8175384f0377765a0373c0315535c))
|
|
13
|
+
* **verifier:** add advanced MCP verification options ([d89d5da](https://github.com/agentinit/agentinit/commit/d89d5da9fe177aee19a92f9e441f2dbeba60a1b1))
|
|
14
|
+
|
|
1
15
|
# [1.6.0](https://github.com/agentinit/agentinit/compare/v1.5.0...v1.6.0) (2025-10-10)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -302,6 +302,8 @@ AgentInit includes a curated registry of popular MCPs:
|
|
|
302
302
|
|
|
303
303
|
AgentInit can be used as a library in your Node.js/TypeScript applications for programmatic MCP server verification and management.
|
|
304
304
|
|
|
305
|
+
> **📖 Full Documentation:** See [src/lib/verifier/README.md](src/lib/verifier/README.md) for complete API reference, examples, and advanced usage.
|
|
306
|
+
|
|
305
307
|
### Installation
|
|
306
308
|
|
|
307
309
|
```bash
|
|
@@ -315,7 +317,8 @@ bun add agentinit
|
|
|
315
317
|
### Basic Usage
|
|
316
318
|
|
|
317
319
|
```typescript
|
|
318
|
-
import { MCPVerifier
|
|
320
|
+
import { MCPVerifier } from 'agentinit/verifier';
|
|
321
|
+
import { MCPServerType } from 'agentinit/types';
|
|
319
322
|
|
|
320
323
|
const verifier = new MCPVerifier();
|
|
321
324
|
|
|
@@ -333,6 +336,34 @@ if (result.status === 'success') {
|
|
|
333
336
|
}
|
|
334
337
|
```
|
|
335
338
|
|
|
339
|
+
### Advanced Features
|
|
340
|
+
|
|
341
|
+
The verifier supports additional options for detailed inspection:
|
|
342
|
+
|
|
343
|
+
```typescript
|
|
344
|
+
// Fetch resource contents and prompt templates
|
|
345
|
+
const result = await verifier.verifyServer(
|
|
346
|
+
serverConfig,
|
|
347
|
+
{
|
|
348
|
+
timeout: 15000,
|
|
349
|
+
includeResourceContents: true, // Fetch actual resource data
|
|
350
|
+
includePromptDetails: true, // Fetch prompt templates
|
|
351
|
+
includeTokenCounts: true // Calculate token usage (default)
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
|
|
355
|
+
// Access detailed tool parameters
|
|
356
|
+
result.capabilities?.tools.forEach(tool => {
|
|
357
|
+
console.log(`\nTool: ${tool.name}`);
|
|
358
|
+
|
|
359
|
+
if (tool.inputSchema?.properties) {
|
|
360
|
+
Object.entries(tool.inputSchema.properties).forEach(([name, schema]) => {
|
|
361
|
+
console.log(` - ${name}: ${schema.type} ${schema.description || ''}`);
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
```
|
|
366
|
+
|
|
336
367
|
### Submodule Imports
|
|
337
368
|
|
|
338
369
|
For better tree-shaking, import from specific submodules:
|
|
@@ -341,7 +372,11 @@ For better tree-shaking, import from specific submodules:
|
|
|
341
372
|
// Import specific modules
|
|
342
373
|
import { MCPVerifier } from 'agentinit/verifier';
|
|
343
374
|
import { MCPServerType } from 'agentinit/types';
|
|
344
|
-
import type {
|
|
375
|
+
import type {
|
|
376
|
+
MCPServerConfig,
|
|
377
|
+
MCPVerificationResult,
|
|
378
|
+
MCPVerificationOptions
|
|
379
|
+
} from 'agentinit/types';
|
|
345
380
|
import { countTokens, MCPParser } from 'agentinit/utils';
|
|
346
381
|
```
|
|
347
382
|
|
|
@@ -391,7 +426,7 @@ const result = await verifier.verifyServer({
|
|
|
391
426
|
#### Verify Multiple Servers
|
|
392
427
|
|
|
393
428
|
```typescript
|
|
394
|
-
import { MCPVerifier, MCPServerType } from 'agentinit';
|
|
429
|
+
import { MCPVerifier, MCPServerType } from 'agentinit/verifier';
|
|
395
430
|
|
|
396
431
|
const servers = [
|
|
397
432
|
{
|
|
@@ -416,6 +451,17 @@ console.log(verifier.formatResults(results));
|
|
|
416
451
|
// Or process results programmatically
|
|
417
452
|
const successful = results.filter(r => r.status === 'success').length;
|
|
418
453
|
console.log(`${successful}/${results.length} servers verified`);
|
|
454
|
+
|
|
455
|
+
// Inspect tool parameters and token usage
|
|
456
|
+
results.forEach(result => {
|
|
457
|
+
if (result.status === 'success' && result.capabilities) {
|
|
458
|
+
console.log(`\n${result.server.name}:`);
|
|
459
|
+
result.capabilities.tools.forEach(tool => {
|
|
460
|
+
const tokens = result.capabilities?.toolTokenCounts?.get(tool.name) || 0;
|
|
461
|
+
console.log(` • ${tool.name} (${tokens} tokens)`);
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
});
|
|
419
465
|
```
|
|
420
466
|
|
|
421
467
|
#### Count Tokens
|
|
@@ -449,10 +495,20 @@ new MCPVerifier(defaultTimeout?: number)
|
|
|
449
495
|
```
|
|
450
496
|
|
|
451
497
|
**Methods**
|
|
452
|
-
- `verifyServer(config: MCPServerConfig,
|
|
453
|
-
- `verifyServers(configs: MCPServerConfig[],
|
|
498
|
+
- `verifyServer(config: MCPServerConfig, options?: MCPVerificationOptions): Promise<MCPVerificationResult>` - Verify a single MCP server
|
|
499
|
+
- `verifyServers(configs: MCPServerConfig[], options?: MCPVerificationOptions): Promise<MCPVerificationResult[]>` - Verify multiple servers in parallel
|
|
454
500
|
- `formatResults(results: MCPVerificationResult[]): string` - Format verification results for display
|
|
455
501
|
|
|
502
|
+
**MCPVerificationOptions**
|
|
503
|
+
```typescript
|
|
504
|
+
interface MCPVerificationOptions {
|
|
505
|
+
timeout?: number; // Connection timeout (ms)
|
|
506
|
+
includeResourceContents?: boolean; // Fetch resource data
|
|
507
|
+
includePromptDetails?: boolean; // Fetch prompt templates
|
|
508
|
+
includeTokenCounts?: boolean; // Calculate tokens (default: true)
|
|
509
|
+
}
|
|
510
|
+
```
|
|
511
|
+
|
|
456
512
|
#### Types
|
|
457
513
|
|
|
458
514
|
**MCPServerType**
|
|
@@ -495,18 +551,45 @@ interface MCPVerificationResult {
|
|
|
495
551
|
**MCPCapabilities**
|
|
496
552
|
```typescript
|
|
497
553
|
interface MCPCapabilities {
|
|
498
|
-
tools: MCPTool[];
|
|
499
|
-
resources: MCPResource[];
|
|
500
|
-
prompts: MCPPrompt[];
|
|
554
|
+
tools: MCPTool[]; // Available tools with input schemas
|
|
555
|
+
resources: MCPResource[]; // Available resources (with optional contents)
|
|
556
|
+
prompts: MCPPrompt[]; // Available prompts (with optional templates)
|
|
501
557
|
serverInfo?: {
|
|
502
558
|
name: string;
|
|
503
559
|
version: string;
|
|
504
560
|
};
|
|
505
|
-
totalToolTokens?: number;
|
|
506
|
-
toolTokenCounts?: Map<string, number>;
|
|
561
|
+
totalToolTokens?: number; // Total token usage for all tools
|
|
562
|
+
toolTokenCounts?: Map<string, number>; // Token count per tool
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
interface MCPTool {
|
|
566
|
+
name: string;
|
|
567
|
+
description?: string;
|
|
568
|
+
inputSchema?: any; // JSON Schema defining parameters
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
interface MCPResource {
|
|
572
|
+
uri: string;
|
|
573
|
+
name?: string;
|
|
574
|
+
description?: string;
|
|
575
|
+
mimeType?: string;
|
|
576
|
+
contents?: string | Uint8Array; // Only if includeResourceContents is true
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
interface MCPPrompt {
|
|
580
|
+
name: string;
|
|
581
|
+
description?: string;
|
|
582
|
+
arguments?: Array<{
|
|
583
|
+
name: string;
|
|
584
|
+
description?: string;
|
|
585
|
+
required?: boolean;
|
|
586
|
+
}>;
|
|
587
|
+
template?: string; // Only if includePromptDetails is true
|
|
507
588
|
}
|
|
508
589
|
```
|
|
509
590
|
|
|
591
|
+
> **📝 Note:** For detailed examples on working with tool parameters, resource contents, and prompt templates, see the [full library documentation](src/lib/verifier/README.md).
|
|
592
|
+
|
|
510
593
|
## 🛠️ Development
|
|
511
594
|
|
|
512
595
|
### Building from Source
|
|
Binary file
|