> ## Documentation Index
> Fetch the complete documentation index at: https://reedai-07fa30f1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Model Context Protocol (MCP)

> Connect ZeroTwo with any tool or service using the Model Context Protocol - extensible integrations for unlimited possibilities

## What is MCP?

The Model Context Protocol (MCP) is an open protocol that allows ZeroTwo to connect with virtually any tool, service, or data source. Unlike traditional integrations that require custom development for each service, MCP provides a standardized way to extend ZeroTwo's capabilities infinitely.

<Note>
  MCP makes ZeroTwo infinitely extensible. Connect to databases, APIs, internal tools, or build custom integrations specific to your workflow.
</Note>

## Why MCP Matters

### Traditional Integrations vs MCP

<Tabs>
  <Tab title="Traditional Approach">
    **Limited by platform decisions**:

    * Only integrations the platform builds
    * Waiting for official support
    * No custom solutions for unique needs
    * Vendor lock-in
  </Tab>

  <Tab title="MCP Approach">
    **Unlimited extensibility**:

    * Connect any tool or service
    * Build custom integrations
    * Community-driven ecosystem
    * Open standard, no lock-in
  </Tab>
</Tabs>

### Key Benefits

<CardGroup cols={2}>
  <Card title="Unlimited Connections" icon="infinity">
    Connect to any service with an API - databases, internal tools, proprietary systems
  </Card>

  <Card title="Custom Workflows" icon="diagram-project">
    Build integrations specific to your business processes and needs
  </Card>

  <Card title="Open Standard" icon="unlock">
    Based on open protocol - not locked into proprietary systems
  </Card>

  <Card title="Community Ecosystem" icon="users">
    Leverage integrations built by the community and contribute your own
  </Card>
</CardGroup>

## Available MCP Integrations

### Productivity & Collaboration

<AccordionGroup>
  <Accordion title="Notion" icon="book">
    **Capabilities**:

    * Read and search Notion pages and databases
    * Create and update pages
    * Query database content
    * Access workspace knowledge base

    **Use Cases**:

    * Search company documentation
    * Create meeting notes automatically
    * Update project databases
    * Reference knowledge base in conversations

    **Example**:

    ```
    Search our Notion workspace for the Q4 planning doc
    Create a new page in the Product Specs database
    ```
  </Accordion>

  <Accordion title="Microsoft Teams" icon="users">
    **Capabilities**:

    * Read team and channel messages
    * Access channel content
    * Search conversations
    * Monitor team activity

    **Use Cases**:

    * Summarize team discussions
    * Find information from past conversations
    * Track project updates
    * Monitor team communications

    **Example**:

    ```
    Summarize this week's discussions in the #engineering channel
    Find all mentions of the new feature launch
    ```
  </Accordion>

  <Accordion title="HubSpot" icon="building">
    **Capabilities**:

    * Access CRM data
    * View contact and company information
    * Track deal pipelines
    * Read marketing campaign data

    **Use Cases**:

    * Analyze customer data
    * Track sales performance
    * Review campaign metrics
    * Generate reports

    **Example**:

    ```
    Show me details about our top 10 deals
    Analyze conversion rates for the Q1 campaign
    ```
  </Accordion>
</AccordionGroup>

### Development Tools

<AccordionGroup>
  <Accordion title="GitHub" icon="github">
    **Capabilities**:

    * Search repositories and code
    * Read issues and pull requests
    * Access commit history
    * View repository structure
    * Create issues and PRs

    **Use Cases**:

    * Code research and examples
    * Issue tracking and management
    * Code review assistance
    * Repository analysis

    **Example**:

    ```
    Find examples of authentication in our codebase
    Show me open issues labeled 'bug'
    Create an issue for the API timeout problem
    ```
  </Accordion>

  <Accordion title="Linear" icon="chart-line">
    **Capabilities**:

    * Access issues and projects
    * Read project status and timelines
    * View team workloads
    * Track issue progress

    **Use Cases**:

    * Project status updates
    * Sprint planning assistance
    * Issue tracking
    * Team coordination

    **Example**:

    ```
    Show me all issues assigned to me
    What's the status of the mobile app project?
    Create a new issue for the login bug
    ```
  </Accordion>
</AccordionGroup>

### Email & Calendar

<AccordionGroup>
  <Accordion title="Outlook Calendar" icon="calendar">
    **Capabilities**:

    * Read calendar events
    * Check availability
    * View upcoming meetings
    * Access event details

    **Use Cases**:

    * Schedule management
    * Meeting preparation
    * Availability checking
    * Calendar analysis

    **Example**:

    ```
    What's on my calendar today?
    Do I have any free time this week?
    Summarize tomorrow's meetings
    ```
  </Accordion>

  <Accordion title="Outlook Email" icon="envelope">
    **Capabilities**:

    * Read emails and threads
    * Search inbox
    * Access email content
    * View attachments

    **Use Cases**:

    * Email summarization
    * Information retrieval
    * Inbox management
    * Follow-up tracking

    **Example**:

    ```
    Summarize unread emails from this week
    Find all emails about the project proposal
    ```
  </Accordion>
</AccordionGroup>

### Database Integrations

<AccordionGroup>
  <Accordion title="PostgreSQL" icon="database">
    **Capabilities**:

    * Execute SQL queries
    * Analyze database schema
    * Performance monitoring
    * Data retrieval and analysis

    **Use Cases**:

    * Database queries in natural language
    * Schema exploration
    * Performance analysis
    * Data reporting

    **Example**:

    ```
    Show me all users created in the last month
    Analyze the structure of the orders table
    ```

    <Warning>
      Database connections require proper authentication and should follow your organization's security policies.
    </Warning>
  </Accordion>

  <Accordion title="Supabase" icon="zap">
    **Capabilities**:

    * Database queries
    * Authentication data access
    * Storage analysis
    * Project insights

    **Use Cases**:

    * Project management
    * User analytics
    * Storage monitoring
    * Performance tracking

    **Example**:

    ```
    Query my Supabase database for active users
    Check storage usage for my project
    ```
  </Accordion>
</AccordionGroup>

### Marketing Tools

<AccordionGroup>
  <Accordion title="Google Ads" icon="ad">
    **Capabilities**:

    * Access campaign data
    * View performance metrics
    * Analyze keyword performance
    * Track ad spend

    **Use Cases**:

    * Campaign performance analysis
    * ROI tracking
    * Keyword research
    * Budget optimization

    **Example**:

    ```
    Show me the performance of my Google Ads campaigns
    Which keywords have the best conversion rate?
    ```
  </Accordion>
</AccordionGroup>

## Setting Up MCP Integrations

### Configuration Process

<Steps>
  <Step title="Navigate to Integrations">
    1. Go to **Settings** > **Integrations**
    2. Find **MCP Integrations** section
    3. Browse available integrations
  </Step>

  <Step title="Select Integration">
    Click on the integration you want to connect (e.g., Notion, GitHub, PostgreSQL)
  </Step>

  <Step title="Provide Credentials">
    Enter required authentication details:

    * **OAuth Services**: Click "Connect" to authorize
    * **API Keys**: Enter your API key or token
    * **Database**: Provide connection string

    <Info>
      Credentials are encrypted and stored securely. ZeroTwo never has access to your credentials.
    </Info>
  </Step>

  <Step title="Configure Permissions">
    Choose what data the integration can access:

    * Read-only access
    * Read and write
    * Specific resource permissions
  </Step>

  <Step title="Test Connection">
    Verify the integration works:

    ```
    Test my Notion connection
    ```

    <Check>
      Connection successful! You can now use this integration in conversations.
    </Check>
  </Step>
</Steps>

### Authentication Types

Different integrations require different authentication methods:

**OAuth 2.0** (Notion, GitHub, Microsoft):

* Click "Connect" button
* Authorize in popup window
* Permissions granted automatically

**API Keys** (Linear, HubSpot):

* Generate API key in the service
* Paste into ZeroTwo settings
* Save and test connection

**Connection Strings** (PostgreSQL, Supabase):

* Provide database connection string
* Include credentials securely
* Test connection before saving

<Warning>
  Never share your API keys or credentials. Each team member should use their own authentication.
</Warning>

## Using MCP in Conversations

### Enabling MCP Tools

MCP integrations work automatically once connected:

1. **Automatic Detection**: AI recognizes when an MCP tool could help
2. **Permission Request**: AI asks before accessing external data
3. **Tool Execution**: AI uses the integration to retrieve information
4. **Response Integration**: Results incorporated into AI response

### Example Workflows

**Research with Multiple Sources**:

```
Search our Notion docs and GitHub repos for authentication examples
```

AI will:

1. Search Notion workspace
2. Search GitHub repositories
3. Combine findings
4. Provide comprehensive answer with citations

**Project Status Update**:

```
Give me a status update on the mobile app project - check Linear, GitHub, and Notion
```

AI will:

1. Query Linear for issue status
2. Check GitHub for recent commits
3. Review Notion project docs
4. Synthesize comprehensive update

**Data Analysis**:

```
Analyze our user growth - check the PostgreSQL database and HubSpot CRM
```

AI will:

1. Query database for user data
2. Access HubSpot for CRM metrics
3. Combine data sources
4. Provide analysis and insights

## Building Custom MCP Integrations

### For Developers

Want to build your own MCP integration? Here's how:

<Steps>
  <Step title="Review MCP Specification">
    Read the [MCP Protocol Documentation](https://modelcontextprotocol.org) to understand the standard.
  </Step>

  <Step title="Choose Your Tool">
    Decide what service or tool you want to integrate:

    * Internal company tools
    * Proprietary databases
    * Custom APIs
    * Specialized services
  </Step>

  <Step title="Implement MCP Server">
    Create an MCP server that:

    * Handles authentication
    * Exposes available operations
    * Processes requests
    * Returns structured responses

    ```python theme={null}
    # Example MCP server structure
    class CustomMCPServer:
        def list_tools(self):
            return {
                "search_internal_docs": {
                    "description": "Search company documentation",
                    "parameters": {...}
                }
            }
        
        def execute_tool(self, tool_name, parameters):
            # Tool implementation
            pass
    ```
  </Step>

  <Step title="Register with ZeroTwo">
    Add your MCP server to ZeroTwo:

    1. Go to Settings > Integrations > Custom MCP
    2. Enter server URL
    3. Configure authentication
    4. Test and activate
  </Step>

  <Step title="Share with Community">
    Consider open-sourcing your integration to help others!
  </Step>
</Steps>

### MCP Server Examples

<CodeGroup>
  ```python Python MCP Server theme={null}
  from mcp import MCPServer, Tool

  server = MCPServer()

  @server.tool()
  async def search_docs(query: str) -> dict:
      """Search internal documentation"""
      results = await internal_search(query)
      return {
          "results": results,
          "source": "internal_docs"
      }

  @server.tool()
  async def get_metrics(metric_name: str) -> dict:
      """Retrieve business metrics"""
      data = await fetch_metric(metric_name)
      return {
          "metric": metric_name,
          "value": data.value,
          "timestamp": data.timestamp
      }

  if __name__ == "__main__":
      server.run()
  ```

  ```javascript Node.js MCP Server theme={null}
  const { MCPServer } = require('@modelcontextprotocol/sdk');

  const server = new MCPServer();

  server.registerTool({
    name: 'query_api',
    description: 'Query internal API',
    parameters: {
      endpoint: 'string',
      method: 'string'
    },
    execute: async ({ endpoint, method }) => {
      const response = await fetch(endpoint, { method });
      return await response.json();
    }
  });

  server.listen(3000);
  ```
</CodeGroup>

## Security & Privacy

### Data Protection

<AccordionGroup>
  <Accordion title="Credential Security">
    * All credentials encrypted at rest
    * TLS encryption in transit
    * No credential sharing between users
    * Secure credential storage with industry standards
    * Automatic credential rotation support
  </Accordion>

  <Accordion title="Access Control">
    * Fine-grained permissions per integration
    * Read-only options for sensitive data
    * IP whitelisting available
    * Activity logging and audit trails
    * Revocable access tokens
  </Accordion>

  <Accordion title="Data Privacy">
    * Data accessed only when needed
    * No permanent storage of external data
    * Compliance with GDPR, SOC 2
    * User consent for all data access
    * Transparent data usage policies
  </Accordion>
</AccordionGroup>

### Best Practices

<Check>
  **Follow these security best practices**:

  * Use read-only access when possible
  * Grant minimum necessary permissions
  * Regularly review connected integrations
  * Rotate credentials periodically
  * Monitor integration activity logs
  * Disconnect unused integrations
  * Use separate credentials for testing
</Check>

## Managing MCP Integrations

### Integration Dashboard

View and manage all your MCP connections:

1. **Settings** > **Integrations** > **MCP**
2. See all connected integrations
3. View last used and activity status
4. Manage permissions and credentials
5. Disconnect or reconfigure as needed

### Usage Monitoring

Track how MCP integrations are being used:

* **Activity Logs**: See when and how integrations are accessed
* **Performance Metrics**: Monitor response times and reliability
* **Error Tracking**: Identify and resolve connection issues
* **Cost Tracking**: Monitor API usage for services with quotas

### Troubleshooting

<AccordionGroup>
  <Accordion title="Connection Failed">
    **Common causes**:

    * Invalid credentials
    * Expired tokens
    * Network connectivity issues
    * Service downtime

    **Solutions**:

    * Verify credentials are correct
    * Refresh authentication
    * Check service status page
    * Test from integration settings
  </Accordion>

  <Accordion title="Permission Denied">
    **Common causes**:

    * Insufficient permissions granted
    * Scopes changed after authorization
    * Account restrictions

    **Solutions**:

    * Reconnect with proper permissions
    * Check account access levels
    * Contact service administrator
  </Accordion>

  <Accordion title="Slow Responses">
    **Common causes**:

    * Large data queries
    * Service rate limiting
    * Network latency

    **Solutions**:

    * Optimize query scope
    * Use pagination for large datasets
    * Cache frequently accessed data
  </Accordion>
</AccordionGroup>

## MCP vs OAuth Integrations

ZeroTwo offers both MCP and traditional OAuth integrations:

| Feature                | MCP Integrations        | OAuth Integrations  |
| ---------------------- | ----------------------- | ------------------- |
| **Setup Complexity**   | Moderate                | Easy                |
| **Extensibility**      | Unlimited               | Limited to built-in |
| **Custom Integration** | Yes                     | No                  |
| **Performance**        | Depends on server       | Optimized           |
| **Maintenance**        | User responsibility     | Platform managed    |
| **Use Cases**          | Power users, developers | General users       |

<Tip>
  Start with OAuth integrations for common services (Gmail, Calendar, Drive). Use MCP for specialized needs and custom integrations.
</Tip>

## Community & Resources

<CardGroup cols={2}>
  <Card title="MCP Specification" icon="book" href="https://modelcontextprotocol.org">
    Official MCP protocol documentation
  </Card>

  <Card title="Integration Examples" icon="code" href="https://github.com/zerothahuman/mcp-examples">
    Sample MCP server implementations
  </Card>

  <Card title="Discord Community" icon="discord" href="https://discord.gg/SmQnnTBf">
    Get help and share custom integrations
  </Card>

  <Card title="Submit Integration" icon="plus">
    Share your MCP integration with the community
  </Card>
</CardGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="OAuth Integrations" icon="link" href="/integrations/google-drive">
    Explore built-in OAuth integrations
  </Card>

  <Card title="Build Custom" icon="hammer" href="https://modelcontextprotocol.org/docs">
    Learn to build your own MCP integrations
  </Card>

  <Card title="Projects" icon="folder" href="/workspaces/create-workspace">
    Use integrations within team projects
  </Card>

  <Card title="Security" icon="shield" href="/privacy/data-and-compliance">
    Learn about data privacy and security
  </Card>
</CardGroup>

<Check>
  MCP makes ZeroTwo infinitely extensible - connect any tool and build workflows specific to your needs.
</Check>
