Testing
Testing strategy and manual testing procedures for MCP Gatekeeper.
Current Testing Status
MCP Gatekeeper currently uses manual testing. Automated test suites are planned for future development.
Manual Testing
Backend Testing
API Endpoints
Test using the interactive API docs:
- Start backend:
npm run dev - Open
http://127.0.0.1:8000/docs - Test each endpoint with sample data
- Verify response codes and data
HTTP Proxy Testing
# Test proxy with curl
curl -X POST http://127.0.0.1:8000/proxy/test_agent/github \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"initialize","id":1,"params":{}}'
Database Testing
Verify database operations:
cd apps/backend
sqlite3 mcpgatekeeper.db
# Check tables
.tables
# Query data
SELECT * FROM http_mcp_servers;
Frontend Testing
UI Components
- Navigation: Test all sidebar links
- Forms: Submit with valid/invalid data
- Tables: Sort, filter, pagination
- Modals: Open, close, form submission
- Theme Toggle: Switch between light/dark
Agent Configuration
- Add server to each agent type
- Verify config file updated
- Test server removal
- Check for file permission errors
HTTP Server Management
- Add HTTP server
- Test connection
- Edit server configuration
- Add to agent
- Verify proxy URL format
- Delete server
Integration Testing
STDIO Server Flow
- Install package from npm
- Add to agent configuration
- Trigger agent to use server
- Verify metrics appear in UI
- Check logs are recorded
HTTP Server Flow
- Add HTTP server (e.g., GitHub MCP)
- Add to agent configuration
- Agent connects through proxy
- Verify proxy logs in backend
- Check metrics in UI
- Verify request/response logged
Cross-platform Testing
Test on:
- macOS: Primary development platform
- Windows: Verify path handling
- Linux: Verify permissions
Agent Compatibility Testing
Test with each supported agent:
- Windsurf: Uses
serverUrl - Amazon Q: Uses
url - Gemini CLI: Uses
httpUrl - Claude Desktop: Uses
url
Browser Testing
Test frontend in:
- Chrome/Edge (Chromium)
- Firefox
- Safari
Test Scenarios
Critical Path
- Start application
- Install STDIO package
- Add HTTP server
- Configure agent with both
- Verify metrics appear
- Check logs are visible
- Test theme switching
Error Scenarios
- Invalid package name
- Network timeout for HTTP server
- Permission denied on config file
- Invalid JSON in requests
- Missing authentication headers
Performance Testing
- Install multiple packages
- Configure multiple HTTP servers
- Generate high metric volume
- Verify UI responsiveness
- Check database query performance
Debugging
Backend Logs
# Backend console shows:
# - HTTP proxy requests/responses
# - Database operations
# - Error stack traces
Frontend Console
// Browser DevTools Console shows:
// - API calls
// - WebSocket messages
// - React errors
Database Inspection
# Check metrics
sqlite3 apps/backend/mcpgatekeeper.db "SELECT * FROM http_server_metrics ORDER BY timestamp DESC LIMIT 10;"
# Check logs
sqlite3 apps/backend/mcpgatekeeper.db "SELECT * FROM server_logs ORDER BY timestamp DESC LIMIT 10;"
Future Testing Plans
- Unit tests: Backend API endpoints, service logic
- E2E tests: Full user workflows with Playwright/Cypress
- Integration tests: Database operations, proxy functionality
- Load tests: High-volume metrics collection
For contributing test cases, see Contributing.