> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing Integrations

> How to test your MCP integrations

## Overview

Test your MCP integrations thoroughly before deploying to production.

## Testing Levels

> [card] Unit Testing
>
> Test individual tools

> [card] Integration Testing
>
> Test with live AI teammates

> [card] Production Testing
>
> Monitor in production

## Unit Testing

### Test Individual Tools

Test each tool in isolation:

**1. Create Test AI teammate**

Create a test AI teammate specifically for testing integrations

**2. Connect MCP Server**

**Test AI teammate ’ Tools ’ Add Tool** ’ Add your MCP server

**3. Open the builder chat**

Open a Site and use the builder chat

**4. Test Each Tool**

```text theme={null}
Test create_customer:
"Create a test customer named John Doe, email john@test.com"

Test get_customer:
"Look up customer john@test.com"

Test update_customer:
"Update john@test.com phone to 555-1234"

Test delete_customer:
"Delete customer john@test.com"
```

### Test Parameters

Test different parameter combinations:

```text theme={null}
# Required parameters
"Create customer with name John and email john@test.com"
’ Should succeed

# Missing required parameter
"Create customer with name John"
’ Should return error: "email is required"

# Invalid parameter type
"Create customer with email 12345"
’ Should return error: "invalid email format"

# Optional parameters
"Create customer John, email john@test.com, phone 555-1234"
’ Should succeed with optional phone
```

### Test Error Cases

Test failure scenarios:

```text theme={null}
# Not found
"Get customer nonexistent@test.com"
’ Should return: "Customer not found"

# Duplicate
"Create customer john@test.com" (already exists)
’ Should return: "Customer already exists"

# Invalid data
"Create customer with email 'invalid-email'"
’ Should return: "Invalid email format"
```

## Integration Testing

### Test with AI teammates

Test your MCP server with real AI teammate workflows:

#### Customer Support Flow

```text theme={null}
Teammate: Support Bot
MCP Server: CRM + Email

Test scenario:
User: "Hi, I need help with my order"
Teammate: "Can you provide your email?"
User: "john@acme.com"
Teammate: *looks up customer in CRM*
       *finds order history*
       "I see your order #12345..."
```

Verify:

* [ ] Customer lookup works
* [ ] Order history retrieved
* [ ] AI teammate uses correct tools

#### Sales Flow

```text theme={null}
Teammate: Sales Assistant
MCP Server: CRM + Calendar + Email

Test scenario:
User: "Schedule a demo for Acme Corp"
Teammate: *creates contact in CRM*
       *finds available calendar slots*
       *schedules meeting*
       *sends calendar invite via email*
       "Demo scheduled for Jan 10 at 2pm"
```

Verify:

* [ ] Contact created
* [ ] Calendar checked
* [ ] Meeting scheduled
* [ ] Email sent

### Multi-Tool Testing

Test tools working together:

```text theme={null}
Scenario: Lead to customer conversion

1. Create lead:
   "Add lead: Jane Doe from TechStart"
   ’ Uses create_lead tool

2. Qualify lead:
   "Check if TechStart exists in database"
   ’ Uses search_company tool

3. Convert to customer:
   "Convert Jane to customer with $50K deal"
   ’ Uses convert_lead and create_deal tools

4. Send welcome email:
   "Email Jane the onboarding guide"
   ’ Uses send_email tool
```

## Automated Testing

### Test Scripts

Create automated test scripts:

```javascript theme={null}
// test-mcp-server.js
const assert = require('assert');

async function testMCPServer(mcpUrl) {
  // Test create
  console.log('Testing create_customer...');
  const createResult = await callTool(mcpUrl, 'create_customer', {
    name: 'Test User',
    email: 'test@example.com'
  });
  assert(createResult.success, 'Create failed');
  console.log(' Create successful');

  // Test read
  console.log('Testing get_customer...');
  const getResult = await callTool(mcpUrl, 'get_customer', {
    email: 'test@example.com'
  });
  assert(getResult.success, 'Get failed');
  assert(getResult.customer.name === 'Test User', 'Name mismatch');
  console.log(' Get successful');

  // Test update
  console.log('Testing update_customer...');
  const updateResult = await callTool(mcpUrl, 'update_customer', {
    email: 'test@example.com',
    phone: '555-1234'
  });
  assert(updateResult.success, 'Update failed');
  console.log(' Update successful');

  // Test delete
  console.log('Testing delete_customer...');
  const deleteResult = await callTool(mcpUrl, 'delete_customer', {
    email: 'test@example.com'
  });
  assert(deleteResult.success, 'Delete failed');
  console.log(' Delete successful');

  console.log('\nAll tests passed! ');
}

// Run tests
testMCPServer('https://mcp.boostgpt.co/your-server-id');
```

### CI/CD Integration

Add tests to your CI/CD pipeline:

```yaml theme={null}
# .github/workflows/test-mcp.yml
name: Test MCP Server

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Test MCP Server
        run: |
          node test-mcp-server.js
        env:
          MCP_URL: ${{ secrets.MCP_URL }}
          API_KEY: ${{ secrets.API_KEY }}
```

## Performance Testing

### Response Time

Test tool response times:

```text theme={null}
Test 1: Simple query
"Get customer john@test.com"
Expected: < 1 second
Actual: 0.5 seconds 

Test 2: Complex query
"List all customers in California with orders over $1000"
Expected: < 3 seconds
Actual: 2.1 seconds 

Test 3: Batch operation
"Create 10 customers"
Expected: < 5 seconds
Actual: 4.2 seconds 
```

### Load Testing

Test under high load:

```javascript theme={null}
// Simulate 100 concurrent requests
async function loadTest() {
  const promises = [];
  for (let i = 0; i < 100; i++) {
    promises.push(
      callTool(mcpUrl, 'get_customer', {
        email: `test${i}@example.com`
      })
    );
  }

  const start = Date.now();
  const results = await Promise.all(promises);
  const duration = Date.now() - start;

  const successCount = results.filter(r => r.success).length;
  console.log(`Completed 100 requests in ${duration}ms`);
  console.log(`Success rate: ${successCount}/100`);
  console.log(`Average: ${duration / 100}ms per request`);
}
```

## Production Testing

### Gradual Rollout

Deploy gradually to production:

**1. Deploy to Test AI teammate**

Test with internal test AI teammate first

**2. Deploy to Staging**

Test with staging environment

**3. Limited Production**

Deploy to 10% of users

**4. Monitor**

Watch logs and metrics for 24 hours

**5. Full Rollout**

Deploy to all users if no issues

### Monitor Metrics

Track key metrics in production:

**Dashboard ’ MCP Servers ’ Your Server ’ Analytics**

| Metric | Target | Alert If |
| - | - | - |
| Success rate | >95% | \<90% |
| Response time | \<2s avg | >5s avg |
| Error rate | \<5% | >10% |
| Requests/min | Varies | Sudden spike |

### A/B Testing

Test changes with A/B testing:

```text theme={null}
Version A (Current):
- MCP Server v1.0
- 50% of users

Version B (New):
- MCP Server v1.1 with optimizations
- 50% of users

Compare:
- Response times
- Error rates
- User satisfaction
```

## Troubleshooting Tests

> [accordion] Test failing unexpectedly
>
> * Check MCP server is running
> * Verify authentication credentials
> * Check API service status
> * Review error logs

> [accordion] Timeouts
>
> * Increase timeout limits
> * Optimize API calls
> * Check network connectivity
> * Review server performance

> [accordion] Inconsistent results
>
> * Check for race conditions
> * Verify test data cleanup
> * Review caching behavior
> * Test in isolation

## Test Checklist

Before deploying to production:

* [ ] All tools tested individually
* [ ] Error cases handled properly
* [ ] Parameter validation working
* [ ] Authentication working
* [ ] Response times acceptable
* [ ] Load testing passed
* [ ] Integration flows tested
* [ ] Documentation updated
* [ ] Logs reviewed
* [ ] Monitoring configured

## Next Steps

> [card] [Debugging Guide](/docs/integrations/guides/debugging.md)
>
> Learn how to debug issues

> [card] [Best Practices](/docs/integrations/guides/best-practices.md)
>
> Follow integration best practices


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.