@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,358 @@
1
+ # MCP Server - Local Development Testing Guide
2
+
3
+ ## ✅ Connection Test Results
4
+
5
+ **Date**: 2026-01-09
6
+ **Status**: All Systems Operational
7
+
8
+ ### Test Summary
9
+
10
+ | Component | Status | Details |
11
+ |-----------|--------|---------|
12
+ | Backend API | ✅ Running | Port 8000, responding to requests |
13
+ | MongoDB | ✅ Connected | Docker container running |
14
+ | API Documentation | ✅ Accessible | http://127.0.0.1:8000/docs |
15
+ | MCP OAuth Endpoints | ✅ Available | Returns 403 (auth required, as expected) |
16
+ | MCP Server | ✅ Built | TypeScript compiled to dist/index.js |
17
+
18
+ ---
19
+
20
+ ## 🚀 Quick Start Testing
21
+
22
+ ### 1. Verify Backend is Running
23
+
24
+ ```bash
25
+ curl http://127.0.0.1:8000/api/v1/health
26
+ # Should return: {"status":"healthy",...}
27
+ ```
28
+
29
+ ### 2. Run Connection Test
30
+
31
+ ```bash
32
+ cd /Users/shantanuchandra/code/agentbuilder/agentbuilder-mcp-server
33
+ node test-connection.js
34
+ ```
35
+
36
+ Expected output:
37
+ ```
38
+ ✅ Backend is reachable
39
+ ✅ API documentation accessible
40
+ ✅ Database is connected (auth required, as expected)
41
+ ✅ MCP OAuth endpoints available (403 = auth required)
42
+ ```
43
+
44
+ ### 3. Test MCP Server Directly
45
+
46
+ ```bash
47
+ # The MCP server runs on stdio (standard input/output)
48
+ node dist/index.js
49
+ # Should output: "AgentBuilder MCP Server running on stdio"
50
+ # Press Ctrl+C to exit
51
+ ```
52
+
53
+ ---
54
+
55
+ ## 🔧 Claude Code Configuration
56
+
57
+ ### Step 1: Create Claude Desktop Config Directory
58
+
59
+ ```bash
60
+ mkdir -p ~/Library/Application\ Support/Claude
61
+ ```
62
+
63
+ ### Step 2: Configure MCP Server
64
+
65
+ Edit (or create) `~/Library/Application Support/Claude/claude_desktop_config.json`:
66
+
67
+ ```json
68
+ {
69
+ "mcpServers": {
70
+ "agentbuilder": {
71
+ "command": "node",
72
+ "args": [
73
+ "/Users/shantanuchandra/code/agentbuilder/agentbuilder-mcp-server/dist/index.js"
74
+ ],
75
+ "env": {
76
+ "AGENTBUILDER_API_URL": "http://127.0.0.1:8000"
77
+ }
78
+ }
79
+ }
80
+ }
81
+ ```
82
+
83
+ **Note**: A template is available at `claude_desktop_config.example.json`
84
+
85
+ ### Step 3: Restart Claude Desktop
86
+
87
+ After saving the configuration:
88
+ 1. Quit Claude Desktop completely
89
+ 2. Restart Claude Desktop
90
+ 3. The MCP server will load automatically
91
+
92
+ ---
93
+
94
+ ## 🧪 Testing with Claude Code
95
+
96
+ ### Option 1: Dev/Test Mode (Quick Testing)
97
+
98
+ 1. **Get a test JWT token**:
99
+ ```bash
100
+ # Login to your local frontend (http://localhost:5173)
101
+ # Open browser DevTools → Network tab
102
+ # Copy the Authorization header from any API request
103
+ # Example: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
104
+ ```
105
+
106
+ 2. **In Claude Code, run**:
107
+ ```
108
+ User: Use the set_auth_token tool with token "eyJhbGc..."
109
+
110
+ Claude: ✅ Auth token set (dev/test mode)
111
+ ```
112
+
113
+ 3. **Test workflow creation**:
114
+ ```
115
+ User: Create a workflow called "Test Workflow" with a single start node
116
+
117
+ Claude: [Creates workflow via AgentBuilder API]
118
+ ✅ Workflow created successfully!
119
+ ```
120
+
121
+ ### Option 2: Production OAuth Mode (Recommended)
122
+
123
+ **Prerequisites**:
124
+ - Frontend running on http://localhost:5173
125
+ - Backend running on http://127.0.0.1:8000
126
+
127
+ 1. **Create MCP Connection in Dashboard**:
128
+ ```bash
129
+ # 1. Open frontend
130
+ open http://localhost:5173/settings/mcp
131
+
132
+ # 2. Click "Connect MCP" button
133
+ # 3. Complete OAuth flow
134
+ # 4. Copy connection ID (format: mcp_conn_abc123xyz)
135
+ ```
136
+
137
+ 2. **In Claude Code, connect**:
138
+ ```
139
+ User: Connect to AgentBuilder using connection ID mcp_conn_abc123xyz
140
+
141
+ Claude: ✅ Successfully connected to AgentBuilder workspace: "default"
142
+
143
+ Connection Status: active
144
+ Connection ID: mcp_conn_abc123xyz
145
+
146
+ You can now create workflows, and they will be saved to this workspace.
147
+ ```
148
+
149
+ 3. **Create workflows**:
150
+ ```
151
+ User: Create a workflow that sends a welcome email to new users
152
+
153
+ Claude: [Creates workflow with email node]
154
+ ✅ Workflow created in workspace: default
155
+ ```
156
+
157
+ ---
158
+
159
+ ## 📊 Available MCP Tools
160
+
161
+ When the MCP server is configured in Claude Code, the following tools become available:
162
+
163
+ ### Core Tools
164
+
165
+ | Tool | Description | Example |
166
+ |------|-------------|---------|
167
+ | `set_connection` | Connect with OAuth connection ID (PRODUCTION) | `Connect using mcp_conn_123` |
168
+ | `set_auth_token` | Set JWT token (DEV/TEST ONLY) | `Use set_auth_token with token "eyJ..."` |
169
+ | `list_workflows` | List user's workflows | `Show my workflows` |
170
+ | `get_workflow` | Get workflow details | `Get workflow with ID wf_123` |
171
+ | `create_workflow` | Create new workflow | `Create a workflow to send emails` |
172
+ | `update_workflow` | Update existing workflow | `Update workflow wf_123` |
173
+ | `delete_workflow` | Delete workflow | `Delete workflow wf_123` |
174
+
175
+ ---
176
+
177
+ ## 🔍 Troubleshooting
178
+
179
+ ### MCP Server Not Loading in Claude Code
180
+
181
+ **Check**:
182
+ 1. Config file path is correct
183
+ 2. Absolute path to `dist/index.js` is correct
184
+ 3. Node.js is installed (`node --version`)
185
+ 4. MCP server builds successfully (`npm run build`)
186
+
187
+ **View logs**:
188
+ ```bash
189
+ # macOS
190
+ tail -f ~/Library/Logs/Claude/mcp*.log
191
+
192
+ # Check for errors in Claude Desktop console
193
+ ```
194
+
195
+ ### Backend Connection Fails
196
+
197
+ **Check**:
198
+ ```bash
199
+ # 1. Backend is running
200
+ curl http://127.0.0.1:8000/api/v1/health
201
+
202
+ # 2. MongoDB is running
203
+ docker ps | grep mongo
204
+
205
+ # 3. Check backend logs
206
+ tail -f /tmp/backend.log
207
+ ```
208
+
209
+ **Restart backend**:
210
+ ```bash
211
+ cd /Users/shantanuchandra/code/agentbuilder/backend
212
+ source venv/bin/activate
213
+ python -m uvicorn app.main:app --reload --port 8000
214
+ ```
215
+
216
+ ### Authentication Errors
217
+
218
+ **Test token validity**:
219
+ ```bash
220
+ # Get token from frontend DevTools
221
+ TOKEN="your_jwt_token_here"
222
+
223
+ curl -H "Authorization: Bearer $TOKEN" \
224
+ http://127.0.0.1:8000/api/v1/workflows
225
+
226
+ # Should return 200 with workflows or 401 if token invalid
227
+ ```
228
+
229
+ ### MCP OAuth Endpoints Not Found
230
+
231
+ **Verify router is loaded**:
232
+ ```bash
233
+ # Check backend logs for MCP OAuth router registration
234
+ grep -i "mcp.*oauth" /tmp/backend.log
235
+
236
+ # Test endpoint directly
237
+ curl http://127.0.0.1:8000/api/v1/mcp/connections
238
+ # Should return 401 or 403 (not 404)
239
+ ```
240
+
241
+ ---
242
+
243
+ ## 🌐 Environment Switching
244
+
245
+ ### Local Development → Production
246
+
247
+ 1. **Update .env**:
248
+ ```bash
249
+ # Change from:
250
+ AGENTBUILDER_API_URL=http://127.0.0.1:8000
251
+
252
+ # To:
253
+ AGENTBUILDER_API_URL=https://api.agentbuilder.com
254
+ ```
255
+
256
+ 2. **Update Claude Desktop config**:
257
+ ```json
258
+ {
259
+ "mcpServers": {
260
+ "agentbuilder": {
261
+ "command": "node",
262
+ "args": ["/absolute/path/to/dist/index.js"],
263
+ "env": {
264
+ "AGENTBUILDER_API_URL": "https://api.agentbuilder.com"
265
+ }
266
+ }
267
+ }
268
+ }
269
+ ```
270
+
271
+ 3. **Restart Claude Desktop**
272
+
273
+ 4. **Use production OAuth**:
274
+ - Create connection in production dashboard
275
+ - Use `set_connection` with production connection ID
276
+
277
+ ---
278
+
279
+ ## 📝 Development Workflow
280
+
281
+ ### Making Changes to MCP Server
282
+
283
+ 1. **Edit TypeScript source**:
284
+ ```bash
285
+ vim src/index.ts
286
+ ```
287
+
288
+ 2. **Rebuild**:
289
+ ```bash
290
+ npm run build
291
+ ```
292
+
293
+ 3. **Restart Claude Desktop** to load new version
294
+
295
+ 4. **Test changes** in Claude Code
296
+
297
+ ### Testing API Changes
298
+
299
+ 1. **Update backend code**:
300
+ ```bash
301
+ # Backend auto-reloads with --reload flag
302
+ # Make changes in backend/app/**
303
+ ```
304
+
305
+ 2. **Test with curl**:
306
+ ```bash
307
+ curl -X POST http://127.0.0.1:8000/api/v1/mcp/oauth/initiate \
308
+ -H "Authorization: Bearer $TOKEN" \
309
+ -H "Content-Type: application/json" \
310
+ -d '{"workspace_name": "test"}'
311
+ ```
312
+
313
+ 3. **Test with MCP server** in Claude Code
314
+
315
+ ---
316
+
317
+ ## 🎯 Current Test Status
318
+
319
+ ### ✅ Working
320
+ - [x] Backend API running on port 8000
321
+ - [x] MongoDB connection established
322
+ - [x] MCP OAuth endpoints registered
323
+ - [x] MCP server builds successfully
324
+ - [x] TypeScript compilation working
325
+ - [x] Environment configuration (.env)
326
+ - [x] Request interceptor (X-MCP-Connection-ID header)
327
+ - [x] Dev/test mode (set_auth_token)
328
+ - [x] Production OAuth mode (set_connection)
329
+
330
+ ### ⚠️ Needs Testing
331
+ - [ ] Complete OAuth flow in local development
332
+ - [ ] Workflow creation via MCP
333
+ - [ ] Token auto-refresh
334
+ - [ ] Connection revocation
335
+ - [ ] Workspace isolation
336
+ - [ ] Rate limiting
337
+
338
+ ### 🔄 Next Steps
339
+ 1. Start frontend: `cd frontend && npm run dev`
340
+ 2. Create MCP connection via dashboard
341
+ 3. Test OAuth flow end-to-end
342
+ 4. Create workflows via Claude Code
343
+ 5. Verify workspace isolation
344
+
345
+ ---
346
+
347
+ ## 📚 Additional Resources
348
+
349
+ - **MCP Server README**: [README.md](./README.md)
350
+ - **Getting Started Guide**: [GETTING_STARTED.md](./GETTING_STARTED.md)
351
+ - **Backend API Docs**: http://127.0.0.1:8000/docs
352
+ - **Project Documentation**: `/Users/shantanuchandra/code/agentbuilder/docs/`
353
+
354
+ ---
355
+
356
+ **Last Updated**: 2026-01-09
357
+ **Tested By**: Claude Code Integration Test
358
+ **Environment**: Local Development (macOS)