Skip to main content

Overview

DataGen can connect to external remote MCP servers to access services like Gmail, LinkedIn, Google Drive, and more. This enables powerful automation workflows that integrate multiple services seamlessly.
Make sure you’ve completed the Add Datagen to Claude guide and have DataGen MCP connected to Claude Desktop before proceeding.

Step-by-Step Setup

Step 1: Add Remote MCP Server

In Claude, ask it to add MCP_You_Want with the MCP URL :

Example: Connect Linear MCP

Ask Claude:“Help me to add Linear MCP to DataGen, its URL is https://mcp.linear.app/sseOr simply:“Add https://mcp.linear.app/sse to DataGen”Claude will first request permission to use the addRemoteMcpServer tool. Once you allow this, Claude will respond with:
  1. Confirmation that Linear MCP server is being added
  2. OAuth authentication link to authorize Linear access
  3. Instructions to complete authentication in your browser

Step 2: Complete OAuth Authentication

You’ll see a response like this:

Claude Response Example

“I’ll help you add the Linear MCP server to DataGen. Let me add it using the provided URL.The Linear MCP server requires OAuth authentication. Please click on this link to authenticate:Authorize Linear MCPAfter you complete the OAuth authentication in your browser, I’ll check the status to confirm the connection is established.”
Authentication Steps:
  1. Click the OAuth link provided by Claude
  2. Sign in to Linear in your browser
  3. Grant permissions to authorize DataGen access
  4. Wait for confirmation - Claude will automatically detect completion
Keep your browser tab open until you see Claude’s success confirmation. The process is automatic once you complete OAuth.

Step 3: Automatic Connection Confirmation

Claude will automatically monitor the OAuth status and confirm when complete:

Success Response

“Perfect! The Linear MCP server has been successfully added to your DataGen setup. The OAuth authentication completed successfully.Now you can use Linear tools in your DataGen workflows.”
No manual status checking needed - Claude handles this automatically!

Step 4: Discover Available Tools

Ask Claude to show you what tools are now available:

Discover Tools

Ask Claude:“What Linear tools do I have access to now?”Claude will respond with something like:“Excellent! The Linear MCP server is now successfully connected and you have access to 25 Linear tools. Here’s what you can do with Linear in DataGen:Core Linear Operations:
  • Issues: List, create, update, get details, add comments
  • Projects: List, create, update, get details
  • Teams: List teams and get team details
  • Users: List users and get user details
  • Documents: List and retrieve Linear documents
Key Tools Available:
  • mcp_Linear_list_issues - List issues with filtering options
  • mcp_Linear_create_issue - Create new issues
  • mcp_Linear_update_issue - Update existing issues
  • mcp_Linear_list_projects - List projects
  • mcp_Linear_create_project - Create new projects*“

Alternative: Add MCP via DataGen UI

You can also add MCP servers directly through the DataGen web interface without using Claude.

Step 1: Go to MCP Servers Page

Navigate to MCP Servers in the DataGen sidebar. You’ll see your connected MCP servers.
MCP Servers list

Step 2: Browse the MCP Registry

Click the MCP Registry tab to see available MCP servers you can connect with one click.
MCP Registry
Click Connect on any server to start the OAuth flow. Already connected servers show “Connected” status.

Step 3: Add Custom MCP Server

For servers not in the registry, click Add Connector to add any MCP server manually.
Add MCP Server dialog
Fill in the details:
  • Server Name: A display name (e.g., “Linear”, “Gmail”)
  • Type: Choose the transport method:
    • Streamable HTTP - Most common for remote MCP servers
    • Server-Sent Events (SSE) - For servers using SSE transport
    • Standard IO (STDIO) - For local MCP servers
  • URL: The MCP server endpoint URL
  • Environment Variables: Optional variables the server needs
Click Add Server to complete the setup. If OAuth is required, you’ll be redirected to authenticate.

How MCP Server Integration Works

  1. Initiate Connection: Use addRemoteMcpServer to connect external services
  2. OAuth Authentication: Complete authentication in your browser
  3. Monitor Status: Use checkRemoteMcpOauthStatus to confirm connection
  4. Discover Tools: Use searchTools to find available automation tools

Commonly Used MCPs

1. Official Remote MCP Servers

These services provide official MCP servers that you can connect directly:

2. Common MCP Tool Providers

URL: https://mcp.composio.dev/Composio provides 300+ app integrations with built-in authentication:
Important: When using Composio MCP servers, choose HTTP for the remote URL transport method.
URL: https://www.klavis.ai/Production-ready, SOC 2 compliant MCP servers with hosted authentication:
URL: https://smithery.ai/The largest open marketplace with 6,835+ MCP skills and extensions:
  • Registry Platform - Discover, install, and manage MCP servers
  • Both Local & Hosted - Choose between self-hosted or Smithery-hosted options
  • Popular Servers - AWS S3, GitHub, Google Drive, Slack, BigQuery, MongoDB, and more

3. Community & Custom MCPs

  • Open Source Servers - https://github.com/modelcontextprotocol/servers - Official MCP servers repository with reference implementations
  • Custom Integrations - Use MCP SDK to create custom integrations for proprietary systems and specialized tools

Detailed Integration Examples

Gmail Integration

# After OAuth completion, Gmail tools become available
# Send automated email
mcp_gmail_send_email({
    "to": "client@example.com",
    "subject": "Weekly Report",
    "body": "Here's your automated weekly report...",
    "attachments": ["report.pdf"]
})

# Search and process emails
emails = mcp_gmail_search_emails({
    "query": "from:leads@company.com newer_than:1d",
    "max_results": 50
})

# Process each email for lead extraction
for email in emails:
    # Extract lead information and update CRM
    pass

LinkedIn Integration

# Connect LinkedIn for prospecting workflows
mcp_linkedin_get_profile({
    "profile_url": "https://linkedin.com/in/prospect",
    "fields": ["experience", "education", "skills"]
})

# Automated connection requests
mcp_linkedin_send_connection_request({
    "profile_id": "prospect_id",
    "message": "Hi [name], I noticed we both work in AI automation..."
})

Google Drive Integration

# Upload workflow results to Drive
mcp_drive_upload_file({
    "filename": "prospecting_results.csv",
    "content": csv_data,
    "folder_id": "shared_folder_id"
})

# Download and process spreadsheets
sheet_data = mcp_drive_download_sheet({
    "sheet_id": "1ABC123...",
    "range": "A1:Z1000"
})

Managing Multiple MCP Connections

View Connected Services

List Connections

Ask Claude:“Show me all connected MCP servers and their available tools”This will display your current integrations and their status.

Reconnect Expired Services

Some OAuth tokens expire and need renewal:
  1. Check Status: Use checkRemoteMcpOauthStatus to identify expired connections
  2. Reconnect: Use reauthRemoteMcpServer for the same service
  3. Update Workflows: Existing workflows will automatically use refreshed tokens

Troubleshooting

Common solutions:
  1. Clear your browser cookies for the OAuth provider
  2. Try using an incognito/private browser window
  3. Check if your organization blocks OAuth for the service
  4. Ensure pop-ups are allowed for the authentication domain
  5. Try the OAuth flow again with a fresh flow_id
Check permissions:
  1. Verify you granted all required permissions during OAuth
  2. Some services require admin approval for certain scopes
  3. Check if your account has access to the requested resources
  4. Re-run the OAuth flow if permissions were insufficient
Troubleshooting steps:
  1. Wait 1-2 minutes for MCP server synchronization
  2. Use searchTools to discover newly available tools
  3. Check checkRemoteMcpOauthStatus shows “completed” status
  4. Restart Claude Desktop if tools still don’t appear
Recovery options:
  1. Check if OAuth token expired using status check
  2. Re-authenticate if token is expired
  3. Implement error handling in your workflows
  4. Use try/catch blocks around MCP tool calls

Best Practices

Security Considerations

OAuth Security

  • Only connect services you actively use
  • Regularly review connected applications in service settings
  • Use dedicated service accounts for automation when possible
  • Monitor OAuth token usage and expiration

Workflow Design

Robust Workflows

  • Always check tool availability before use
  • Implement error handling for API failures
  • Use rate limiting to avoid service throttling
  • Cache frequently accessed data to reduce API calls

Performance Optimization

Efficient Integration

  • Batch API calls when possible
  • Use webhooks instead of polling where available
  • Implement proper retry logic with exponential backoff
  • Monitor API quotas and usage limits

How to Add MCP to Your Agent

The DataGen MCP Gateway acts as a unified bridge for MCP tools. When you connect an MCP server through DataGen, the tools become available in two places simultaneously:
  1. Local Claude Code - Use tools directly in your Claude Desktop/Code conversations
  2. Deployed Agents - Your custom tools and deployments can also access the same MCP tools
Important: MCP tools must be added to DataGen first before they can be used anywhere. Deployed agents can only access MCP tools that have been connected through the DataGen gateway. If you need a new MCP integration, add it via Claude Code/Desktop first.

Step 1: Add MCP to DataGen (One-Time Setup)

Use Claude Code or Claude Desktop to add the MCP server:
"Add Linear MCP to DataGen: https://mcp.linear.app/sse"
Claude will:
  1. Call addRemoteMcpServer to register the server
  2. Provide an OAuth link for authentication
  3. Monitor checkRemoteMcpOauthStatus until complete
Once authenticated, the MCP tools are immediately available everywhere.

Step 2: Use in Claude Code (Local Development)

After setup, you can use the MCP tools directly in conversations:
"Create a Linear issue for the authentication bug we discussed"

"Search my Gmail for emails from leads@company.com this week"

"Post a message to #engineering Slack channel about the deploy"
Claude Code will automatically call the appropriate MCP tools through the DataGen gateway.

Step 3: Use in Deployed Agents (Production)

Your deployed custom tools can access MCP tools that you’ve already connected to DataGen. When writing code for deployment:
from datagen_sdk import DatagenClient

client = DatagenClient()

# Use MCP tools that were previously connected to DataGen
# (Linear and Slack must be added via Claude Code/Desktop first)
issues = client.execute_tool("mcp_Linear_list_issues", {
    "status": "in_progress",
    "limit": 10
})

# Process and send to Slack
for issue in issues:
    client.execute_tool("mcp_Slack_post_message", {
        "channel": "#standup",
        "text": f"In Progress: {issue['title']}"
    })
If you try to use an MCP tool that hasn’t been added to DataGen, you’ll receive an error. Always verify the MCP connection exists by testing in Claude Code first.

Why This Matters

Single Authentication

Authenticate once with DataGen, use everywhere. No need to manage OAuth tokens in each deployment.

Consistent Access

Same tools, same permissions in development and production. What works locally works when deployed.

Centralized Management

Manage all MCP connections in one place. Reconnect expired tokens once, all agents get updated.

Faster Development

Prototype in Claude Code, deploy to production. No configuration changes needed.

Example: End-to-End Workflow

1. Add MCP servers in Claude Code:
"Add these MCP servers to DataGen:
- Gmail: https://mcp.composio.dev/gmail
- Linear: https://mcp.linear.app/sse
- Slack: https://mcp.composio.dev/slack"
2. Test locally:
"Find unread emails about 'urgent', create Linear issues for each,
and notify #support on Slack"
3. Deploy as a custom tool:
# This exact workflow can be deployed as a scheduled job
from datagen_sdk import DatagenClient

client = DatagenClient()

# Search emails
emails = client.execute_tool("mcp_Gmail_search_emails", {
    "query": "is:unread subject:urgent",
    "max_results": 20
})

for email in emails:
    # Create Linear issue
    issue = client.execute_tool("mcp_Linear_create_issue", {
        "title": f"Urgent: {email['subject']}",
        "description": email['snippet'],
        "priority": 1
    })

    # Notify Slack
    client.execute_tool("mcp_Slack_post_message", {
        "channel": "#support",
        "text": f"New urgent issue created: {issue['url']}"
    })

result = {"processed": len(emails)}
4. Schedule or trigger via API: Once deployed, the custom tool runs on schedule or via webhook, using the same MCP connections you set up in step 1.

What’s Next?

Build Workflows

Start building automation workflows with your connected services

Deploy & Schedule

Turn your workflows into production APIs and scheduled jobs