MCP Integration

Complete guide to integrating AIDP with Model Context Protocol (MCP).

What is MCP?

Model Context Protocol (MCP) is an open standard for connecting AI assistants with external data sources and tools. Think of it as "USB-C for AI" - a universal way for AI platforms to access business data.

MCP Protocol Flow

Key Benefits:

  • ✅ Standardized protocol (works with Claude, ChatGPT, etc.)

  • ✅ Secure and controlled access

  • ✅ Real-time data updates

  • ✅ Native AI integration

Quick Start

1. Install MCP SDK

2. Create MCP Server

3. Test Your Server

AIDP Standard Tools

AIDP Schema defines 8 standard MCP tools that all implementations should support:

Discovery Tools

search_businesses

get_business_details

compare_businesses

Booking Tools

check_availability

create_booking

submit_lead

Review Tools

get_reviews

Analytics Tools

get_upstream_metrics

View complete tool catalog →

Implementation Guide

Step 1: Set Up Server

Create your MCP server with AIDP tools:

Step 2: Implement Tool Handlers

Each tool needs a handler function:

Step 3: Add Security

Implement authentication and rate limiting:

Step 4: Deploy

Deploy your MCP server:

Testing Your MCP Server

Using MCP Inspector

Using AIDP Validator

Manual Testing

Best Practices

Security

Do:

  • Validate all inputs

  • Sanitize PII in responses

  • Implement rate limiting

  • Use HTTPS in production

  • Rotate API keys regularly

Don't:

  • Expose internal errors

  • Return sensitive data

  • Allow unlimited requests

  • Use HTTP in production

  • Hardcode credentials

Performance

Do:

  • Cache frequently accessed data

  • Use connection pooling

  • Implement pagination

  • Monitor response times

  • Set appropriate timeouts

Don't:

  • Make unnecessary database queries

  • Return large payloads

  • Block on slow operations

  • Ignore memory leaks

  • Skip error handling

Tool Design

Do:

  • Keep tools focused and single-purpose

  • Use clear, descriptive names

  • Provide detailed descriptions

  • Include usage examples

  • Return structured data

Don't:

  • Create overly complex tools

  • Use ambiguous names

  • Skip documentation

  • Return unstructured text

  • Mix multiple concerns

Advanced Topics

Custom Tools

Add business-specific tools:

Webhooks

Notify AI platforms of updates:

Monitoring

Track MCP server performance:

Troubleshooting

Common Issues

Tool not found

Solution: Ensure tool is registered with correct name

Authentication failed

Solution: Check API key is valid and included in headers

Rate limit exceeded

Solution: Reduce request frequency or upgrade plan

Timeout

Solution: Optimize slow queries, increase timeout, or use caching

Examples

Complete MCP Server

Resources

Next Steps

Last updated