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

# Add MCP Servers

> Connect external services like Gmail, Linear, and Slack to your agents

MCP servers give your agents access to external services -- Gmail, Linear, Slack, HubSpot, and more. Connect them once through DataGen, and they work both locally in Claude Code and in deployed agents.

## Prerequisites: DataGen MCP Must Be Connected

Before adding any external MCP servers, make sure the DataGen MCP server itself is connected to your Claude Code.

If you ran `/datagen:setup` earlier, this is already configured. To verify:

```bash theme={null}
claude mcp list
```

Look for `datagen` in the output. If it's not there, add it manually:

```bash theme={null}
claude mcp add datagen --transport http https://mcp.datagen.dev/mcp -e DATAGEN_API_KEY
```

<Note>
  This requires `DATAGEN_API_KEY` to be set in your environment. If you haven't authenticated yet, run `datagen login` or `/datagen:setup` first.
</Note>

***

## Add via Claude Code

Run the guided skill in Claude Code:

```
/datagen:add-mcps
```

This walks you through:

<Steps>
  <Step title="Choose a service">
    Select from common services (Gmail, Slack, Linear, GitHub, HubSpot, etc.) or provide a custom MCP server URL.
  </Step>

  <Step title="Search built-in servers">
    The plugin checks DataGen's built-in server templates first. If a match is found, it installs automatically with OAuth.
  </Step>

  <Step title="Complete OAuth (if needed)">
    For OAuth-based servers, a browser window opens for authentication. The plugin monitors the flow and confirms when complete.
  </Step>

  <Step title="Verify and show tools">
    Once connected, the plugin shows all new tools available from the service (e.g., `mcp_Linear_list_issues`, `mcp_Gmail_gmail_send_email`).
  </Step>
</Steps>

You can also add a server directly by asking Claude:

```
"Add Linear MCP to DataGen: https://mcp.linear.app/sse"
```

Claude will call `addRemoteMcpServer`, handle the OAuth flow, and confirm the connection.

***

## Add via the Web UI

### Browse the MCP Registry

Navigate to **MCP Servers** in the DataGen sidebar and click the **MCP Registry** tab.

<Frame>
  <img src="https://mintcdn.com/datagen/LWL3BGYwXkq1W4fz/images/mcp/mcp-registry.png?fit=max&auto=format&n=LWL3BGYwXkq1W4fz&q=85&s=35c3128ef996356e28d1441a83f24ad0" alt="MCP Registry" width="1501" height="791" data-path="images/mcp/mcp-registry.png" />
</Frame>

Click **Connect** on any server to start the OAuth flow.

### Add a Custom MCP Server

For servers not in the registry, click **Add Connector**.

<Frame>
  <img src="https://mintcdn.com/datagen/LWL3BGYwXkq1W4fz/images/mcp/add-mcp-dialog.png?fit=max&auto=format&n=LWL3BGYwXkq1W4fz&q=85&s=85f7a6286c870f0b944273adb2adfa8c" alt="Add MCP Server dialog" width="1501" height="791" data-path="images/mcp/add-mcp-dialog.png" />
</Frame>

Fill in:

* **Server Name** -- Display name (e.g., "Linear")
* **Type** -- Transport method: Streamable HTTP, SSE, or STDIO
* **URL** -- The MCP server endpoint
* **Environment Variables** -- Optional variables the server needs

### View Connected Servers

The **Connected** tab shows all your active MCP servers.

<Frame>
  <img src="https://mintcdn.com/datagen/LWL3BGYwXkq1W4fz/images/mcp/mcp-servers-list.png?fit=max&auto=format&n=LWL3BGYwXkq1W4fz&q=85&s=43dcb595f3596802f39f613732833d47" alt="Connected MCP Servers" width="1501" height="791" data-path="images/mcp/mcp-servers-list.png" />
</Frame>

***

## How MCP Works with Agents

When you connect an MCP server through DataGen, the tools become available in two places:

1. **Locally** -- Use tools directly in Claude Code conversations
2. **Deployed agents** -- Your agents and custom tools can call the same MCP tools in production

Connect once, use everywhere. No separate auth setup for each agent.

```python theme={null}
from datagen_sdk import DatagenClient

client = DatagenClient()

# Same MCP tools work locally and in deployed agents
issues = client.execute_tool("mcp_Linear_list_issues", {
    "status": "in_progress",
    "limit": 10
})
```

***

## Commonly Used MCPs

### Official Remote MCP Servers

* **Notion** -- `https://mcp.notion.com/mcp` -- Workspace, content management, databases
* **Linear** -- `https://mcp.linear.app/sse` -- Issue tracking, project management
* **Neon** -- `https://mcp.neon.tech` -- Cloud Postgres database management

### MCP Providers

<AccordionGroup>
  <Accordion icon="link" title="Composio.dev -- 300+ App Integrations">
    **URL**: [composio.dev](https://mcp.composio.dev/)

    Use **HTTP** transport. Popular servers:

    * **Gmail** -- `https://mcp.composio.dev/gmail`
    * **Outlook** -- `https://mcp.composio.dev/outlook`
    * **Dropbox** -- `https://mcp.composio.dev/dropbox`
  </Accordion>

  <Accordion icon="shield" title="Klavis.ai -- SOC 2 Compliant Servers">
    **URL**: [klavis.ai](https://www.klavis.ai/)

    Production-ready with hosted authentication:

    * **Gmail** -- `https://www.klavis.ai/mcp-server-connections/gmail`
    * **GitHub** -- `https://www.klavis.ai/mcp-server-connections/github`
    * **Slack** -- `https://www.klavis.ai/mcp-server-connections/slack`
    * **Jira** -- `https://www.klavis.ai/mcp-server-connections/jira`
    * **Google Drive** -- `https://www.klavis.ai/mcp-server-connections/google-drive`
  </Accordion>

  <Accordion icon="store" title="Smithery.ai -- Open Marketplace">
    **URL**: [smithery.ai](https://smithery.ai/)

    6,800+ MCP servers. Both local and hosted options.
  </Accordion>
</AccordionGroup>

### Community & Custom MCPs

* **Open Source** -- [github.com/modelcontextprotocol/servers](https://github.com/modelcontextprotocol/servers)
* **Custom** -- Use the MCP SDK to build integrations for proprietary systems

***

## Managing Connections

### Reconnect Expired Tokens

Some OAuth tokens expire. To reconnect:

1. Check status with `checkRemoteMcpOauthStatus`
2. Re-authenticate with `ReAuthRemoteMcpServer`

### Update a Server

Use `updateRemoteMcpServer` to change the URL or credentials for a connected server.

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="OAuth flow fails or times out">
    1. Clear browser cookies for the OAuth provider
    2. Try an incognito/private window
    3. Check if your organization blocks OAuth for the service
    4. Re-run the OAuth flow
  </Accordion>

  <Accordion title="Tools not appearing after OAuth">
    1. Wait 1-2 minutes for synchronization
    2. Use `searchTools` to discover newly available tools
    3. Verify `checkRemoteMcpOauthStatus` shows "completed"
    4. Restart Claude Desktop if needed
  </Accordion>

  <Accordion title="Permission denied errors">
    1. Verify you granted all required permissions during OAuth
    2. Some services need admin approval for certain scopes
    3. Re-run the OAuth flow with broader permissions
  </Accordion>
</AccordionGroup>
