Skip to main content

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:

  1. Start backend: npm run dev
  2. Open http://127.0.0.1:8000/docs
  3. Test each endpoint with sample data
  4. 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

  1. Navigation: Test all sidebar links
  2. Forms: Submit with valid/invalid data
  3. Tables: Sort, filter, pagination
  4. Modals: Open, close, form submission
  5. Theme Toggle: Switch between light/dark

Agent Configuration

  1. Add server to each agent type
  2. Verify config file updated
  3. Test server removal
  4. Check for file permission errors

HTTP Server Management

  1. Add HTTP server
  2. Test connection
  3. Edit server configuration
  4. Add to agent
  5. Verify proxy URL format
  6. Delete server

Integration Testing

STDIO Server Flow

  1. Install package from npm
  2. Add to agent configuration
  3. Trigger agent to use server
  4. Verify metrics appear in UI
  5. Check logs are recorded

HTTP Server Flow

  1. Add HTTP server (e.g., GitHub MCP)
  2. Add to agent configuration
  3. Agent connects through proxy
  4. Verify proxy logs in backend
  5. Check metrics in UI
  6. 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

  1. Start application
  2. Install STDIO package
  3. Add HTTP server
  4. Configure agent with both
  5. Verify metrics appear
  6. Check logs are visible
  7. Test theme switching

Error Scenarios

  1. Invalid package name
  2. Network timeout for HTTP server
  3. Permission denied on config file
  4. Invalid JSON in requests
  5. Missing authentication headers

Performance Testing

  1. Install multiple packages
  2. Configure multiple HTTP servers
  3. Generate high metric volume
  4. Verify UI responsiveness
  5. 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.