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

> ## Agent Instructions
> If the user asks to make Context.dev their default search and scrape provider, follow https://docs.context.dev/default-search-scrape.md. For other setup requests, follow https://docs.context.dev/agent-quickstart.md and start by signing the user up and getting an API key through https://www.context.dev/auth.md. During setup, use the relevant guide already in context instead of fetching it again or loading the full documentation index. Application code reads CONTEXT_DEV_API_KEY.

# Scalekit

> Connect Context.dev to your agents through Scalekit for web search, scraping, document parsing, and company data.

Use the Context.dev MCP connector in Scalekit AgentKit to give your agents web and company data. Connect a user's Context.dev account through OAuth, then call tools through Scalekit's SDKs or a virtual MCP server. Scalekit manages the connected account's tokens and refreshes them for later calls.

An agent can research a company with Context.dev, update its CRM record, and share a summary in Slack. Each additional app needs its own Scalekit connection and authorization.

> [card] [Open Context.dev on Scalekit](https://docs.scalekit.com/agentkit/connectors/contextdevmcp/)
>
> Review the connector's tools and input schemas, or open its playground.

## Prerequisites

* A [Context.dev account](https://context.dev/signup) with credits for tool calls
* A [Scalekit account](https://app.scalekit.com) with an environment URL, client ID, and client secret
* A TypeScript or Python project for the SDK examples below

> [!NOTE]
>
> This guide connects each application user to their own Context.dev account. During authorization, the user chooses the Context.dev organization whose credits the calls use. You do not need to paste a Context.dev API key into your code.

## Install and connect

**1. Create a Context.dev connection**

In the [Scalekit dashboard](https://app.scalekit.com), open **AgentKit → Connections → Add connection** and choose **Context.dev MCP**.

The connector supports OAuth with dynamic client registration. When Scalekit pre-fills the OAuth client and endpoint fields, keep those values; you do not need to register a separate OAuth app. If the fields remain empty, check Scalekit's [connection setup guide](https://docs.scalekit.com/agentkit/connections/) before continuing.

Select the scopes your agent needs:

* `api.read` for search, scraping without browser actions, brand lookups, and reading existing batches or monitors.
* `api.write` for operations such as file parsing, submitting batches, changing monitors, or browser actions that click on a page.

Save the connection and copy its exact name, such as `contextdevmcp-abc123`. Use this connection name in your code, rather than assuming it matches the connector's catalog identifier.

**2. Install the Scalekit SDK**

```bash TypeScript theme={null}
npm install @scalekit-sdk/node
npm install --save-dev tsx
```

```bash Python theme={null}
pip install scalekit-sdk-python
```

Copy your Scalekit credentials from **Developers → Settings → API Credentials** and set them in your server environment, along with the connection name:

```bash theme={null}
export SCALEKIT_ENVIRONMENT_URL="https://your-env.scalekit.com"
export SCALEKIT_CLIENT_ID="your_client_id"
export SCALEKIT_CLIENT_SECRET="your_client_secret"
export SCALEKIT_CONNECTION_NAME="contextdevmcp-abc123"
```

These credentials authenticate your application to Scalekit. Keep the client secret on your server.

**3. Connect a user and make a first call**

Replace `user_123` with a stable internal user ID from your application. Save the example as `scalekit.mts` or `scalekit.py`, run it, and open the printed link to authorize Context.dev. Choose the organization the agent should use, then return to the terminal and press Enter.

```typescript TypeScript theme={null}
import { ScalekitClient } from "@scalekit-sdk/node";
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 connectionName = process.env.SCALEKIT_CONNECTION_NAME!;
const identifier = "user_123";

const { link } = await actions.getAuthorizationLink({
  connectionName,
  identifier,
});
console.log("Connect Context.dev:", link);

const terminal = createInterface({
  input: process.stdin,
  output: process.stdout,
});
await terminal.question("Press Enter after connecting...");
terminal.close();

const result = await actions.executeTool({
  connector: connectionName,
  identifier,
  toolName: "contextdevmcp_brand_search",
  toolInput: { query: "stripe" },
});
console.log(result.data);
console.log("Execution ID:", result.executionId);
```

```python Python theme={null}
import os
from scalekit import ScalekitClient

scalekit = ScalekitClient(
    env_url=os.environ["SCALEKIT_ENVIRONMENT_URL"],
    client_id=os.environ["SCALEKIT_CLIENT_ID"],
    client_secret=os.environ["SCALEKIT_CLIENT_SECRET"],
)
actions = scalekit.actions
connection_name = os.environ["SCALEKIT_CONNECTION_NAME"]
identifier = "user_123"

authorization = actions.get_authorization_link(
    connection_name=connection_name,
    identifier=identifier,
)
print("Connect Context.dev:", authorization.link)
input("Press Enter after connecting...")

result = actions.execute_tool(
    connection_name=connection_name,
    identifier=identifier,
    tool_name="contextdevmcp_brand_search",
    tool_input={"query": "stripe"},
)
print(result.data)
print("Execution ID:", result.execution_id)
```

```bash TypeScript theme={null}
npx tsx scalekit.mts
```

```bash Python theme={null}
python scalekit.py
```

Reuse the same connection name and user ID for later tool calls. You can skip generating another authorization link while the connected account is active. For an application flow, follow Scalekit's [user authorization guide](https://docs.scalekit.com/agentkit/tools/authorize/), including its user verification settings.

**4. Add the tools to your framework**

Follow Scalekit's [framework examples](https://docs.scalekit.com/agentkit/examples/) to register the tools with your agent. Keep the same connection name and user ID when executing calls.

For an MCP client, [create a virtual MCP server](https://docs.scalekit.com/agentkit/mcp/configure-mcp-server/) with the connections and tools your agent needs, then [mint a session token](https://docs.scalekit.com/agentkit/mcp/session-tokens/) for the user. Pass that server URL and token to the client.

## Verify the setup

The SDK example calls `contextdevmcp_brand_search` with `query: "stripe"`. Inspect `result.data` for matching brands and keep the execution ID to find the call under **AgentKit → Logs**. Logs record the tool, connection, user identifier, status, and timing; they do not store successful response bodies.

Once the tools are available in your agent, ask:

```text theme={null}
Use Context.dev to search for the brand Stripe. Return its name and domain from the connected tool, and tell me which tool you called.
```

Confirm that the agent calls `contextdevmcp_brand_search` and returns tool output. An answer without a tool call does not verify the connection. Inspect the returned data for errors even if the Scalekit request itself succeeds.

## Available tools

The [Scalekit connector reference](https://docs.scalekit.com/agentkit/connectors/contextdevmcp/) lists the current tools and their input schemas. Common tools:

| Tool | Use it to |
| - | - |
| `contextdevmcp_web_scrape` | Read a webpage as Markdown, HTML, or another supported format. |
| `contextdevmcp_web_search` | Find web pages for a search query. |
| `contextdevmcp_parse_document` | Convert file bytes to Markdown. Requires `api.write`. |
| `contextdevmcp_brand_retrieve_unified` | Look up a company by domain, name, email, or ticker. |
| `contextdevmcp_brand_search` | Find brands by name or domain. |
| `contextdevmcp_web_styleguide` | Extract a website's design styles. |
| `contextdevmcp_list_monitors` | Find existing website monitors. |
| `contextdevmcp_get_monitor_limits` | Check monitor usage and limits. |

For scraping, supply both `url` and `formats`, for example `{"url":"https://www.context.dev","formats":{"markdown":true}}`. Use the connector's schema when building tool inputs.

## Troubleshooting

| Symptom | Fix |
| - | - |
| OAuth fields are empty | Review Scalekit's [connection setup](https://docs.scalekit.com/agentkit/connections/) guidance. If automatic registration fails, contact Scalekit support. |
| The connection is not found | Use its exact dashboard name and confirm that it belongs to the same environment as your Scalekit credentials. |
| The account is not connected or authorization has expired | Generate a new link with the same connection name and user ID, complete sign-in, and check the account status. |
| Sign-in finishes but the account is not active | Check Scalekit's [user verification settings](https://docs.scalekit.com/agentkit/tools/authorize/). The connection may still require verification. |
| File parsing or another write operation is denied | Add `api.write` to the connection's scopes, then authorize the account again. |
| Calls use the wrong Context.dev organization | Authorize Context.dev again and select the intended organization. See [MCP authentication](https://docs.context.dev/install-mcp.md#authentication-and-usage). |
| Calls fail for insufficient credits | Review the connected organization's usage in the [Context.dev dashboard](https://context.dev/dashboard). Reconnecting does not restore credits. |

## Reference

> [card] [Scalekit framework examples](https://docs.scalekit.com/agentkit/examples/)
>
> Add connected tools to your agent framework.

> [card] [Scalekit authorization](https://docs.scalekit.com/agentkit/tools/authorize/)
>
> Manage connection links, user verification, and account status.

> [card] [Scalekit security](https://docs.scalekit.com/agentkit/security/)
>
> Review credential handling and what tool logs retain.

> [card] [Context.dev MCP guide](https://docs.context.dev/install-mcp.md)
>
> Hosted server capabilities, OAuth scopes, and usage.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.