@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,486 @@
1
+ # AgentBuilder MCP Server - Production Deployment Guide
2
+
3
+ **Date**: 2026-01-26
4
+ **Current Version**: 0.2.0
5
+ **Target Environment**: Production (Azure AKS)
6
+
7
+ ---
8
+
9
+ ## ⚠️ REQUIRED UPDATES FOR PRODUCTION
10
+
11
+ ### Critical Changes Needed
12
+
13
+ **Current Configuration:** ❌ Pointing to localhost
14
+ **Required Configuration:** ✅ Point to production API
15
+
16
+ ---
17
+
18
+ ## 🔧 Step-by-Step Production Setup
19
+
20
+ ### 1. Update Environment Configuration
21
+
22
+ **File**: `.env`
23
+
24
+ **Current (Development):**
25
+ ```bash
26
+ # AgentBuilder API Base URL
27
+ AGENTBUILDER_API_URL=http://localhost:8000
28
+ ```
29
+
30
+ **Required (Production):**
31
+ ```bash
32
+ # AgentBuilder API Base URL - PRODUCTION
33
+ AGENTBUILDER_API_URL=https://agentsapi.chatslytics.com
34
+
35
+ # Optional: Set log level for production
36
+ LOG_LEVEL=info
37
+ ```
38
+
39
+ **Action Required:**
40
+ ```bash
41
+ cd /Users/shantanuchandra/code/agentbuilder/agentbuilder-mcp-server
42
+
43
+ # Update .env file
44
+ cat > .env << 'EOF'
45
+ # AgentBuilder MCP Server Configuration - PRODUCTION
46
+
47
+ # AgentBuilder API Base URL
48
+ AGENTBUILDER_API_URL=https://agentsapi.chatslytics.com
49
+
50
+ # Optional: Set default auth token (not recommended for security)
51
+ # AGENTBUILDER_AUTH_TOKEN=your_supabase_jwt_token_here
52
+
53
+ # Log level (info, debug, warn, error)
54
+ LOG_LEVEL=info
55
+ EOF
56
+ ```
57
+
58
+ ---
59
+
60
+ ### 2. Rebuild the Server
61
+
62
+ ```bash
63
+ cd /Users/shantanuchandra/code/agentbuilder/agentbuilder-mcp-server
64
+
65
+ # Install dependencies (if not already done)
66
+ npm install
67
+
68
+ # Rebuild with production config
69
+ npm run build
70
+ ```
71
+
72
+ ---
73
+
74
+ ### 3. Update Claude Code Configuration
75
+
76
+ **File**: `~/.claude/settings.local.json`
77
+
78
+ **Current (Development):**
79
+ ```json
80
+ {
81
+ "mcpServers": {
82
+ "agentbuilder": {
83
+ "command": "node",
84
+ "args": ["/Users/shantanuchandra/code/agentbuilder/agentbuilder-mcp-server/dist/index.js"],
85
+ "env": {
86
+ "AGENTBUILDER_API_URL": "http://localhost:8000"
87
+ }
88
+ }
89
+ }
90
+ }
91
+ ```
92
+
93
+ **Required (Production):**
94
+ ```json
95
+ {
96
+ "mcpServers": {
97
+ "agentbuilder": {
98
+ "command": "node",
99
+ "args": ["/Users/shantanuchandra/code/agentbuilder/agentbuilder-mcp-server/dist/index.js"],
100
+ "env": {
101
+ "AGENTBUILDER_API_URL": "https://agentsapi.chatslytics.com",
102
+ "LOG_LEVEL": "info"
103
+ }
104
+ }
105
+ }
106
+ }
107
+ ```
108
+
109
+ **Action Required:**
110
+ ```bash
111
+ # Edit Claude Code settings
112
+ nano ~/.claude/settings.local.json
113
+
114
+ # Or use this command to update automatically:
115
+ cat > ~/.claude/settings.local.json << 'EOF'
116
+ {
117
+ "mcpServers": {
118
+ "agentbuilder": {
119
+ "command": "node",
120
+ "args": ["/Users/shantanuchandra/code/agentbuilder/agentbuilder-mcp-server/dist/index.js"],
121
+ "env": {
122
+ "AGENTBUILDER_API_URL": "https://agentsapi.chatslytics.com",
123
+ "LOG_LEVEL": "info"
124
+ }
125
+ }
126
+ }
127
+ }
128
+ EOF
129
+ ```
130
+
131
+ ---
132
+
133
+ ### 4. Set Up Production Authentication
134
+
135
+ You have **2 options** for production authentication:
136
+
137
+ #### Option A: OAuth 2.0 (Recommended for Production)
138
+
139
+ **Steps:**
140
+
141
+ 1. **Login to AgentBuilder Production Dashboard:**
142
+ ```
143
+ https://agents.chatslytics.com
144
+ ```
145
+
146
+ 2. **Navigate to MCP Connections:**
147
+ - Go to **Settings** → **MCP Connections**
148
+ - Click **"Connect MCP"** button
149
+
150
+ 3. **Complete OAuth Flow:**
151
+ - Authenticate with Supabase
152
+ - Grant permissions
153
+ - Select target workspace
154
+
155
+ 4. **Copy Connection ID:**
156
+ - After OAuth success, copy connection ID
157
+ - Format: `mcp_conn_abc123xyz`
158
+
159
+ 5. **Use in Claude Code:**
160
+ ```
161
+ Connect to my AgentBuilder workspace using connection ID mcp_conn_abc123xyz
162
+ ```
163
+
164
+ **Security Benefits:**
165
+ - ✅ Workspace-scoped access
166
+ - ✅ Automatic token refresh
167
+ - ✅ AES-256-GCM encrypted storage
168
+ - ✅ Multi-tenant isolation
169
+ - ✅ No hardcoded tokens
170
+
171
+ #### Option B: Direct JWT Token (Dev/Test Only)
172
+
173
+ **⚠️ NOT RECOMMENDED for production use**
174
+
175
+ **Steps:**
176
+
177
+ 1. **Get JWT Token:**
178
+ - Login to https://agents.chatslytics.com
179
+ - Open DevTools (F12)
180
+ - Application → Local Storage → supabase.auth.token
181
+ - Copy access_token value
182
+
183
+ 2. **Set in Claude Code:**
184
+ ```
185
+ Set AgentBuilder auth token to eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
186
+ ```
187
+
188
+ **Limitations:**
189
+ - ❌ Token expires (needs manual refresh)
190
+ - ❌ No workspace isolation
191
+ - ❌ Security risk if token leaks
192
+ - ❌ No automatic refresh
193
+
194
+ ---
195
+
196
+ ### 5. Verify Production Connection
197
+
198
+ After setup, test the connection:
199
+
200
+ ```bash
201
+ # In Claude Code, ask:
202
+ "List my AgentBuilder workflows"
203
+ ```
204
+
205
+ **Expected Response:**
206
+ ```
207
+ ✅ Connected to AgentBuilder Production API
208
+ ✅ Found X workflows in your workspace
209
+ ```
210
+
211
+ **Or test with connection validation:**
212
+ ```
213
+ # In Claude Code:
214
+ "Test my AgentBuilder MCP connection"
215
+ ```
216
+
217
+ ---
218
+
219
+ ## 🔍 Verification Checklist
220
+
221
+ Before using in production, verify:
222
+
223
+ - [ ] `.env` updated with `https://agentsapi.chatslytics.com`
224
+ - [ ] `npm run build` completed successfully
225
+ - [ ] `~/.claude/settings.local.json` updated with production URL
226
+ - [ ] Claude Code restarted
227
+ - [ ] MCP server appears in available tools
228
+ - [ ] Connection test succeeds
229
+ - [ ] Can list workflows from production
230
+ - [ ] Authentication working (OAuth or JWT)
231
+
232
+ ---
233
+
234
+ ## 🚨 Common Issues & Solutions
235
+
236
+ ### Issue 1: Connection Refused
237
+
238
+ **Error:**
239
+ ```
240
+ Error: connect ECONNREFUSED 127.0.0.1:8000
241
+ ```
242
+
243
+ **Cause:** Still pointing to localhost
244
+
245
+ **Solution:**
246
+ ```bash
247
+ # Check .env file
248
+ cat /Users/shantanuchandra/code/agentbuilder/agentbuilder-mcp-server/.env
249
+
250
+ # Should show: https://agentsapi.chatslytics.com
251
+ # If not, update it and rebuild:
252
+ npm run build
253
+ ```
254
+
255
+ ### Issue 2: SSL Certificate Error
256
+
257
+ **Error:**
258
+ ```
259
+ Error: unable to verify the first certificate
260
+ ```
261
+
262
+ **Cause:** SSL certificate validation issue
263
+
264
+ **Solution:**
265
+ ```bash
266
+ # Add to Claude Code settings env:
267
+ "NODE_TLS_REJECT_UNAUTHORIZED": "0" # Only for testing!
268
+
269
+ # Better: Ensure production cert is valid
270
+ curl https://agentsapi.chatslytics.com/health
271
+ ```
272
+
273
+ ### Issue 3: Authentication Failed
274
+
275
+ **Error:**
276
+ ```
277
+ Error: 401 Unauthorized
278
+ ```
279
+
280
+ **Cause:** Invalid or expired token
281
+
282
+ **Solution:**
283
+ ```bash
284
+ # For OAuth: Re-do OAuth flow to get fresh connection
285
+ # For JWT: Get new token from browser
286
+
287
+ # Test backend auth manually:
288
+ curl -H "Authorization: Bearer YOUR_TOKEN" \
289
+ https://agentsapi.chatslytics.com/api/v1/workflows
290
+ ```
291
+
292
+ ### Issue 4: CORS Error
293
+
294
+ **Error:**
295
+ ```
296
+ Access to XMLHttpRequest blocked by CORS policy
297
+ ```
298
+
299
+ **Cause:** Backend CORS not allowing MCP requests
300
+
301
+ **Solution:**
302
+ ```bash
303
+ # Verify backend CORS config includes MCP origin
304
+ kubectl get ingress agentbuilder-ingress -o yaml | grep cors
305
+
306
+ # Should include localhost for development
307
+ # For production, MCP runs locally so no CORS issue
308
+ ```
309
+
310
+ ### Issue 5: MCP Server Not Found in Claude Code
311
+
312
+ **Error:**
313
+ ```
314
+ No MCP tools available
315
+ ```
316
+
317
+ **Cause:** Claude Code not loading MCP server
318
+
319
+ **Solution:**
320
+ ```bash
321
+ # 1. Check settings file exists
322
+ cat ~/.claude/settings.local.json
323
+
324
+ # 2. Verify path is correct
325
+ ls -la /Users/shantanuchandra/code/agentbuilder/agentbuilder-mcp-server/dist/index.js
326
+
327
+ # 3. Rebuild if needed
328
+ cd /Users/shantanuchandra/code/agentbuilder/agentbuilder-mcp-server
329
+ npm run build
330
+
331
+ # 4. Restart Claude Code
332
+ ```
333
+
334
+ ---
335
+
336
+ ## 📊 Production vs Development Comparison
337
+
338
+ | Aspect | Development | Production |
339
+ |--------|-------------|------------|
340
+ | **API URL** | http://localhost:8000 | https://agentsapi.chatslytics.com |
341
+ | **Auth Method** | JWT Token (manual) | OAuth 2.0 (recommended) |
342
+ | **Token Refresh** | Manual | Automatic |
343
+ | **Workspace Isolation** | No | Yes |
344
+ | **TLS/SSL** | No | Yes (Let's Encrypt) |
345
+ | **CORS** | Localhost allowed | Not applicable (local MCP) |
346
+ | **Logging** | Debug | Info/Warn |
347
+ | **Token Storage** | Plain text | AES-256-GCM encrypted |
348
+
349
+ ---
350
+
351
+ ## 🔐 Security Best Practices
352
+
353
+ ### Production Deployment
354
+
355
+ 1. **Use OAuth 2.0, not JWT tokens**
356
+ - Tokens auto-refresh
357
+ - Workspace isolation
358
+ - Encrypted storage
359
+
360
+ 2. **Never commit tokens to git**
361
+ - `.env` is in `.gitignore`
362
+ - Use environment variables
363
+
364
+ 3. **Use HTTPS only**
365
+ - Production API: `https://agentsapi.chatslytics.com`
366
+ - Never use `http://` in production
367
+
368
+ 4. **Rotate tokens regularly**
369
+ - OAuth tokens refresh automatically
370
+ - Manual tokens should be rotated monthly
371
+
372
+ 5. **Monitor MCP access**
373
+ - Check backend logs for MCP activity
374
+ - Track workflow creation/execution
375
+
376
+ ---
377
+
378
+ ## 🚀 Quick Production Setup Script
379
+
380
+ Run this script to set up production configuration:
381
+
382
+ ```bash
383
+ #!/bin/bash
384
+
385
+ # Quick production setup for AgentBuilder MCP Server
386
+
387
+ MCP_DIR="/Users/shantanuchandra/code/agentbuilder/agentbuilder-mcp-server"
388
+ CLAUDE_SETTINGS="$HOME/.claude/settings.local.json"
389
+
390
+ echo "🚀 Setting up AgentBuilder MCP Server for Production..."
391
+
392
+ # 1. Update .env
393
+ echo "📝 Updating .env configuration..."
394
+ cat > "$MCP_DIR/.env" << 'EOF'
395
+ # AgentBuilder MCP Server Configuration - PRODUCTION
396
+ AGENTBUILDER_API_URL=https://agentsapi.chatslytics.com
397
+ LOG_LEVEL=info
398
+ EOF
399
+
400
+ # 2. Rebuild server
401
+ echo "🔨 Building MCP server..."
402
+ cd "$MCP_DIR"
403
+ npm install
404
+ npm run build
405
+
406
+ # 3. Update Claude Code settings
407
+ echo "⚙️ Updating Claude Code settings..."
408
+ cat > "$CLAUDE_SETTINGS" << 'EOF'
409
+ {
410
+ "mcpServers": {
411
+ "agentbuilder": {
412
+ "command": "node",
413
+ "args": ["/Users/shantanuchandra/code/agentbuilder/agentbuilder-mcp-server/dist/index.js"],
414
+ "env": {
415
+ "AGENTBUILDER_API_URL": "https://agentsapi.chatslytics.com",
416
+ "LOG_LEVEL": "info"
417
+ }
418
+ }
419
+ }
420
+ }
421
+ EOF
422
+
423
+ # 4. Test connection
424
+ echo "🔍 Testing production API connection..."
425
+ curl -s https://agentsapi.chatslytics.com/health | jq .
426
+
427
+ echo ""
428
+ echo "✅ Production setup complete!"
429
+ echo ""
430
+ echo "Next steps:"
431
+ echo "1. Restart Claude Code"
432
+ echo "2. Set up OAuth 2.0 connection (recommended)"
433
+ echo " - Visit: https://agents.chatslytics.com → Settings → MCP Connections"
434
+ echo " - Complete OAuth flow"
435
+ echo " - Copy connection ID"
436
+ echo "3. In Claude Code, ask: 'Connect to AgentBuilder using connection ID mcp_conn_xxx'"
437
+ echo ""
438
+ echo "Or for quick test (dev/test only):"
439
+ echo "1. Get JWT token from https://agents.chatslytics.com"
440
+ echo "2. In Claude Code, ask: 'Set AgentBuilder auth token to <your-token>'"
441
+ echo ""
442
+ ```
443
+
444
+ **Save as:** `setup-production.sh`
445
+
446
+ **Run:**
447
+ ```bash
448
+ chmod +x setup-production.sh
449
+ ./setup-production.sh
450
+ ```
451
+
452
+ ---
453
+
454
+ ## 📝 Summary
455
+
456
+ ### What Needs to Change
457
+
458
+ | File | Current Value | Required Value | Status |
459
+ |------|--------------|----------------|--------|
460
+ | `.env` | `http://localhost:8000` | `https://agentsapi.chatslytics.com` | ❌ Needs Update |
461
+ | `~/.claude/settings.local.json` | `http://localhost:8000` | `https://agentsapi.chatslytics.com` | ❌ Needs Update |
462
+ | Authentication | JWT (manual) | OAuth 2.0 (auto-refresh) | ⚠️ Recommended |
463
+
464
+ ### Deployment Priority
465
+
466
+ 1. **🔴 Critical** - Update API URL to production
467
+ 2. **🟡 High** - Rebuild MCP server (`npm run build`)
468
+ 3. **🟡 High** - Update Claude Code settings
469
+ 4. **🟢 Medium** - Set up OAuth 2.0 authentication
470
+ 5. **🟢 Medium** - Test production connection
471
+
472
+ ---
473
+
474
+ ## 🎯 Next Steps
475
+
476
+ 1. Run the quick setup script above
477
+ 2. Set up OAuth 2.0 connection in production dashboard
478
+ 3. Test workflow creation in Claude Code
479
+ 4. Deploy agents to production using MCP
480
+
481
+ ---
482
+
483
+ **Last Updated**: 2026-01-26
484
+ **Backend Version**: v20260126 (deployed)
485
+ **MCP Server Version**: 0.2.0
486
+ **Production API**: https://agentsapi.chatslytics.com