> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to the Clay MCP server

The Clay MCP connector routes your AI agent's tool calls to Clay's own MCP server through Scalekit. Each user signs in to Clay once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 17 tools.

**Authentication:** OAuth 2.1/DCR
**Categories:** CRM & Sales, Marketing, Automation
**Tools:** 17: 10 read, 4 write, 3 destructive
**Users sign in with:** OAuth
**OAuth app:** Scalekit's or your own
**Built by:** Vendor MCP
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=CLAYMCP)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Clay MCP connection

   In **AgentKit > Connections**, create a Clay MCP connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

   Scalekit credentials are available for Clay MCP server, so you don't need to register an OAuth app.

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'claymcp'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Clay MCP:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'claymcp_get_credits_available',
     toolInput: { rationale: 'YOUR_RATIONALE' },
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "claymcp"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Clay MCP:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={"rationale":"YOUR_RATIONALE"},
       tool_name="claymcp_get_credits_available",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user signs in once. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'claymcp_add_company_data_points',
  toolInput: {
    dataPoints: [],
    rationale: '<rationale>',
    taskId: '<taskId>',
  },
  connector: 'claymcp',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="claymcp_add_company_data_points",
    tool_input={
        "dataPoints": [],
        "rationale": "<rationale>",
        "taskId": "<taskId>",
    },
    connection_name="claymcp",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `claymcp_add_company_data_points`

Add Company Data Points · Read-only

Add data points to companies in an existing search. Supports enriching ALL companies or specific companies via entityIds. Use for tech stack, funding, headcount, competitors, or any custom research question about companies.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataPoints` (`array`, required): The data points to apply to the company
- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool
- `taskId` (`string`, required): The task ID identifying the search to add company data points to
- `entityIds` (`array`, optional): Optional. Array of entityIds to enrich. When omitted, enriches all companies.

Example input: `{"dataPoints":[],"rationale":"<rationale>","taskId":"<taskId>"}`

### `claymcp_add_contact_data_points`

Add Contact Data Points · Read-only

Add data points to contacts in an existing search. Supports enriching ALL contacts or specific contacts via entityIds. Use for emails, phone numbers, work history, thought leadership, or any custom research question about contacts.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataPoints` (`array`, required): The data points to apply to the contacts
- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool
- `taskId` (`string`, required): The task ID identifying the search to add contact data points to
- `entityIds` (`array`, optional): Optional. Array of entityIds to enrich. When omitted, enriches all contacts.

Example input: `{"dataPoints":[],"rationale":"<rationale>","taskId":"<taskId>"}`

### `claymcp_ask_question_about_accounts`

Ask Question About Accounts · Read-only

Ask a natural language question about one or more accounts available in Clay Audiences. An AI agent analyzes account data including contacts, opportunities, Gong calls, and emails to answer the question.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `accountIds` (`array`, required): Account IDs to analyze (1-10)
- `question` (`string`, required): Natural language question about the accounts
- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool

Example input: `{"accountIds":[],"question":"<question>","rationale":"<rationale>"}`

### `claymcp_get_credits_available`

Get Credits Available · Read-only

Check if credits are available for the workspace. Returns hasWorkspaceCredits, hasSalesRepCredits, and (when credit budgets are enabled) hasBudgetCredits.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool

Example input: `{"rationale":"<rationale>"}`

### `claymcp_get_current_workspace`

Get Current Workspace · Read-only

Report which Clay workspace this connection is pinned to. Returns workspaceName, workspaceId, and workspaceUrl. Use when the user asks which workspace they are connected to, or to confirm where searches and enrichments will run.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool

Example input: `{"rationale":"<rationale>"}`

### `claymcp_get_subroutine_input_options`

Get Subroutine Input Options · Read-only

Fetch the available dropdown options for a subroutine input that has a configured options source.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `inputName` (`string`, required): The name of the input whose options to fetch.
- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool
- `subroutine_id` (`string`, required): The ID of the subroutine.

Example input: `{"inputName":"<inputName>","rationale":"<rationale>","subroutine_id":"<subroutine_id>"}`

### `claymcp_get_task`

Get Task · Read-only

Get task status and results by task ID. Handles all task types (search, direct) and returns the current state. Accepts universal mcp-task-* IDs and legacy cgas-search-id-* IDs.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool
- `taskId` (`string`, required): The task ID to retrieve (mcp-task-* or legacy cgas-search-id-*)
- `page` (`integer`, optional): Optional 1-based page of entities for direct tasks (100 per page). Defaults to 1.

Example input: `{"rationale":"<rationale>","taskId":"<taskId>"}`

### `claymcp_get_task_context`

Get Task Context · Read-only

Retrieve the current state of a task — all entities, enrichment values, and statuses. Call this to get actual enrichment results (emails, phone numbers, work history, custom data points) after a search or enrichment operation.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool
- `taskId` (`string`, required): The task ID to retrieve (mcp-task-* or legacy cgas-search-id-*)
- `entityIds` (`array`, optional): Optional. Pass specific entity IDs to retrieve only those entities. Leave empty or omit to retrieve all entities for the task.
- `page` (`integer`, optional): Optional 1-based page of entities for direct tasks (100 per page). Defaults to 1. Ignored when entityIds is provided.

Example input: `{"rationale":"<rationale>","taskId":"<taskId>"}`

### `claymcp_list_subroutines`

List Subroutines · Read-only

List available custom functions in the workspace. Call this to see their required inputs before using run_subroutine.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool

Example input: `{"rationale":"<rationale>"}`

### `claymcp_query_objects`

Query Objects · Read-only

Query audience accounts, contacts, or deals using natural language. Translates plain language descriptions into structured filters and returns matching entities with field values from Clay Audiences.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `query` (`string`, required): Natural language description of what to filter, e.g. "tech companies with 500+ employees"
- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool
- `audienceName` (`string`, optional): Name of a saved audience segment to scope results to
- `limit` (`integer`, optional): Max rows to return (default 50)
- `offset` (`integer`, optional): Pagination offset (default 0)
- `onlyMine` (`boolean`, optional): When true, restrict account results to the caller's Salesforce-owned accounts

Example input: `{"query":"tech companies with 500+ employees","rationale":"<rationale>"}`

### `claymcp_find_and_enrich_company`

Find and Enrich Company · Write

Find and enrich a single company by domain or LinkedIn URL. Use for prospecting publicly available company info (funding, competitors, tech stack, etc.). Returns a taskId for follow-up enrichment.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `companyIdentifier` (`string`, required): Company identifier (domain like "clay.com" or LinkedIn URL like "https://www.linkedin.com/company/grow-with-clay")
- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool
- `companyDataPoints` (`array`, optional): Optional data points to enrich during search creation

Example input: `{"companyIdentifier":"clay.com","rationale":"<rationale>"}`

### `claymcp_find_and_enrich_contacts_at_company`

Find and Enrich Contacts at Company · Write

Search for contacts at a company by role, title, name, or department. Supports filtering by job title keywords, locations, tenure, certifications, languages, and more. Returns a taskId for follow-up enrichment.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `companyIdentifier` (`string`, required): The company identifier to search for company and contacts. Either a domain (e.g. "clay.com") or a LinkedIn URL (e.g. "https://www.linkedin.com/company/grow-with-clay").
- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool
- `contactFilters` (`object`, optional): No description.
- `dataPoints` (`object`, optional): Optional data points to enrich during search creation

Example input: `{"companyIdentifier":"clay.com","rationale":"<rationale>"}`

### `claymcp_find_and_enrich_list_of_contacts`

Find and Enrich List of Contacts · Write

Find and enrich specific named contacts at their companies. Use when you have a list of specific people by name (e.g. "John Smith at OpenAI"). Returns a taskId for follow-up enrichment.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `contactIdentifiers` (`array`, required): Array of contact identifiers to find and enrich, with their company identifiers
- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool
- `dataPoints` (`object`, optional): Optional data points to enrich during search creation

Example input: `{"contactIdentifiers":[],"rationale":"<rationale>"}`

### `claymcp_track_event`

Track Event · Write

Track an analytics event with optional properties.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `eventName` (`string`, required): The name of the event to track
- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool
- `properties` (`object`, optional): Additional properties to include with the event

Example input: `{"eventName":"<eventName>","rationale":"<rationale>"}`

### `claymcp_run_subroutine`

Run Subroutine · Destructive

Execute a custom function on contacts/companies from an existing search. Use when you have a taskId from a previous search and want to run a subroutine on all or specific contacts. Requires fieldMapping to map entity fields to subroutine inputs.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool
- `subroutine_id` (`string`, required): The ID of the subroutine to execute. Get this from list_subroutines.
- `taskId` (`string`, required): Required. The taskId from the existing search task to add results to.
- `entityIds` (`array`, optional): Optional. Array of entityIds to run on. When omitted with fieldMapping, runs on all contacts.
- `fieldMapping` (`object`, optional): Required for batch mode. Format: { "entityField": "subroutineInput" }. KEY = entity field name, VALUE = subroutine input name.

Example input: `{"rationale":"<rationale>","subroutine_id":"<subroutine_id>","taskId":"<taskId>"}`

### `claymcp_run_subroutine_direct`

Run Subroutine Direct · Destructive

Execute a custom function directly on one or more sets of provided inputs, without needing an existing task or entityIds. Use when the user provides specific input values (LinkedIn URL, name, email, etc.) and wants to run a function on that data directly, for one value or many.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `inputs` (`array`, required): Array of input objects, one per run (max 1000); use a single-element array to run once. Each object's keys must match the input names from list_subroutines.
- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool
- `subroutine_id` (`string`, required): The ID of the subroutine to execute. Get this from list_subroutines.

Example input: `{"inputs":[],"rationale":"<rationale>","subroutine_id":"<subroutine_id>"}`

### `claymcp_run_subroutine_no_mapping`

Run Subroutine No Mapping · Destructive

Run a custom subroutine on search entities. The backend automatically generates the field mapping. Requires a subroutine_id and taskId from an existing search.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `rationale` (`string`, required): Always provide a brief explanation of why you are calling this tool
- `subroutine_id` (`string`, required): The ID of the subroutine to execute.
- `taskId` (`string`, required): The taskId from the existing search.
- `entityIds` (`array`, optional): Optional. Array of entityIds to run on. When omitted, runs on all entities.
- `inputs` (`object`, optional): Optional. Explicit values for inputs the user selected (e.g. dropdown pickers), keyed by input name.

Example input: `{"rationale":"<rationale>","subroutine_id":"<subroutine_id>","taskId":"<taskId>"}`

## Related

Other CRM & Sales connectors ([all 65](/agentkit/connectors/?category=crm-sales)):

- [HubSpot](/agentkit/connectors/hubspot/): Scalekit connector, OAuth, 457 tools
- [Salesforce](/agentkit/connectors/salesforce/): Scalekit connector, OAuth, 74 tools
- [Close](/agentkit/connectors/close/): Scalekit connector, OAuth, 103 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
