@kya-os/mcp-i 0.1.0-alpha.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.
Files changed (2) hide show
  1. package/README.md +144 -0
  2. package/package.json +51 -0
package/README.md ADDED
@@ -0,0 +1,144 @@
1
+ # @kya-os/mcp-i
2
+
3
+ MCP-I auto-registration client for instant MCP server identity with just 2 lines of code.
4
+
5
+ ## 🚀 Quick Start
6
+
7
+ ```typescript
8
+ import { MCPIdentity } from "@kya-os/mcp-i";
9
+ const identity = await MCPIdentity.init(); // That's it!
10
+ ```
11
+
12
+ ## What It Does
13
+
14
+ When you add these two lines to your MCP server:
15
+
16
+ 1. **First Run**: Automatically registers your server with knowthat.ai
17
+ 2. **Future Runs**: Loads the saved identity
18
+ 3. **Every Response**: Adds verifiable identity metadata
19
+ 4. **Zero Config**: Works out of the box
20
+
21
+ ## Benefits
22
+
23
+ - ✅ **Verification Badge** on Smithery and other directories
24
+ - 🔝 **Priority Discovery** in search results
25
+ - 🔐 **Identity-Aware Features** from services
26
+ - 📊 **Analytics & Reputation** tracking
27
+ - 🛡️ **Protection Against Impersonation**
28
+
29
+ ## Installation
30
+
31
+ ```bash
32
+ npm install @kya-os/mcp-i
33
+ ```
34
+
35
+ ## Full Example
36
+
37
+ ```typescript
38
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
39
+ import { MCPIdentity } from "@kya-os/mcp-i";
40
+
41
+ // Initialize identity (auto-registers on first run)
42
+ const identity = await MCPIdentity.init({
43
+ metadata: {
44
+ name: "My Awesome MCP Server",
45
+ description: "Does amazing things with AI",
46
+ repository: "https://github.com/myusername/my-server",
47
+ categories: ["productivity", "automation"]
48
+ }
49
+ });
50
+
51
+ // Create your MCP server as usual
52
+ const server = new Server({
53
+ name: "my-server",
54
+ version: "1.0.0",
55
+ // Pass identity to enable MCP-I features
56
+ identity
57
+ });
58
+
59
+ // Your server now has a verifiable identity!
60
+ ```
61
+
62
+ ## What Happens on First Run
63
+
64
+ ```
65
+ $ npm start
66
+
67
+ [MCP-I] No existing identity found, auto-registering...
68
+ [MCP-I] ✅ Success! Your agent has been registered.
69
+ [MCP-I] DID: did:web:knowthat.ai:agents:my-awesome-server
70
+ [MCP-I] Profile: https://knowthat.ai/agents/my-awesome-server
71
+ [MCP-I] Identity saved to .env.local
72
+ ```
73
+
74
+ ## Options
75
+
76
+ ```typescript
77
+ interface MCPIdentityOptions {
78
+ // Agent metadata for registration
79
+ metadata?: {
80
+ name: string;
81
+ description?: string;
82
+ repository?: string;
83
+ categories?: string[];
84
+ version?: string;
85
+ };
86
+
87
+ // Advanced options
88
+ apiEndpoint?: string; // Custom API endpoint
89
+ autoRegister?: boolean; // Disable auto-registration
90
+ persistenceBackend?: string; // 'env' | 'file' | 'keychain' | 'auto'
91
+ persistencePath?: string; // Custom storage path
92
+ }
93
+ ```
94
+
95
+ ## Identity Persistence
96
+
97
+ The SDK automatically saves your identity in the most appropriate location:
98
+
99
+ 1. **Environment Variables** (.env.local)
100
+ ```
101
+ AGENT_DID="did:web:knowthat.ai:agents:my-server"
102
+ AGENT_PRIVATE_KEY_ENCRYPTED="..."
103
+ ```
104
+
105
+ 2. **Configuration File** (mcp-identity.json)
106
+ ```json
107
+ {
108
+ "did": "did:web:knowthat.ai:agents:my-server",
109
+ "publicKey": "...",
110
+ "privateKey": "..."
111
+ }
112
+ ```
113
+
114
+ 3. **System Keychain** (coming soon)
115
+ - macOS Keychain
116
+ - Windows Credential Manager
117
+ - Linux Secret Service
118
+
119
+ ## How Identity Flows Through MCP
120
+
121
+ Once initialized, your identity automatically:
122
+
123
+ - Signs all MCP responses
124
+ - Responds to identity challenges
125
+ - Advertises capabilities
126
+ - Builds reputation over time
127
+
128
+ Example response with identity:
129
+
130
+ ```json
131
+ {
132
+ "result": "Task completed successfully",
133
+ "_mcp_identity": {
134
+ "did": "did:web:knowthat.ai:agents:my-server",
135
+ "signature": "0x3045...",
136
+ "timestamp": "2025-01-31T10:00:00Z",
137
+ "conformanceLevel": 1
138
+ }
139
+ }
140
+ ```
141
+
142
+ ## License
143
+
144
+ MIT
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@kya-os/mcp-i",
3
+ "version": "0.1.0-alpha.1",
4
+ "description": "MCP-I auto-registration client for 2-line MCP server identity",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist",
9
+ "README.md",
10
+ "LICENSE"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc",
14
+ "test": "jest",
15
+ "lint": "eslint src --ext .ts",
16
+ "clean": "rm -rf dist",
17
+ "prepublishOnly": "npm run clean && npm run build && npm run test",
18
+ "publish:alpha": "npm publish --tag alpha"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/vouched/kya-os.git",
23
+ "directory": "packages/mcp-i"
24
+ },
25
+ "keywords": [
26
+ "kya-os",
27
+ "mcp-i",
28
+ "mcp",
29
+ "identity",
30
+ "auto-registration",
31
+ "agent"
32
+ ],
33
+ "author": "Dylan Hobbs <dylan.hobbs@vouched.id>",
34
+ "license": "MIT",
35
+ "dependencies": {
36
+ "@kya-os/core": "^0.1.0-alpha.1",
37
+ "@kya-os/identity": "^0.1.0-alpha.1",
38
+ "axios": "^1.6.7",
39
+ "dotenv": "^16.5.0"
40
+ },
41
+ "devDependencies": {
42
+ "@types/jest": "^29.5.12",
43
+ "@types/node": "^20.11.24",
44
+ "jest": "^29.7.0",
45
+ "ts-jest": "^29.1.2",
46
+ "typescript": "^5.4.2"
47
+ },
48
+ "publishConfig": {
49
+ "access": "public"
50
+ }
51
+ }