@kya-os/create-mcpi-app 0.6.4-canary.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 (110) hide show
  1. package/.eslintrc.cjs +10 -0
  2. package/.turbo/turbo-build.log +25 -0
  3. package/README.md +290 -0
  4. package/dist/bundles/blank.js +98817 -0
  5. package/dist/bundles/ecommerce.js +98891 -0
  6. package/dist/bundles/hardware-world.js +99289 -0
  7. package/dist/bundles/manifest.json +23 -0
  8. package/dist/cli-runner.d.ts +2 -0
  9. package/dist/cli-runner.d.ts.map +1 -0
  10. package/dist/cli-runner.js +407 -0
  11. package/dist/cli-runner.js.map +1 -0
  12. package/dist/effects/index.d.ts +14 -0
  13. package/dist/effects/index.d.ts.map +1 -0
  14. package/dist/effects/index.js +51 -0
  15. package/dist/effects/index.js.map +1 -0
  16. package/dist/helpers/apply-identity-preset.d.ts +14 -0
  17. package/dist/helpers/apply-identity-preset.d.ts.map +1 -0
  18. package/dist/helpers/apply-identity-preset.js +169 -0
  19. package/dist/helpers/apply-identity-preset.js.map +1 -0
  20. package/dist/helpers/config-builder.d.ts +53 -0
  21. package/dist/helpers/config-builder.d.ts.map +1 -0
  22. package/dist/helpers/config-builder.js +46 -0
  23. package/dist/helpers/config-builder.js.map +1 -0
  24. package/dist/helpers/copy-template.d.ts +2 -0
  25. package/dist/helpers/copy-template.d.ts.map +1 -0
  26. package/dist/helpers/copy-template.js +11 -0
  27. package/dist/helpers/copy-template.js.map +1 -0
  28. package/dist/helpers/create.d.ts +31 -0
  29. package/dist/helpers/create.d.ts.map +1 -0
  30. package/dist/helpers/create.js +136 -0
  31. package/dist/helpers/create.js.map +1 -0
  32. package/dist/helpers/fetch-cloudflare-mcpi-template.d.ts +25 -0
  33. package/dist/helpers/fetch-cloudflare-mcpi-template.d.ts.map +1 -0
  34. package/dist/helpers/fetch-cloudflare-mcpi-template.js +558 -0
  35. package/dist/helpers/fetch-cloudflare-mcpi-template.js.map +1 -0
  36. package/dist/helpers/fetch-cloudflare-template.d.ts +11 -0
  37. package/dist/helpers/fetch-cloudflare-template.d.ts.map +1 -0
  38. package/dist/helpers/fetch-cloudflare-template.js +338 -0
  39. package/dist/helpers/fetch-cloudflare-template.js.map +1 -0
  40. package/dist/helpers/fetch-mcpi-template.d.ts +13 -0
  41. package/dist/helpers/fetch-mcpi-template.d.ts.map +1 -0
  42. package/dist/helpers/fetch-mcpi-template.js +237 -0
  43. package/dist/helpers/fetch-mcpi-template.js.map +1 -0
  44. package/dist/helpers/fetch-xmcp-template.d.ts +13 -0
  45. package/dist/helpers/fetch-xmcp-template.d.ts.map +1 -0
  46. package/dist/helpers/fetch-xmcp-template.js +127 -0
  47. package/dist/helpers/fetch-xmcp-template.js.map +1 -0
  48. package/dist/helpers/generate-cloudflare-files.d.ts +89 -0
  49. package/dist/helpers/generate-cloudflare-files.d.ts.map +1 -0
  50. package/dist/helpers/generate-cloudflare-files.js +1541 -0
  51. package/dist/helpers/generate-cloudflare-files.js.map +1 -0
  52. package/dist/helpers/generate-config.d.ts +2 -0
  53. package/dist/helpers/generate-config.d.ts.map +1 -0
  54. package/dist/helpers/generate-config.js +105 -0
  55. package/dist/helpers/generate-config.js.map +1 -0
  56. package/dist/helpers/generate-identity.d.ts +38 -0
  57. package/dist/helpers/generate-identity.d.ts.map +1 -0
  58. package/dist/helpers/generate-identity.js +123 -0
  59. package/dist/helpers/generate-identity.js.map +1 -0
  60. package/dist/helpers/get-package-versions.d.ts +37 -0
  61. package/dist/helpers/get-package-versions.d.ts.map +1 -0
  62. package/dist/helpers/get-package-versions.js +92 -0
  63. package/dist/helpers/get-package-versions.js.map +1 -0
  64. package/dist/helpers/identity-manager.d.ts +23 -0
  65. package/dist/helpers/identity-manager.d.ts.map +1 -0
  66. package/dist/helpers/identity-manager.js +144 -0
  67. package/dist/helpers/identity-manager.js.map +1 -0
  68. package/dist/helpers/index.d.ts +14 -0
  69. package/dist/helpers/index.d.ts.map +1 -0
  70. package/dist/helpers/index.js +18 -0
  71. package/dist/helpers/index.js.map +1 -0
  72. package/dist/helpers/install.d.ts +3 -0
  73. package/dist/helpers/install.d.ts.map +1 -0
  74. package/dist/helpers/install.js +57 -0
  75. package/dist/helpers/install.js.map +1 -0
  76. package/dist/helpers/kta-registration.d.ts +58 -0
  77. package/dist/helpers/kta-registration.d.ts.map +1 -0
  78. package/dist/helpers/kta-registration.js +77 -0
  79. package/dist/helpers/kta-registration.js.map +1 -0
  80. package/dist/helpers/rename.d.ts +2 -0
  81. package/dist/helpers/rename.d.ts.map +1 -0
  82. package/dist/helpers/rename.js +15 -0
  83. package/dist/helpers/rename.js.map +1 -0
  84. package/dist/helpers/validate-project-structure.d.ts +14 -0
  85. package/dist/helpers/validate-project-structure.d.ts.map +1 -0
  86. package/dist/helpers/validate-project-structure.js +102 -0
  87. package/dist/helpers/validate-project-structure.js.map +1 -0
  88. package/dist/index.d.ts +3 -0
  89. package/dist/index.d.ts.map +1 -0
  90. package/dist/index.js +18 -0
  91. package/dist/index.js.map +1 -0
  92. package/dist/utils/check-node.d.ts +2 -0
  93. package/dist/utils/check-node.d.ts.map +1 -0
  94. package/dist/utils/check-node.js +12 -0
  95. package/dist/utils/check-node.js.map +1 -0
  96. package/dist/utils/fetch-remote-config.d.ts +74 -0
  97. package/dist/utils/fetch-remote-config.d.ts.map +1 -0
  98. package/dist/utils/fetch-remote-config.js +109 -0
  99. package/dist/utils/fetch-remote-config.js.map +1 -0
  100. package/dist/utils/is-folder-empty.d.ts +2 -0
  101. package/dist/utils/is-folder-empty.d.ts.map +1 -0
  102. package/dist/utils/is-folder-empty.js +55 -0
  103. package/dist/utils/is-folder-empty.js.map +1 -0
  104. package/dist/utils/validate-project-name.d.ts +15 -0
  105. package/dist/utils/validate-project-name.d.ts.map +1 -0
  106. package/dist/utils/validate-project-name.js +106 -0
  107. package/dist/utils/validate-project-name.js.map +1 -0
  108. package/index.js +4 -0
  109. package/package.json +73 -0
  110. package/vitest.integration.config.ts +16 -0
package/.eslintrc.cjs ADDED
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: ["eslint-config-custom"],
4
+ ignorePatterns: [
5
+ "dist/**",
6
+ "test-temp/**",
7
+ "node_modules/**",
8
+ "coverage/**",
9
+ ],
10
+ };
@@ -0,0 +1,25 @@
1
+
2
+ > @kya-os/create-mcpi-app@0.6.4-canary.1 build /home/runner/_work/xmcp-i/xmcp-i/packages/create-mcpi-app
3
+ > tsc && chmod +x dist/index.js && node --import tsx scripts/build-bundles.ts
4
+
5
+ 🔨 Building template bundles...
6
+
7
+
8
+ 📦 Building template: blank
9
+ ✅ Source files written to /home/runner/_work/xmcp-i/xmcp-i/packages/create-mcpi-app/dist/.tmp-bundles/blank
10
+ ✅ Bundle built: 4136616 bytes, hash: sha256:9305db9eaee79...
11
+
12
+ 📦 Building template: hardware-world
13
+ ✅ Source files written to /home/runner/_work/xmcp-i/xmcp-i/packages/create-mcpi-app/dist/.tmp-bundles/hardware-world
14
+ ✅ Bundle built: 4149017 bytes, hash: sha256:280677709274a...
15
+
16
+ 📦 Building template: ecommerce
17
+ ✅ Source files written to /home/runner/_work/xmcp-i/xmcp-i/packages/create-mcpi-app/dist/.tmp-bundles/ecommerce
18
+ ✅ Bundle built: 4138310 bytes, hash: sha256:70e6a65263b81...
19
+
20
+ ✅ All bundles built successfully!
21
+ Output: /home/runner/_work/xmcp-i/xmcp-i/packages/create-mcpi-app/dist/bundles
22
+ Version: 0.6.4-canary.1
23
+ Framework: 1.7.75
24
+ Templates: blank, hardware-world, ecommerce
25
+ Manifest: /home/runner/_work/xmcp-i/xmcp-i/packages/create-mcpi-app/dist/bundles/manifest.json
package/README.md ADDED
@@ -0,0 +1,290 @@
1
+ <div align="center">
2
+ <a href="https://github.com/modelcontextprotocol-identity/xmcp-i">
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/modelcontextprotocol-identity/xmcp-i/main/assets/mcp-i-logo-dark.png">
5
+ <img alt="MCP-I logo" src="https://raw.githubusercontent.com/modelcontextprotocol-identity/xmcp-i/main/assets/mcp-i-logo-light.png" height="128">
6
+ </picture>
7
+ </a>
8
+ <h1>create-mcpi-app</h1>
9
+
10
+ <a href="https://github.com/modelcontextprotocol-identity/xmcp-i"><img alt="MCP-I" src="https://img.shields.io/badge/MCP--I-000000.svg?style=for-the-badge&labelColor=000"></a>
11
+ <a href="https://www.npmjs.com/package/@kya-os/create-mcpi-app"><img alt="NPM version" src="https://img.shields.io/npm/v/@kya-os/create-mcpi-app.svg?style=for-the-badge&labelColor=000000"></a>
12
+ <a href="https://github.com/modelcontextprotocol-identity/xmcp-i/blob/main/license.md"><img alt="License" src="https://img.shields.io/npm/l/@kya-os/create-mcpi-app.svg?style=for-the-badge&labelColor=000000"></a>
13
+
14
+ </div>
15
+
16
+ ## Create AI Agents You Actually Own
17
+
18
+ Bootstrap MCP applications with cryptographic identity built-in. Get complete control over your agent's capabilities and permissions.
19
+
20
+ ## Quick Start
21
+
22
+ ```bash
23
+ npx create-mcpi-app@latest my-agent
24
+ cd my-agent
25
+ npm run dev
26
+ ```
27
+
28
+ Your agent now has its own cryptographic identity!
29
+
30
+ - **Generated Identity**: Ed25519 keys and DID automatically created
31
+ - **Claim Ownership**: Register at knowthat.ai to claim your agent
32
+ - **Secure Operation**: All responses cryptographically signed by your agent
33
+ - **Permission Control**: Delegate and revoke capabilities as needed
34
+
35
+ ## Command Line Options
36
+
37
+ ```bash
38
+ npx create-mcpi-app [agent-name] [options]
39
+ ```
40
+
41
+ ## Platform Options
42
+
43
+ Choose where to deploy your owned agent:
44
+
45
+ - `-p, --platform <platform>` - Target deployment platform (default: "standalone")
46
+ - `standalone` - Self-contained agent server
47
+ - `cloudflare` - Cloudflare Workers with Durable Objects and SSE support
48
+ - `vercel` - Vercel edge runtime with KV identity storage
49
+ - `lambda` - AWS Lambda with DynamoDB identity persistence
50
+ - `nextjs` - Next.js API routes with integrated identity
51
+ - `express` - Express.js server with identity middleware
52
+
53
+ ## General Options
54
+
55
+ - `-t, --template <template>` - Agent template (default: "typescript")
56
+ - `--skip-install` - Skip dependency installation
57
+ - `--no-git` - Skip git initialization
58
+ - `--yes` - Skip interactive prompts and use defaults
59
+ - `--verbose` - Detailed output during agent creation
60
+
61
+ ## Examples
62
+
63
+ ```bash
64
+ # Create a standalone agent you can own
65
+ npx create-mcpi-app my-personal-agent
66
+
67
+ # Create a Cloudflare Workers MCP server
68
+ npx create-mcpi-app my-cloudflare-agent --platform cloudflare
69
+
70
+ # Quick creation without prompts
71
+ npx create-mcpi-app my-quick-agent --yes
72
+ ```
73
+
74
+ ## Generated Project Structure
75
+
76
+ ```
77
+ my-agent/
78
+ ├── src/
79
+ │ ├── index.ts # Main agent server (~40 lines - super clean!)
80
+ │ ├── mcpi-runtime-config.ts # Runtime configuration (~50 lines)
81
+ │ └── tools/ # Your business logic only
82
+ │ └── greet.ts # Example tool
83
+ ├── wrangler.toml # Cloudflare Workers config
84
+ ├── package.json # Dependencies
85
+ └── README.md # Quick start guide
86
+ ```
87
+
88
+ **Key Features:**
89
+ - **Next.js-Style Architecture**: All framework complexity hidden in `@kya-os/mcp-i-cloudflare`
90
+ - **Consent Pages**: Server-hosted consent flow with XSS prevention
91
+ - **Auto-Detection**: Server URL automatically detected from requests
92
+ - **Clean Code**: Only your business logic visible - no implementation details
93
+
94
+ ## Platform-Specific Features
95
+
96
+ ### Cloudflare - Edge MCP Servers
97
+
98
+ - **Global Edge Network**: Deploy MCP servers to 300+ cities worldwide
99
+ - **SSE & HTTP Streaming**: Full MCP protocol support with Server-Sent Events
100
+ - **Durable Objects**: Built-in state management for MCP sessions
101
+ - **Zero Cold Starts**: Instant response times with Durable Objects
102
+ - **KV Storage**: Efficient nonce caching for security
103
+ - **Consent Pages**: Server-hosted consent flow with auto-detection
104
+ - **XSS Prevention**: Secure consent page rendering with CSP headers
105
+ - **Proof Batching**: Automatic proof submission with cron-based flushing
106
+
107
+ #### Proof Batching & Cron Jobs
108
+
109
+ MCP-I automatically batches proofs for efficient submission to AgentShield. Proofs are:
110
+
111
+ 1. **Batched within requests**: When multiple tools are called, proofs are collected and submitted together
112
+ 2. **Auto-flush on batch size**: When 10 proofs accumulate, they're automatically flushed
113
+ 3. **First proof immediate**: The first proof is submitted immediately (not batched) for dashboard setup detection
114
+
115
+ **Cron Configuration (Currently Disabled):**
116
+
117
+ ⚠️ **Note**: Cloudflare Workers cron triggers are currently experiencing API parsing issues that prevent deployment. The cron trigger is commented out by default in the generated `wrangler.toml`.
118
+
119
+ Proofs work correctly without cron because:
120
+ - First proof submits immediately (ensures dashboard setup detection)
121
+ - Proofs auto-flush when batch size is reached (default: 10 proofs)
122
+ - Cron is only needed for flushing small batches that haven't reached the size limit
123
+
124
+ If you want to enable cron-based flushing in the future, uncomment the section in `wrangler.toml`:
125
+
126
+ ```toml
127
+ [[triggers.crons]]
128
+ cron = "*/5 * * * *" # Every 5 minutes (recommended)
129
+ ```
130
+
131
+ **Note**: If deployment fails with "Could not parse request body" when cron is enabled, this indicates a Cloudflare API issue. Keep cron commented out - proofs will still work correctly.
132
+
133
+ **Verifying Proof Submission:**
134
+
135
+ 1. Check Cloudflare Worker logs for `[ProofService]` messages:
136
+ - `[ProofService] Initialized:` - Service started successfully
137
+ - `[ProofService] Enqueuing proof` - Proof added to batch queue
138
+ - `[ProofService] ✅ Proofs accepted` - Proofs submitted successfully
139
+
140
+ 2. View proofs in AgentShield dashboard:
141
+ - Navigate to `/proofs` page for your project
142
+ - Proofs appear within 5 minutes of tool execution
143
+
144
+ 3. Verify tool discovery:
145
+ - Navigate to `/tools` page
146
+ - Tools are automatically discovered from proof submissions
147
+ - Ensure `MCP_SERVER_URL` is set correctly (without `/mcp` suffix)
148
+
149
+ ### Vercel - Edge Identity
150
+
151
+ - **Edge Runtime**: Fast cold starts with cached identity context
152
+ - **KV Storage**: Secure identity persistence with Vercel KV
153
+ - **Environment**: Automatic identity configuration via environment variables
154
+ - **Zero Config**: Deploy with `vercel --prod` and identity works immediately
155
+
156
+ ### AWS Lambda - Serverless Identity
157
+
158
+ - **Cold Start Optimized**: Minimal initialization time with identity caching
159
+ - **DynamoDB**: Secure, scalable identity storage with DynamoDB
160
+ - **IAM Policies**: Pre-configured identity permissions and access control
161
+ - **Serverless**: Ready-to-deploy serverless framework configuration
162
+
163
+ ### Next.js - Full-Stack Identity
164
+
165
+ - **API Routes**: Identity-enabled API endpoints with automatic verification
166
+ - **SSR Support**: Server-side identity rendering and ownership verification
167
+ - **Middleware**: Request-level identity verification and permission checking
168
+ - **Client Integration**: Full-stack identity features for complete applications
169
+
170
+ ### Express - Identity Middleware
171
+
172
+ - **Middleware Stack**: Identity verification middleware for existing apps
173
+ - **Flexible Routing**: Identity-aware route handlers and permission checking
174
+ - **Production Ready**: Battle-tested middleware for production workloads
175
+ - **Custom Auth**: Extensible identity providers and authentication flows
176
+
177
+ ### Standalone
178
+
179
+ - **File-based Persistence**: Local identity storage
180
+ - **Self-contained Deployment**: No external dependencies
181
+ - **Docker Ready**: Containerized deployment support
182
+ - **Process Management**: PM2 and systemd configurations
183
+
184
+ ## Adding to Existing Projects
185
+
186
+ For existing Node.js/TypeScript projects, use the MCP-I CLI:
187
+
188
+ ```bash
189
+ npm install -g @kya-os/cli
190
+ mcpi init
191
+ ```
192
+
193
+ This automatically detects your framework (Next.js, Express, or standalone) and adds identity features without disrupting your existing codebase.
194
+
195
+ ## Getting Started with MCP-I
196
+
197
+ ### Step 1: Install MCP-I
198
+
199
+ ```bash
200
+ cd my-existing-agent
201
+ npm install @kya-os/mcp-i
202
+ ```
203
+
204
+ ### Step 2: Generate Identity
205
+
206
+ ```bash
207
+ # Install CLI globally
208
+ npm install -g @kya-os/cli
209
+
210
+ # Initialize identity (development)
211
+ mcpi init
212
+
213
+ # Check identity status
214
+ mcpi check
215
+ ```
216
+
217
+ ### Step 3: Integrate Identity
218
+
219
+ ```javascript
220
+ import { enableMCPIdentity } from "@kya-os/mcp-i";
221
+
222
+ const server = await enableMCPIdentity({
223
+ name: "my-agent",
224
+ description: "My AI agent with identity"
225
+ });
226
+ ```
227
+
228
+ ## Troubleshooting
229
+
230
+ ### Common Issues
231
+
232
+ #### Identity Generation Fails
233
+
234
+ ```bash
235
+ # Regenerate identity manually
236
+ mcpi rotate --force
237
+ mcpi init
238
+ ```
239
+
240
+ #### Platform Detection Issues
241
+
242
+ ```bash
243
+ # Force platform selection with verbose output
244
+ npx create-mcpi-app my-agent --platform vercel --verbose
245
+ ```
246
+
247
+ #### Dependencies Issues
248
+
249
+ ```bash
250
+ # Skip install and run manually
251
+ npx create-mcpi-app my-agent --no-install
252
+ cd my-agent && npm install
253
+ ```
254
+
255
+ #### Identity File Missing
256
+
257
+ ```bash
258
+ # Ensure identity exists before starting
259
+ npm run init
260
+ npm run dev
261
+ ```
262
+
263
+ ### Debug Mode
264
+
265
+ ```bash
266
+ # Enable verbose logging for troubleshooting
267
+ npx create-mcpi-app my-agent --verbose
268
+
269
+ # Check generated files without installation
270
+ npx create-mcpi-app my-agent --no-install --verbose
271
+ ```
272
+
273
+ ## Next Steps
274
+
275
+ After creating your agent:
276
+
277
+ 1. **Start Development**: `npm run dev` to start your agent locally
278
+ 2. **View Your Identity**: Run `mcpi check` to see your agent's DID
279
+ 3. **Learn More**: Read the full [MCP-I documentation](https://github.com/modelcontextprotocol-identity/xmcp-i) for advanced features
280
+ 4. **Deploy**: Use platform-specific deployment guides in the MCP-I repo
281
+
282
+ ## Learn More
283
+
284
+ - [MCP-I Documentation](https://github.com/modelcontextprotocol-identity/xmcp-i) - Core framework and advanced features
285
+ - [Model Context Protocol](https://modelcontextprotocol.io) - Core protocol specification
286
+ - [KYA-OS](https://kya-os.com) - Learn more about the KYA-OS ecosystem
287
+
288
+ ## License
289
+
290
+ This project is licensed under the MIT License - see the [LICENSE](https://github.com/modelcontextprotocol-identity/xmcp-i/blob/main/license.md) file for details.