@chandshantanu/agentbuilder-mcp-server 0.2.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.
@@ -0,0 +1,514 @@
1
+ # Agent Creation MCP Tools - Integration Test Plan
2
+
3
+ ## Overview
4
+ This document outlines the integration tests for the new agent creation tools added to the AgentBuilder MCP server.
5
+
6
+ ## Test Environment Setup
7
+
8
+ ### Prerequisites
9
+ 1. Backend API running at `https://agentsapi.chatslytics.com`
10
+ 2. Valid MCP connection ID (format: `mcp_conn_xxx`)
11
+ 3. Seller account credentials: `shantanu.chandra@banxwayglobal.com`
12
+ 4. Claude Code with MCP server configured
13
+
14
+ ### Setup Steps
15
+ ```bash
16
+ # 1. Build MCP server
17
+ cd agentbuilder-mcp-server
18
+ npm run build
19
+
20
+ # 2. Verify connection
21
+ # In Claude Code, run:
22
+ # set_connection with connection_id: mcp_conn_xxx
23
+ ```
24
+
25
+ ## Test Cases
26
+
27
+ ### Test 1: Create Agent (create_agent)
28
+
29
+ **Objective**: Create a new agent with basic information
30
+
31
+ **Input**:
32
+ ```json
33
+ {
34
+ "name": "Test Instagram DM Agent",
35
+ "description": "Test agent for Instagram DM sales automation",
36
+ "type": "conversational",
37
+ "category": "Sales",
38
+ "tags": ["instagram", "sales", "automation"],
39
+ "is_public": false
40
+ }
41
+ ```
42
+
43
+ **Expected Output**:
44
+ - ✅ Status: Success
45
+ - ✅ Agent created with draft status
46
+ - ✅ Returns agent_id and slug
47
+ - ✅ Next steps displayed
48
+
49
+ **Validation**:
50
+ - Agent appears in database with status "draft"
51
+ - Creator ID matches authenticated user
52
+ - Slug is URL-friendly
53
+
54
+ ---
55
+
56
+ ### Test 2: Set Wizard Configuration (set_agent_wizard_config)
57
+
58
+ **Objective**: Configure onboarding wizard for the agent
59
+
60
+ **Prerequisites**: Completed Test 1 (have agent_id)
61
+
62
+ **Input**:
63
+ ```json
64
+ {
65
+ "agent_id": "<from_test_1>",
66
+ "wizard_configuration": {
67
+ "required_oauth_providers": ["facebook", "instagram"],
68
+ "required_credentials": [
69
+ {
70
+ "key": "openrouter_api_key",
71
+ "label": "OpenRouter API Key",
72
+ "type": "api_key",
73
+ "required": true,
74
+ "placeholder": "sk-or-v1-...",
75
+ "help_text": "For AI model inference",
76
+ "validation_regex": "^sk-or-v1-"
77
+ }
78
+ ],
79
+ "required_platform_config": [
80
+ {
81
+ "key": "platform_type",
82
+ "label": "E-Commerce Platform",
83
+ "type": "select",
84
+ "options": ["shopify", "woocommerce"],
85
+ "required": true
86
+ },
87
+ {
88
+ "key": "shopify_store_url",
89
+ "label": "Shopify Store URL",
90
+ "type": "url",
91
+ "required": true,
92
+ "depends_on": "platform_type=shopify",
93
+ "placeholder": "https://store.myshopify.com"
94
+ }
95
+ ],
96
+ "custom_wizard_steps": [
97
+ {
98
+ "step_id": "instagram_account",
99
+ "title": "Select Instagram Account",
100
+ "description": "Choose which Instagram account to use",
101
+ "component_name": "InstagramPageSelector",
102
+ "after_step": "oauth",
103
+ "required": true
104
+ }
105
+ ],
106
+ "configuration_defaults": {
107
+ "sync_frequency": "realtime",
108
+ "product_fields": ["name", "price", "description"]
109
+ }
110
+ }
111
+ }
112
+ ```
113
+
114
+ **Expected Output**:
115
+ - ✅ Status: Success
116
+ - ✅ Wizard configuration saved
117
+ - ✅ Validation passed
118
+ - ✅ OAuth providers validated
119
+ - ✅ Credential fields validated
120
+
121
+ **Validation**:
122
+ - Run validation checks:
123
+ - All OAuth providers are valid
124
+ - Credential fields have required properties
125
+ - Platform config types are valid
126
+ - Conditional logic (depends_on) references existing fields
127
+
128
+ **Error Cases**:
129
+ - Invalid OAuth provider → Error with list of valid providers
130
+ - Missing required field in credential → Error specifying which field
131
+ - Select field without options → Error
132
+ - Invalid depends_on reference → Warning
133
+
134
+ ---
135
+
136
+ ### Test 3: Set Agent Graph (set_agent_graph)
137
+
138
+ **Objective**: Define LangGraph workflow for agent execution
139
+
140
+ **Prerequisites**: Completed Test 1 and Test 2
141
+
142
+ **Input**:
143
+ ```json
144
+ {
145
+ "agent_id": "<from_test_1>",
146
+ "graph": {
147
+ "nodes": [
148
+ {
149
+ "id": "webhook_receiver",
150
+ "type": "webhook",
151
+ "config": {
152
+ "path": "/webhook/instagram"
153
+ }
154
+ },
155
+ {
156
+ "id": "classify_intent",
157
+ "type": "llm_classifier",
158
+ "config": {
159
+ "model": "openai/gpt-4o",
160
+ "categories": ["product_inquiry", "support", "general"]
161
+ }
162
+ },
163
+ {
164
+ "id": "search_products",
165
+ "type": "vector_search",
166
+ "config": {
167
+ "index_name": "products",
168
+ "top_k": 5
169
+ }
170
+ },
171
+ {
172
+ "id": "generate_response",
173
+ "type": "llm_chat",
174
+ "config": {
175
+ "model": "openai/gpt-4o"
176
+ }
177
+ },
178
+ {
179
+ "id": "send_reply",
180
+ "type": "api_call",
181
+ "config": {
182
+ "method": "POST",
183
+ "url": "https://graph.facebook.com/v18.0/{page_id}/messages"
184
+ }
185
+ }
186
+ ],
187
+ "edges": [
188
+ {
189
+ "from": "webhook_receiver",
190
+ "to": "classify_intent"
191
+ },
192
+ {
193
+ "from": "classify_intent",
194
+ "to": "search_products",
195
+ "condition": "intent == 'product_inquiry'"
196
+ },
197
+ {
198
+ "from": "search_products",
199
+ "to": "generate_response"
200
+ },
201
+ {
202
+ "from": "generate_response",
203
+ "to": "send_reply"
204
+ }
205
+ ],
206
+ "entry_point": "webhook_receiver"
207
+ }
208
+ }
209
+ ```
210
+
211
+ **Expected Output**:
212
+ - ✅ Status: Success
213
+ - ✅ Graph saved
214
+ - ✅ Node types validated
215
+ - ✅ Edge references validated
216
+ - ✅ Entry point validated
217
+
218
+ **Validation**:
219
+ - All node types exist in ToolRegistry
220
+ - All edges reference existing nodes
221
+ - Entry point exists in nodes
222
+ - No circular dependencies (warning)
223
+
224
+ **Error Cases**:
225
+ - Invalid node type → Error with list of valid types
226
+ - Edge referencing non-existent node → Error
227
+ - Missing entry_point → Error
228
+ - Entry point not in nodes → Error
229
+
230
+ ---
231
+
232
+ ### Test 4: Validate Agent Configuration (validate_agent_configuration)
233
+
234
+ **Objective**: Pre-publish validation check
235
+
236
+ **Prerequisites**: Completed Tests 1, 2, and 3
237
+
238
+ **Input**:
239
+ ```json
240
+ {
241
+ "agent_id": "<from_test_1>"
242
+ }
243
+ ```
244
+
245
+ **Expected Output**:
246
+ ```json
247
+ {
248
+ "valid": true,
249
+ "errors": [],
250
+ "warnings": [
251
+ "Agent has no icon_url. Consider adding one for better visibility.",
252
+ "Agent has no banner_url. Consider adding one for marketplace display.",
253
+ "Testing status unknown. Ensure agent has been tested before publishing."
254
+ ],
255
+ "checklist": {
256
+ "wizard_configuration": true,
257
+ "agent_graph": true,
258
+ "pricing": true,
259
+ "metadata": true,
260
+ "testing": false
261
+ },
262
+ "agent_id": "<agent_id>",
263
+ "agent_name": "Test Instagram DM Agent"
264
+ }
265
+ ```
266
+
267
+ **Validation Checks**:
268
+ - ✅ Wizard configuration complete
269
+ - ✅ Agent graph defined and valid
270
+ - ✅ Pricing configured
271
+ - ✅ Basic metadata present (name, description, category, type)
272
+ - ⚠️ Optional: icon_url, banner_url (warnings only)
273
+ - ⚠️ Testing status (informational)
274
+
275
+ **Error Cases (if validation fails)**:
276
+ - Missing wizard config → `valid: false`, error in list
277
+ - Missing graph → `valid: false`, error in list
278
+ - Invalid pricing → `valid: false`, error in list
279
+ - Missing metadata → `valid: false`, error in list
280
+
281
+ ---
282
+
283
+ ### Test 5: Publish Agent (publish_agent)
284
+
285
+ **Objective**: Publish agent to marketplace
286
+
287
+ **Prerequisites**: Completed Tests 1-4 with valid=true
288
+
289
+ **Input**:
290
+ ```json
291
+ {
292
+ "agent_id": "<from_test_1>"
293
+ }
294
+ ```
295
+
296
+ **Expected Output (for Seller)**:
297
+ ```json
298
+ {
299
+ "success": true,
300
+ "message": "Agent submitted for review",
301
+ "agent_id": "<agent_id>",
302
+ "agent_name": "Test Instagram DM Agent",
303
+ "status": "pending_review",
304
+ "marketplace_url": "/agents/test-instagram-dm-agent"
305
+ }
306
+ ```
307
+
308
+ **Expected Output (for Admin)**:
309
+ ```json
310
+ {
311
+ "success": true,
312
+ "message": "Agent published successfully",
313
+ "agent_id": "<agent_id>",
314
+ "agent_name": "Test Instagram DM Agent",
315
+ "status": "active",
316
+ "marketplace_url": "/agents/test-instagram-dm-agent"
317
+ }
318
+ ```
319
+
320
+ **Validation**:
321
+ - Seller: Status changes to "pending_review"
322
+ - Admin: Status changes to "active"
323
+ - Agent appears in marketplace (for active)
324
+ - Admins notified (for pending_review)
325
+
326
+ **Error Cases**:
327
+ - Validation fails → Error with validation errors
328
+ - User not owner → 403 Forbidden
329
+ - Agent already published → Error
330
+
331
+ ---
332
+
333
+ ### Test 6: Update Agent (update_agent)
334
+
335
+ **Objective**: Update agent metadata
336
+
337
+ **Prerequisites**: Completed Test 1
338
+
339
+ **Input**:
340
+ ```json
341
+ {
342
+ "agent_id": "<from_test_1>",
343
+ "updates": {
344
+ "description": "Updated: Advanced Instagram DM sales automation with AI",
345
+ "tags": ["instagram", "sales", "automation", "ai"],
346
+ "icon_url": "https://example.com/icon.png",
347
+ "banner_url": "https://example.com/banner.png"
348
+ }
349
+ }
350
+ ```
351
+
352
+ **Expected Output**:
353
+ - ✅ Status: Success
354
+ - ✅ Agent updated
355
+ - ✅ Returns updated agent data
356
+
357
+ **Validation**:
358
+ - Updates applied to database
359
+ - updated_at timestamp changed
360
+
361
+ ---
362
+
363
+ ### Test 7: End-to-End Agent Creation Flow
364
+
365
+ **Objective**: Complete workflow from creation to publishing
366
+
367
+ **Steps**:
368
+ 1. ✅ Create agent (`create_agent`)
369
+ 2. ✅ Set wizard configuration (`set_agent_wizard_config`)
370
+ 3. ✅ Set agent graph (`set_agent_graph`)
371
+ 4. ✅ Add media (icon, banner) (`update_agent`)
372
+ 5. ✅ Validate agent (`validate_agent_configuration`)
373
+ 6. ✅ Publish agent (`publish_agent`)
374
+ 7. ✅ Verify in marketplace (manual check)
375
+
376
+ **Success Criteria**:
377
+ - All steps complete without errors
378
+ - Agent visible in marketplace (if admin) or pending review (if seller)
379
+ - Agent can be subscribed to by users
380
+ - Configuration wizard renders correctly for subscribers
381
+
382
+ ---
383
+
384
+ ## Error Handling Tests
385
+
386
+ ### Test 8: Authorization Errors
387
+
388
+ **Test Cases**:
389
+ 1. Basic user tries to create agent → 403 Forbidden
390
+ 2. Non-owner tries to update agent → 403 Forbidden
391
+ 3. Non-owner tries to publish agent → 403 Forbidden
392
+
393
+ ### Test 9: Validation Errors
394
+
395
+ **Test Cases**:
396
+ 1. Invalid wizard config → 400 Bad Request with errors
397
+ 2. Invalid graph structure → 400 Bad Request with errors
398
+ 3. Publish without wizard config → 400 Bad Request with validation errors
399
+
400
+ ### Test 10: Not Found Errors
401
+
402
+ **Test Cases**:
403
+ 1. Update non-existent agent → 404 Not Found
404
+ 2. Validate non-existent agent → 404 Not Found
405
+ 3. Publish non-existent agent → 404 Not Found
406
+
407
+ ---
408
+
409
+ ## Performance Tests
410
+
411
+ ### Test 11: Large Graph Performance
412
+
413
+ **Objective**: Test with large LangGraph workflow
414
+
415
+ **Input**: Graph with 50+ nodes, 100+ edges
416
+
417
+ **Expected**: Should complete within 5 seconds
418
+
419
+ ### Test 12: Complex Wizard Configuration
420
+
421
+ **Objective**: Test with extensive wizard config
422
+
423
+ **Input**:
424
+ - 5+ OAuth providers
425
+ - 20+ credential fields
426
+ - 30+ platform config fields
427
+ - 10+ custom steps
428
+
429
+ **Expected**: Should validate and save within 3 seconds
430
+
431
+ ---
432
+
433
+ ## Regression Tests
434
+
435
+ ### Test 13: Existing Functionality Unaffected
436
+
437
+ **Verify**:
438
+ - ✅ list_agents still works
439
+ - ✅ get_agent still works
440
+ - ✅ execute_agent still works
441
+ - ✅ deploy_agent still works
442
+ - ✅ Dashboard tools still work
443
+
444
+ ---
445
+
446
+ ## Test Execution Checklist
447
+
448
+ ### Pre-Testing
449
+ - [ ] Backend API is running
450
+ - [ ] Database is accessible
451
+ - [ ] MCP server built and configured
452
+ - [ ] Connection established
453
+ - [ ] Seller account ready
454
+
455
+ ### During Testing
456
+ - [ ] Record all test results
457
+ - [ ] Capture error messages
458
+ - [ ] Note response times
459
+ - [ ] Screenshot UI if applicable
460
+
461
+ ### Post-Testing
462
+ - [ ] Clean up test data
463
+ - [ ] Document any issues found
464
+ - [ ] Report bugs to development team
465
+ - [ ] Update documentation as needed
466
+
467
+ ---
468
+
469
+ ## Test Data Cleanup
470
+
471
+ After testing, clean up with:
472
+
473
+ ```javascript
474
+ // Delete test agents
475
+ db.agents.deleteMany({ name: /^Test/ })
476
+
477
+ // Or specific test agent
478
+ db.agents.deleteOne({ _id: ObjectId("<test_agent_id>") })
479
+ ```
480
+
481
+ ---
482
+
483
+ ## Success Metrics
484
+
485
+ - ✅ All 13 test cases pass
486
+ - ✅ No backend errors in logs
487
+ - ✅ Response times < 5 seconds
488
+ - ✅ Validation catches all error cases
489
+ - ✅ User experience is smooth
490
+ - ✅ Documentation is accurate
491
+
492
+ ---
493
+
494
+ ## Known Limitations
495
+
496
+ 1. **Testing Status**: Cannot automatically validate if agent has been tested
497
+ 2. **Media Upload**: Media URLs must be provided (no upload in MCP)
498
+ 3. **OAuth Flow**: OAuth providers must be pre-configured in backend
499
+
500
+ ---
501
+
502
+ ## Future Enhancements
503
+
504
+ 1. Add automated test runner (Jest/Mocha)
505
+ 2. Add mock backend for unit testing
506
+ 3. Add performance benchmarks
507
+ 4. Add load testing (100+ concurrent agent creations)
508
+ 5. Add E2E tests with actual agent deployment
509
+
510
+ ---
511
+
512
+ **Last Updated**: 2026-02-06
513
+ **Test Plan Version**: 1.0.0
514
+ **Author**: Development Team