@kya-os/mcp-i 0.1.0-alpha.2.3 → 0.1.0-alpha.2.5

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.
Files changed (58) hide show
  1. package/README.md +192 -216
  2. package/dist/auto.d.ts +0 -12
  3. package/dist/auto.js +3 -14
  4. package/dist/crypto.d.ts +10 -26
  5. package/dist/crypto.js +117 -37
  6. package/dist/dev-helper.d.ts +3 -0
  7. package/dist/dev-helper.js +46 -0
  8. package/dist/encrypted-storage.d.ts +11 -0
  9. package/dist/encrypted-storage.js +73 -0
  10. package/dist/index.d.ts +29 -106
  11. package/dist/index.js +225 -392
  12. package/dist/logger.d.ts +32 -0
  13. package/dist/logger.js +66 -0
  14. package/dist/registry/index.d.ts +0 -31
  15. package/dist/registry/index.js +2 -42
  16. package/dist/registry/knowthat.d.ts +3 -18
  17. package/dist/registry/knowthat.js +10 -35
  18. package/dist/rotation.d.ts +35 -0
  19. package/dist/rotation.js +102 -0
  20. package/dist/storage.d.ts +41 -0
  21. package/dist/storage.js +163 -0
  22. package/dist/transport.d.ts +35 -0
  23. package/dist/transport.js +189 -0
  24. package/dist/types.d.ts +72 -99
  25. package/dist/types.js +0 -4
  26. package/package.json +16 -6
  27. package/dist/__tests__/challenge-response.test.d.ts +0 -5
  28. package/dist/__tests__/challenge-response.test.d.ts.map +0 -1
  29. package/dist/__tests__/challenge-response.test.js +0 -218
  30. package/dist/__tests__/challenge-response.test.js.map +0 -1
  31. package/dist/__tests__/crypto.test.d.ts +0 -5
  32. package/dist/__tests__/crypto.test.d.ts.map +0 -1
  33. package/dist/__tests__/crypto.test.js +0 -153
  34. package/dist/__tests__/crypto.test.js.map +0 -1
  35. package/dist/auto.d.ts.map +0 -1
  36. package/dist/auto.js.map +0 -1
  37. package/dist/crypto.d.ts.map +0 -1
  38. package/dist/crypto.js.map +0 -1
  39. package/dist/index.d.ts.map +0 -1
  40. package/dist/index.js.map +0 -1
  41. package/dist/registry/cursor.d.ts +0 -25
  42. package/dist/registry/cursor.d.ts.map +0 -1
  43. package/dist/registry/cursor.js +0 -108
  44. package/dist/registry/cursor.js.map +0 -1
  45. package/dist/registry/glama.d.ts +0 -25
  46. package/dist/registry/glama.d.ts.map +0 -1
  47. package/dist/registry/glama.js +0 -111
  48. package/dist/registry/glama.js.map +0 -1
  49. package/dist/registry/index.d.ts.map +0 -1
  50. package/dist/registry/index.js.map +0 -1
  51. package/dist/registry/knowthat.d.ts.map +0 -1
  52. package/dist/registry/knowthat.js.map +0 -1
  53. package/dist/registry/smithery.d.ts +0 -29
  54. package/dist/registry/smithery.d.ts.map +0 -1
  55. package/dist/registry/smithery.js +0 -119
  56. package/dist/registry/smithery.js.map +0 -1
  57. package/dist/types.d.ts.map +0 -1
  58. package/dist/types.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @kya-os/mcp-i
2
2
 
3
- Give your MCP server a decentralized identity (DID) in 2 lines of code. Build reputation, enable discovery, and future-proof your agent for the emerging identity ecosystem.
3
+ The SEO package for AI agents. Register your MCP server and get automatic directory listings in 2 lines of code.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@kya-os/mcp-i.svg)](https://www.npmjs.com/package/@kya-os/mcp-i)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -10,36 +10,25 @@ Give your MCP server a decentralized identity (DID) in 2 lines of code. Build re
10
10
 
11
11
  **For MCP Server Developers:**
12
12
 
13
- - 🆔 **Get a DID** - Your server gets a permanent, cryptographic identity
14
- - 📈 **Build Reputation** - Every interaction is signed and verifiable
15
- - 🔍 **Automatic Discovery** - Listed on registries as they adopt MCP-I
16
- - 🔮 **Future-Proof** - Ready for the decentralized agent ecosystem
13
+ - **Get a DID** - Your agent gets a permanent, cryptographic identity from knowthat.ai
14
+ - **Automatic Directory Listings** - Submit to multiple directories with zero extra work
15
+ - **Build Reputation** - Every interaction is signed and verifiable
16
+ - **Future-Proof** - Ready for the decentralized agent ecosystem
17
+ - **Production-Ready** - Optimized for Lambda, Edge, Next.js, and traditional deployments
17
18
 
18
19
  **For Directory Maintainers:**
19
20
 
20
- - 🔌 **Easy Integration** - Become an MCP-I registry with our SDK
21
- - **Verified Agents** - Only list agents with cryptographic proof
22
- - 🌐 **Join the Standard** - Be part of the emerging identity layer
21
+ - **Easy Integration** - List MCP-I compliant agents automatically
22
+ - **Verified Agents** - Only list agents with cryptographic proof
23
+ - **Join the Network** - Tap into the growing MCP-I ecosystem
23
24
 
24
- ## The Vision
25
+ ## How It Works
25
26
 
26
- Your AI agent needs identity to:
27
-
28
- - **Prove who it is** to other services (authentication)
29
- - **Be discovered** by users and other agents (visibility)
30
- - **Build reputation** through verified interactions (trust)
31
- - **Access APIs** that require identity verification (capability)
32
-
33
- ## 🚨 IMPORTANT: API Call Behavior
34
-
35
- **This package is designed to be spam-free:**
36
-
37
- - **First run only**: API calls happen ONLY on first initialization
38
- - **Persistent identity**: After first run, loads from disk with ZERO API calls
39
- - **No spam on restarts**: Restart your server 1000 times = still zero API calls
40
- - **Rate limited**: Built-in protection against accidental registry spam
41
-
42
- [Read the full API behavior guide →](./API_BEHAVIOR.md)
27
+ 1. **Identity Registration**: Your agent is registered with knowthat.ai (the MCP-I registry)
28
+ 2. **DID Generation**: You get a `did:web:knowthat.ai:agents:your-agent` identifier
29
+ 3. **Directory Submission**: Based on your preferences, knowthat.ai submits your agent to directories
30
+ 4. **Cryptographic Signing**: All agent responses are signed with your private key
31
+ 5. **Verification**: Anyone can verify your agent's identity and authenticity
43
32
 
44
33
  ## Installation
45
34
 
@@ -56,206 +45,159 @@ import "@kya-os/mcp-i/auto";
56
45
  // That's it! Your server now has cryptographic identity
57
46
  ```
58
47
 
59
- ### 2. With Configuration
48
+ ### 2. Production Configuration
60
49
 
61
50
  ```typescript
62
51
  import { enableMCPIdentity } from "@kya-os/mcp-i";
63
52
 
64
- await enableMCPIdentity({
65
- name: "Calendar Assistant",
66
- description: "AI agent for professional calendar management",
67
- repository: "https://github.com/your-org/calendar-assistant",
68
- });
69
- ```
70
-
71
- ## Current State & Roadmap
53
+ const identity = await enableMCPIdentity({
54
+ name: "Production Agent",
72
55
 
73
- **Today:**
56
+ // Auto-detect runtime (Lambda, Edge, Node.js)
57
+ storage: "auto",
58
+ transport: "auto",
74
59
 
75
- - Your MCP server gets a DID (decentralized identifier)
76
- - ✅ Every response is cryptographically signed
77
- - ✅ Registered on KnowThat.ai registry
78
- - ✅ Full MCP-I Level 2 conformance
60
+ // Encrypt private keys at rest
61
+ encryptionPassword: process.env.AGENT_KEY_PASSWORD,
79
62
 
80
- **Coming Soon:**
63
+ // Professional logging
64
+ logLevel: "error", // or 'silent' for production
81
65
 
82
- - 🔜 Additional registry support as directories adopt MCP-I
83
- - 🔜 Cross-registry reputation aggregation
84
- - 🔜 Enhanced discovery features
85
- - 🔜 Agent-to-agent secure communication
86
-
87
- ## What Happens Under the Hood
88
-
89
- When you import this package:
66
+ // Directory preferences (optional)
67
+ directories: "verified", // List on all verified directories
68
+ // OR directories: ["smithery", "glama"] // Specific directories
69
+ // OR directories: "none" // No directory listings
70
+ });
90
71
 
91
- 1. **First Run Only**:
72
+ // Enable automatic key rotation
73
+ await identity.enableAutoRotation({
74
+ maxAge: 90 * 24 * 60 * 60 * 1000, // 90 days
75
+ maxSignatures: 1_000_000, // 1M signatures
76
+ });
77
+ ```
92
78
 
93
- - Generates Ed25519 cryptographic keypair
94
- - Registers with KnowThat.ai to obtain a DID
95
- - Saves identity to `.mcp-identity.json`
96
- - Total time: ~2 seconds
79
+ ### 3. Lambda/Edge Runtime
97
80
 
98
- 2. **Every Subsequent Run**:
81
+ ```typescript
82
+ // Automatic configuration for serverless
83
+ const identity = await enableMCPIdentity({
84
+ name: "Serverless Agent",
85
+ storage: "memory", // No file system needed
86
+ transport: "fetch", // Native fetch for edge
87
+ logLevel: "silent", // No console output
88
+ });
89
+ ```
99
90
 
100
- - Loads existing identity from disk
101
- - Zero API calls, instant startup
102
- - Maintains the same DID forever
91
+ ## Production Features
103
92
 
104
- 3. **During Operation**:
105
- - Every response includes `_mcp_identity` field with cryptographic signature
106
- - Handles MCP-I challenge-response authentication automatically
107
- - Advertises identity capabilities to clients
93
+ ### Performance Optimizations
108
94
 
109
- ## Example Response
95
+ - **Lazy Loading**: Crypto libraries load only when needed
96
+ - **Signature Caching**: Repeated signatures are 10x faster
97
+ - **Precomputed Values**: DIDs and keys cached in memory
98
+ - **Optimized Transport**: Auto-selects axios vs fetch
110
99
 
111
- After enabling MCP-I, all your server responses automatically include cryptographic signatures:
100
+ ### Security Features
112
101
 
113
- ```json
114
- {
115
- "content": [
116
- {
117
- "type": "text",
118
- "text": "Meeting scheduled for tomorrow at 2 PM"
119
- }
120
- ],
121
- "_mcp_identity": {
122
- "did": "did:web:knowthat.ai:agents:calendar-assistant",
123
- "signature": "0x3045...",
124
- "timestamp": "2025-01-06T10:00:00Z",
125
- "conformanceLevel": 2
126
- }
127
- }
128
- ```
102
+ - **Key Encryption**: Private keys encrypted with AES-256-GCM
103
+ - **Key Rotation**: Automatic rotation based on age/usage
104
+ - **Nonce Tracking**: Prevents replay attacks
105
+ - **Timestamp Validation**: Configurable tolerance windows
129
106
 
130
- ## Advanced Configuration
107
+ ### Runtime Support
131
108
 
132
- ### Registry Support (Future-Ready)
109
+ - **AWS Lambda**: Automatic memory storage
110
+ - **Vercel Edge**: Native fetch transport
111
+ - **Cloudflare Workers**: Full compatibility
112
+ - **Node.js**: Traditional file storage
133
113
 
134
- As more directories adopt MCP-I, your agent will automatically be discoverable across the ecosystem:
114
+ ### Directory Listings
135
115
 
136
116
  ```typescript
117
+ // Configure directory listings
137
118
  await enableMCPIdentity({
138
119
  name: "My Agent",
139
- registries: "verified", // default
140
- // Currently registers with KnowThat.ai
141
- // Additional registries will be supported as they adopt MCP-I
142
- });
143
- ```
144
-
145
- **Note for Directory Maintainers:** Want to add your directory as a supported registry? [Contact us](https://github.com/orgs/modelcontextprotocol-identity/discussions/new?category=mcp-i-directories) to discuss integration.
146
120
 
147
- ### Custom DID Host
121
+ // Option 1: List on all verified directories
122
+ directories: "verified",
148
123
 
149
- For enterprises who want to host their own DID:
124
+ // Option 2: List on specific directories
125
+ directories: ["smithery", "glama"],
150
126
 
151
- ```typescript
152
- await enableMCPIdentity({
153
- name: "Enterprise Agent",
154
- didHost: "company.com", // Creates did:web:company.com:agents:...
127
+ // Option 3: No directory listings (registry only)
128
+ directories: "none",
155
129
  });
156
- ```
157
130
 
158
- Note: The Agent's did must discoverable via company.com/.well-known/did.json
131
+ // Directory preferences are sent to knowthat.ai
132
+ // The registry handles submissions to your chosen directories
133
+ ```
159
134
 
160
- ### Edit Your Agent Profile
135
+ ## Advanced Usage
161
136
 
162
- Only you can edit your agent's profile, thanks to cryptographic proof:
137
+ ### Key Rotation
163
138
 
164
139
  ```typescript
165
- const identity = await enableMCPIdentity();
140
+ // Check key health
141
+ const health = identity.checkKeyHealth();
142
+ console.log(`Key age: ${health.age}ms`);
143
+ console.log(`Signatures: ${health.signatureCount}`);
144
+ console.log(`Should rotate: ${health.shouldRotate}`);
145
+
146
+ // Manual rotation
147
+ const result = await identity.rotateKeys("security-policy");
148
+ if (result.success) {
149
+ console.log(`Grace period ends: ${result.gracePeriodEnd}`);
150
+ }
166
151
 
167
- // Get a signed edit URL
168
- const editUrl = await identity.requestEditAccess();
169
- console.log("Edit your agent at:", editUrl);
170
- // https://knowthat.ai/agents/edit?did=...&timestamp=...&signature=...
152
+ // Automatic rotation
153
+ await identity.enableAutoRotation({
154
+ maxAge: 30 * 24 * 60 * 60 * 1000, // 30 days
155
+ maxSignatures: 500_000, // 500k signatures
156
+ });
171
157
  ```
172
158
 
173
- ## Key Benefits
174
-
175
- **Immediate Benefits:**
176
-
177
- - 🛡️ **Cryptographic Identity**: Every response is signed with Ed25519
178
- - 🆔 **Permanent DID**: Your agent gets a decentralized identifier that you control
179
- - 🔐 **Impersonation Protection**: Nobody can pretend to be your agent
180
- - ✅ **Verification Ready**: Cryptographic proof of authenticity
159
+ ### Edit/Claim URLs
181
160
 
182
- **Future Benefits (as ecosystem grows):**
183
-
184
- - 🔍 **Multi-Registry Discovery**: Automatically listed as directories adopt MCP-I
185
- - 📈 **Reputation Building**: Verifiable interaction history across platforms
186
- - 🚀 **Priority Access**: Identity-aware APIs will offer higher rate limits
187
- - 🏆 **Trust Badges**: Stand out as an early adopter of decentralized identity
188
-
189
- ## How MCP-I Works
161
+ ```typescript
162
+ // Get signed URLs for editing
163
+ const { editUrl, claimUrl } = await identity.requestEditAccess();
190
164
 
191
- ```mermaid
192
- sequenceDiagram
193
- participant User
194
- participant Client as AI Client
195
- participant Agent as Your MCP Server
196
- participant API as Protected API
165
+ // Edit URL - for existing agents
166
+ console.log("Edit your agent:", editUrl);
197
167
 
198
- User->>Client: "Book a meeting"
199
- Client->>Agent: MCP request
200
- Note over Agent: Signs response with private key
201
- Agent->>Client: Response + _mcp_identity
202
- Client->>API: Forward request with identity
203
- API->>API: Verify signature
204
- API->>Client: Authorized response
205
- Client->>User: "Meeting booked!"
168
+ // Claim URL - for draft/unclaimed agents
169
+ console.log("Claim your agent:", claimUrl);
206
170
  ```
207
171
 
208
- ## Files Created
209
-
210
- After initialization, you'll see these files in your project root:
172
+ ### Custom Storage
211
173
 
212
- ```
213
- .mcp-identity.json # Your agent's identity (⚠️ Contains private key!)
214
- ```
174
+ ```typescript
175
+ // Encrypted file storage
176
+ await enableMCPIdentity({
177
+ storage: "file",
178
+ persistencePath: "/secure/location/.identity",
179
+ encryptionPassword: "strong-password",
180
+ });
215
181
 
216
- The file contains:
217
-
218
- ```json
219
- {
220
- "did": "did:web:knowthat.ai:agents:your-agent",
221
- "publicKey": "base64-encoded-public-key",
222
- "privateKey": "base64-encoded-private-key", // Keep this secret!
223
- "agentId": "uuid",
224
- "agentSlug": "your-agent-slug",
225
- "registeredAt": "2025-01-06T10:00:00Z",
226
- "didHost": "knowthat.ai",
227
- "registry": {
228
- "name": "knowthat.ai",
229
- "status": "active",
230
- "url": "https://knowthat.ai/agents/your-agent-slug"
231
- }
232
- }
182
+ // Memory storage with custom key
183
+ await enableMCPIdentity({
184
+ storage: "memory",
185
+ memoryKey: "agent-123", // Useful for multiple agents
186
+ });
233
187
  ```
234
188
 
235
- ## Security Best Practices
236
-
237
- - 🔐 **Private keys never leave your server** - stored locally only
238
- - ✍️ **Ed25519 signatures** - cryptographically secure
239
- - 🛡️ **Replay protection** - timestamps and nonces prevent attacks
240
- - 🔑 **Add `.mcp-identity.json` to .gitignore** - contains private key!
241
-
242
- ## Troubleshooting
243
-
244
- ### "Rate limit exceeded"
245
-
246
- - Wait 1 hour before retrying
247
- - Each IP can register 10 agents/hour on KnowThat.ai
248
-
249
- ### Agent not showing as verified
250
-
251
- - Verification can take up to 5 minutes
252
- - Check https://knowthat.ai/agents/YOUR-AGENT-SLUG
189
+ ### Custom Logger
253
190
 
254
- ### Lost your identity file?
255
-
256
- - Unfortunately, DIDs cannot be recovered
257
- - You'll need to create a new identity
258
- - Previous registrations cannot be updated
191
+ ```typescript
192
+ await enableMCPIdentity({
193
+ logger: {
194
+ debug: (msg, ...args) => myLogger.debug(msg, args),
195
+ info: (msg, ...args) => myLogger.info(msg, args),
196
+ warn: (msg, ...args) => myLogger.warn(msg, args),
197
+ error: (msg, ...args) => myLogger.error(msg, args),
198
+ },
199
+ });
200
+ ```
259
201
 
260
202
  ## API Reference
261
203
 
@@ -265,56 +207,90 @@ Main function to enable identity for your MCP server.
265
207
 
266
208
  **Options:**
267
209
 
268
- - `name` (string): Your agent's display name
269
- - `description` (string): What your agent does
270
- - `repository` (string): GitHub repo URL
271
- - `didHost` (string): Custom DID host (default: "knowthat.ai")
272
-
273
- **Returns:** `Promise<MCPIdentity>`
210
+ ```typescript
211
+ interface MCPIdentityOptions {
212
+ // Basic info
213
+ name?: string;
214
+ description?: string;
215
+ repository?: string;
216
+
217
+ // Storage
218
+ storage?: "file" | "memory" | "auto";
219
+ persistencePath?: string;
220
+ memoryKey?: string;
221
+ encryptionPassword?: string;
222
+
223
+ // Transport
224
+ transport?: "axios" | "fetch" | "auto";
225
+
226
+ // Security
227
+ timestampTolerance?: number; // Default: 60000ms
228
+ enableNonceTracking?: boolean; // Default: true
229
+
230
+ // Directory listings
231
+ directories?: string[] | "verified" | "none"; // Default: "verified"
232
+
233
+ // Development
234
+ mode?: "development" | "production";
235
+
236
+ // Logging
237
+ logger?: Logger;
238
+ logLevel?: "debug" | "info" | "warn" | "error" | "silent";
239
+ }
240
+ ```
274
241
 
275
- ### `MCPIdentity` class
242
+ ### `MCPIdentity` Methods
276
243
 
277
- **Methods:**
244
+ - `sign(message)`: Sign with caching
245
+ - `verify(message, signature, publicKey?)`: Verify signatures
246
+ - `respondToChallenge(challenge)`: MCP-I authentication
247
+ - `signResponse(response)`: Add identity to responses
248
+ - `requestEditAccess()`: Get edit/claim URLs
249
+ - `rotateKeys(reason?)`: Manual key rotation
250
+ - `enableAutoRotation(policy?)`: Automatic rotation
251
+ - `checkKeyHealth()`: Key rotation status
278
252
 
279
- - `sign(message)`: Sign a message with your private key
280
- - `verify(message, signature)`: Verify a signature
281
- - `respondToChallenge(challenge)`: Handle MCP-I authentication
282
- - `signResponse(response)`: Add identity to any response
283
- - `requestEditAccess()`: Get edit URL for your agent profile
284
- - `getRegistryStatus()`: Check registration status
253
+ ## Files Created
285
254
 
286
- ## FAQ
255
+ ```
256
+ .mcp-identity.json # Your agent's identity (encrypted if password set)
257
+ ```
287
258
 
288
- **Q: Is this package affiliated with Anthropic?**
289
- A: No, this is a community package implementing the MCP-I specification.
259
+ ## Security Best Practices
290
260
 
291
- **Q: Can I use this without MCP?**
292
- A: Yes! The `MCPIdentity` class can be used standalone for any identity needs.
261
+ 1. **Use encryption in production**: Always set `encryptionPassword`
262
+ 2. **Enable key rotation**: Set up automatic rotation policies
263
+ 3. **Secure storage**: Use appropriate file permissions
264
+ 4. **Monitor key health**: Check rotation status regularly
265
+ 5. **Add to .gitignore**: Never commit identity files
293
266
 
294
- **Q: What happens if KnowThat.ai is down?**
295
- A: After initial registration, your agent works offline. The DID is self-contained.
267
+ ## Performance Tips
296
268
 
297
- **Q: Can I change my agent's name later?**
298
- A: Yes, use `requestEditAccess()` to get an edit URL with cryptographic proof.
269
+ 1. **Use memory storage** for Lambda/Edge runtimes
270
+ 2. **Enable signature caching** (automatic)
271
+ 3. **Use 'silent' log level** in production
272
+ 4. **Let transport auto-select** based on runtime
273
+ 5. **Preload identity** during cold starts
299
274
 
300
- **Q: Why only KnowThat.ai registry right now?**
301
- A: We're building the ecosystem! As directories adopt MCP-I, your agent will automatically be discoverable across all of them.
275
+ ## Troubleshooting
302
276
 
303
- **Q: I run a directory. How can I support MCP-I?**
304
- A: [Contact us](https://github.com/kya-os/mcp-i/issues) to discuss integration. We're actively seeking directory partners.
277
+ ### Lambda/Edge Issues
305
278
 
306
- **Q: Is this production-ready?**
307
- A: Yes, but currently in beta. The API may change before 1.0.
279
+ - Ensure `storage: 'memory'` or `'auto'`
280
+ - Use `transport: 'fetch'` for edge runtimes
281
+ - Set `logLevel: 'silent'` to avoid console issues
308
282
 
309
- ## Join the Identity Revolution
283
+ ### Key Rotation Failures
310
284
 
311
- **MCP Server Developers:** Give your server an identity today. Be discoverable, build reputation, and future-proof your agent for the emerging ecosystem.
285
+ - Check network connectivity to knowthat.ai
286
+ - Verify current keys are not corrupted
287
+ - Manual rotation: `await identity.rotateKeys('recovery')`
312
288
 
313
- ```bash
314
- npm install @kya-os/mcp-i
315
- ```
289
+ ### Performance Issues
316
290
 
317
- **Directory Maintainers:** Want to be part of the decentralized identity ecosystem? MCP-I enables you to list only verified agents with cryptographic proof of identity. [Let's talk integration →](https://github.com/orgs/modelcontextprotocol-identity/discussions/new?category=mcp-i-directories)
291
+ - Verify signature caching is working
292
+ - Check lazy loading (should see delayed first signature)
293
+ - Use memory storage when possible
318
294
 
319
295
  ## License
320
296
 
package/dist/auto.d.ts CHANGED
@@ -1,13 +1 @@
1
- /**
2
- * Auto-initialization for MCP Identity
3
- *
4
- * Just import this file to automatically enable MCP-I for any MCP server:
5
- *
6
- * ```typescript
7
- * import "@kya-os/mcp-i/auto";
8
- * ```
9
- *
10
- * That's it! Your MCP server now has identity.
11
- */
12
1
  export {};
13
- //# sourceMappingURL=auto.d.ts.map
package/dist/auto.js CHANGED
@@ -1,24 +1,13 @@
1
1
  "use strict";
2
- /**
3
- * Auto-initialization for MCP Identity
4
- *
5
- * Just import this file to automatically enable MCP-I for any MCP server:
6
- *
7
- * ```typescript
8
- * import "@kya-os/mcp-i/auto";
9
- * ```
10
- *
11
- * That's it! Your MCP server now has identity.
12
- */
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  const index_1 = require("./index");
15
- // Auto-initialize on import
4
+ const logger_1 = require("./logger");
16
5
  (async () => {
17
6
  try {
18
7
  await (0, index_1.enableMCPIdentity)();
19
8
  }
20
9
  catch (error) {
21
- console.error('[MCP-I] Failed to auto-initialize:', error);
10
+ const logger = (0, logger_1.getLogger)();
11
+ logger.error('[MCP-I] Failed to auto-initialize:', error);
22
12
  }
23
13
  })();
24
- //# sourceMappingURL=auto.js.map
package/dist/crypto.d.ts CHANGED
@@ -1,32 +1,16 @@
1
- /**
2
- * Cryptographic utilities for MCP-I
3
- * Implements Ed25519 signing and verification for challenge-response authentication
4
- */
5
- /**
6
- * Generate a new Ed25519 key pair
7
- */
8
- export declare function generateKeyPair(): Promise<{
1
+ export interface PrecomputedKeyPair {
9
2
  publicKey: string;
10
3
  privateKey: string;
11
- }>;
12
- /**
13
- * Sign a message with Ed25519
14
- */
4
+ publicKeyBytes?: Uint8Array;
5
+ privateKeyBytes?: Uint8Array;
6
+ }
7
+ export declare function generateKeyPair(): Promise<PrecomputedKeyPair>;
15
8
  export declare function sign(message: string | Buffer, privateKeyBase64: string): Promise<string>;
16
- /**
17
- * Verify an Ed25519 signature
18
- */
19
9
  export declare function verify(message: string | Buffer, signatureBase64: string, publicKeyBase64: string): Promise<boolean>;
20
- /**
21
- * Generate a cryptographically secure nonce
22
- */
23
- export declare function generateNonce(length?: number): string;
24
- /**
25
- * Constant-time string comparison to prevent timing attacks
26
- */
10
+ export declare function generateNonce(length?: number): Promise<string>;
11
+ export declare function generateNonceSync(length?: number): string;
27
12
  export declare function constantTimeEqual(a: string, b: string): boolean;
28
- /**
29
- * Convert Ed25519 public key to did:key format
30
- */
31
13
  export declare function publicKeyToDid(publicKeyBase64: string): string;
32
- //# sourceMappingURL=crypto.d.ts.map
14
+ export declare function encrypt(data: string, password: string): Promise<string>;
15
+ export declare function decrypt(encryptedData: string, password: string): Promise<string>;
16
+ export declare function clearCache(): void;