63.11 HANDOFF Cursor Mcp E2e Test
Documentation for Sessions
Handoff: MCP External Access End-to-End Test
Session: 63.11 Date: 2026-01-23 Handoff To: Cursor Agent (with browser capabilities) Priority: P0
Context
The MCP external access API has been deployed and verified working on Railway. The endpoints are responding correctly:
| Endpoint | Status | Auth |
|---|---|---|
GET /ai-api/mcp/health |
Operational | Public |
GET /ai-api/mcp/openapi.yaml |
Working | Public |
POST /ai-api/mcp/preflight |
401 | Required |
POST /ai-api/mcp/tools/call |
401 | Required |
GET /ai-api/mcp/tools |
401 | Required |
GET /ai-api/mcp/agents |
401 | Required |
What's missing: We need to test the complete flow with actual authentication.
Your Mission
Test the complete MCP external access flow end-to-end:
Step 1: Create MCP Project (via GoGrab Space UI)
- Navigate to
https://gograb.space - Log in (or create account if needed)
- Go to AI Hub → MCP Projects (or similar navigation)
- Create a new MCP project
- Capture the API Key - it's only shown once!
- Note the Project ID
Step 2: Test Authenticated Endpoints
Use the captured credentials to test:
# Set your credentials
API_KEY="mcp_your_api_key_here"
PROJECT_ID="your_project_id_here"
# Test 1: Get available tools
curl -X GET "https://ai-api.gograb.space/ai-api/mcp/tools" \
-H "X-MCP-API-Key: $API_KEY" \
-H "X-MCP-Project-Id: $PROJECT_ID"
# Test 2: Preflight (get context for a task)
curl -X POST "https://ai-api.gograb.space/ai-api/mcp/preflight" \
-H "Content-Type: application/json" \
-H "X-MCP-API-Key: $API_KEY" \
-H "X-MCP-Project-Id: $PROJECT_ID" \
-d '{"task": "Testing MCP external access"}'
# Test 3: Log a decision
curl -X POST "https://ai-api.gograb.space/ai-api/mcp/tools/call" \
-H "Content-Type: application/json" \
-H "X-MCP-API-Key: $API_KEY" \
-H "X-MCP-Project-Id: $PROJECT_ID" \
-d '{
"tool": "log_decision",
"arguments": {
"type": "implementation",
"question": "Testing MCP external access",
"chosen": "Verified API endpoints working",
"reasoning": "End-to-end test from Cursor agent",
"confidence": 0.9
}
}'
# Test 4: Find similar decisions
curl -X POST "https://ai-api.gograb.space/ai-api/mcp/tools/call" \
-H "Content-Type: application/json" \
-H "X-MCP-API-Key: $API_KEY" \
-H "X-MCP-Project-Id: $PROJECT_ID" \
-d '{
"tool": "find_similar",
"arguments": {
"query": "MCP external access"
}
}'
# Test 5: Get agents list
curl -X GET "https://ai-api.gograb.space/ai-api/mcp/agents" \
-H "X-MCP-API-Key: $API_KEY" \
-H "X-MCP-Project-Id: $PROJECT_ID"
# Test 6: Get usage stats
curl -X GET "https://ai-api.gograb.space/ai-api/mcp/usage" \
-H "X-MCP-API-Key: $API_KEY" \
-H "X-MCP-Project-Id: $PROJECT_ID"
Step 3: Verify Project Database Isolation
After logging a decision, verify it was stored in the project's isolated database:
- The decision should appear in
find_similarresults - Usage stats should increment
Step 4: Test OpenAI Functions Export
curl -X GET "https://ai-api.gograb.space/ai-api/mcp/openai/functions" \
-H "X-MCP-API-Key: $API_KEY" \
-H "X-MCP-Project-Id: $PROJECT_ID"
This should return OpenAI-compatible function definitions.
Expected Results
| Test | Expected Result |
|---|---|
| Create Project | Project created, API key generated |
| GET /tools | List of available MCP tools |
| POST /preflight | Context with patterns, conventions |
| POST /tools/call (log_decision) | Decision logged successfully |
| POST /tools/call (find_similar) | Returns logged decision |
| GET /agents | List of agent experts |
| GET /usage | Usage statistics for project |
| GET /openai/functions | OpenAI function definitions |
If Something Fails
401 Unauthorized
- Verify API key format: should start with
mcp_ - Verify Project ID matches the project
- Check if API key was regenerated
404 Not Found
- Endpoint might not exist
- Check the OpenAPI spec:
https://ai-api.gograb.space/ai-api/mcp/openapi.yaml
500 Server Error
- Check Railway logs for backend-ai-api
- Report the error message in the test results
Report Template
After testing, create a report at:
docs/english/sessions/editor2/session-63/63.12-TEST-RESULTS-mcp-e2e.md
Include:
- Project creation: Success/Fail
- Each endpoint test result
- Any errors encountered
- Screenshots if relevant
- Recommendations for fixes
Related Files
- Controller:
apis/backend-ai-api/src/app/mcp-gateway/mcp-gateway.controller.ts - Auth Guard:
apis/backend-ai-api/src/app/mcp-gateway/guards/jwt-or-api-key.guard.ts - Tools Bridge:
apis/backend-ai-api/src/app/mcp-gateway/services/mcp-tools-bridge.service.ts - OpenAPI Spec:
apis/backend-ai-api/src/app/mcp-gateway/openapi/mcp-openapi.yaml
Success Criteria
- MCP project created via UI
- API key works for authentication
- All tool endpoints respond correctly
- Decisions are stored in project database
- Usage tracking increments
- OpenAI functions export works
Handoff created by Claude Code. Ready for Cursor agent pickup.