Announcing CIMD support for MCP Client registration
Learn more

Build a GTM Research Agent with Context.dev and Scalekit

Saif Ali Shaik
Founding Developer Advocate

You are building an internal GTM research agent for your company's go-to-market team. Before it reaches a single employee, you have five problems to solve:

  • Giving the agent access to live web data
  • Keeping the agent to its job (scoped access)
  • Acting on behalf of each employee
  • Avoiding tool bloat
  • Securing the connections

All five problems are decided by the architecture behind how the agent reaches its tools. Fork the GTM research agent template on GitHub, which addresses all five problems. Claude is the brain of the agent, and Context.dev is its live data source. Scalekit is the agent integration layer: it powers per-user OAuth, stores each employee's Context.dev token, and sits between the agent and its tools as the execution runtime. Scalekit's Virtual MCP server gives the agent 7 of Context.dev's 51 tools, which removes the tool bloat and keeps the agent to its job. The template is a demo, strictly focused on scoped tools for AI agents.

TL;DR

  • Live web data: an internal GTM research agent, built on Claude, answers questions about target accounts and their founders with live data from Context.dev.
  • Scoped tools: Context.dev's MCP server has 51 tools and this job needs 7. Scalekit's Virtual MCP server exposes only those 7, which removes the tool bloat, and the agent cannot run any tool outside its scope.
  • Per-user authentication: each employee connects their own Context.dev account once through OAuth, and every tool call runs as that employee.
  • Secured connections: Scalekit stores each employee's token encrypted, and the agent's code never holds it. Deleting a connected account removes that employee's access.
  • Audit: Scalekit records every tool call to Context.dev in its tool call logs, with the identifier of the employee it ran for.
What is Context.dev? Context.dev is a web scraping and search API for AI agents. It scrapes any URL into LLM-ready Markdown, searches the live web, crawls sites and extracts structured data. Its MCP server gives an agent 51 tools for that work.
What is Scalekit? Scalekit is the integration layer between an AI agent and the apps it acts in. It sits on every tool call: it runs per-user OAuth, scopes the tools each agent can see and call, makes the call with that user's credentials, and logs who did what.

What this sample GTM research agent does

The running example is the revenue team at an enterprise that sells to venture-backed startups. Its sales representatives are the users of this GTM research agent.

Animated run of the GTM research agent: a funding prompt returns a table of startups and founders from Context.dev, then a monitor request is refused by Scalekit

Scalekit's Virtual MCP server exposes seven Context.dev tools to the research agent:

Tool
Used for
contextdevmcp_company_search
Companies that match a description, with funding details
contextdevmcp_people_search
People by role at a given company, with profile URLs
contextdevmcp_people_enrich
One person's professional background
contextdevmcp_web_search
Recent announcements and open roles
contextdevmcp_web_answers
A sourced answer to an open research question
contextdevmcp_brand_retrieve_unified
A company's brand profile
contextdevmcp_get_usage
The user's own Context.dev credit balance

The Context.dev connector has 51 tools. The other 44 cover work that this GTM research agent doesn't need, such as monitors and batch jobs. So none of those 44 tools is exposed to this research agent.

Why the prompt is the wrong place to scope tools

The common approach is to pass all 51 Context.dev tool definitions in the tools array and restrict the model with a line in the system prompt. That approach fails in two ways:

  • Tool selection accuracy and token cost. The model selects from every definition in its context. Fifty-one definitions means more wrong selections and more invented arguments. Every definition is billed as input tokens on every turn, for every user, and every wrong tool call spends Context.dev credits as well.
  • No enforcement. A system prompt that says "only use the search tools" is an instruction the model can ignore. If contextdevmcp_delete_monitor is in the tools array, the model can call it. A user might prompt the research agent to use it in a conversation, and a conversation is not something you control.

The fix is not better prompting. It is surface reduction, limiting the tools the research agent can access.

So you configure the tool list once, outside the research agent's process. That is what Scalekit's Virtual MCP server does. A Virtual MCP server is a fixed endpoint that exposes exactly the tools you chose from a catalog of 1,100+ apps. For this GTM research agent, the choice is 7 of Context.dev's 51 tools.

Why scoped tool access matters: an agent can only misuse a tool it can reach. With 7 of 51 tools on the Virtual MCP server, the Context.dev tools this job never needs, such as creating or deleting monitors, stay out of the agent's reach. Claude also chooses from 7 definitions on every turn, where the full connector would send 51.

Recommended Reading: What Is a Virtual MCP Server? Architecture, Capabilities, and How It Works

How the GTM research agent fits together

Four actors run the GTM research agent, and each owns one decision:

Actor
Decides
You, the developer
Which 7 of Context.dev's 51 tools the research agent may use. Configured once in Scalekit's Virtual MCP server
Scalekit
Whether a tool call to Context.dev is allowed, and whose Context.dev credentials it runs with. Scalekit also records every call in the tool call logs
Claude
Which of the 7 Context.dev tools to call to respond to the user's prompt
The user
What the research agent researches. Each user connects their own Context.dev account once through OAuth
Architecture of the GTM research agent: chat page, research agent's backend, Claude, Scalekit's Virtual MCP server with 7 Context.dev tools, and Context.dev

Request flow for one prompt:

  1. The browser sends the prompt and the user's ID to the research agent's backend, app/server.py.
  2. The backend mints a Scalekit session token for that user and asks the Virtual MCP server for its 7 Context.dev tools.
  3. Claude returns a tool_use block naming one of the 7 tools.
  4. The backend sends that call to the Virtual MCP server as a tools/call request, with the session token as the bearer token.
  5. Scalekit makes the call with that user's Context.dev token and records it in the tool call logs.
  6. The result goes back to the backend, which never holds a Context.dev token.
Note: the same research agent also runs from the terminal with python examples/step4_research_agent.py "<prompt>". The demo is explained through the browser interface, because that is the interface end users work in.

The repository at a glance

The demo repository has three folders, split by who runs the code, plus a README with the full setup steps:

Path
What it holds
Run by
app/server.py
The local web app: status, connect link, streaming chat
The research agent's backend
app/agent.py
The research agent: Claude's tool-use loop over the Virtual MCP server
The research agent's backend
app/guardrails.py
The credit budget and result-quality check
The research agent's backend
app/common.py
The Scalekit client and the names it needs
The research agent's backend
admin/setup_mcp_config.py
Writes the research agent's tool list to Scalekit
You, once
examples/step1 to step4
The same flow, one step at a time, in the terminal
You
mcp_tools.txt
The recommended tools, read only by the admin script
Nobody at runtime
README.md
Setup steps, prompts to try and troubleshooting
You

Nothing under app/ names a Context.dev tool, and nothing under app/ can change which tools Scalekit's Virtual MCP server exposes.

Clone and install

The README covers setup end to end. The short version is five commands:

git clone https://github.com/nishantchoudhary-sketch/contextdev-scalekit-agent.git cd contextdev-scalekit-agent python3 -m venv .venv && source .venv/bin/activate pip install -r requirements.txt cp .env.example .env # then fill in the values

Prerequisites

Two steps happen in the Scalekit dashboard:

  1. Go to AgentKit > Connections and click Create Connection. Pick Context.dev MCP, keep the connection name contextdevmcp, and leave the credential mode on Each user connects their own account. The connector uses OAuth 2.1 with dynamic client registration, and Scalekit provides the OAuth credentials, so there is no OAuth app to register.
  2. Open Developers > Settings > API Credentials. Copy the Environment URL and Client ID, then generate a Client Secret.
Scalekit dashboard dialog for a new Context.dev MCP connection named contextdevmcp, with the credential mode set to each user connects their own account

The research agent's backend reads five values from .env:

Variable
Value
Source
SCALEKIT_ENVIRONMENT_URL
Your Scalekit environment URL
Developers > Settings > API Credentials
SCALEKIT_CLIENT_ID
The client ID for that environment
Developers > Settings > API Credentials
SCALEKIT_CLIENT_SECRET
The client secret, shown once when generated
Developers > Settings > API Credentials
CONTEXTDEV_CONNECTION_NAME
contextdevmcp
The connection name in AgentKit > Connections
ANTHROPIC_API_KEY
Your Anthropic API key
The Anthropic console

The connection name in your code must match the connection name in the dashboard exactly. The demo reads it from CONTEXTDEV_CONNECTION_NAME and uses contextdevmcp. A mismatch is the most common integration error, and the name can differ between environments.

Note: to extend this template into a full Context.dev-powered research agent, see all 51 Context.dev tools available through Scalekit.

Step 1: Configure the 7 Context.dev tools in Scalekit's Virtual MCP server

You do this first, as the developer, before any user connects. Every script in the repository starts from the same Scalekit client:

import os from dotenv import load_dotenv from scalekit import ScalekitClient 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 # Must match the connection name in AgentKit > Connections exactly. CONNECTION_NAME = os.getenv("CONTEXTDEV_CONNECTION_NAME", "contextdevmcp")

You run admin/setup_mcp_config.py once, and again only when the research agent's job changes. The research agent's backend never runs it.

The script lists every tool on the connection with actions.list_tools(connection_name=CONNECTION_NAME), which needs no connected user. Each tool comes back with the access label Scalekit gives it, such as read-only or destructive. The script offers the 7 recommended Context.dev tools from a file in the repository, mcp_tools.txt, or lets you pick from all 51. The script then writes the chosen tools to Scalekit:

from scalekit.actions.models.mcp_config import McpConfigConnectionToolMapping MCP_CONFIG_NAME = "contextdev-research-agent" chosen = [ "contextdevmcp_company_search", "contextdevmcp_people_search", "contextdevmcp_people_enrich", "contextdevmcp_web_search", "contextdevmcp_web_answers", "contextdevmcp_brand_retrieve_unified", "contextdevmcp_get_usage", ] response = actions.mcp.create_config( name=MCP_CONFIG_NAME, description="Tools the Context.dev research agent may use", connection_tool_mappings=[ McpConfigConnectionToolMapping(connection_name=CONNECTION_NAME, tools=chosen) ], ) config_id = response.config.id mcp_server_url = response.config.mcp_server_url

mcp_server_url is the URL of the Virtual MCP server, shared by every user of the research agent. To change the research agent's Context.dev tools, run actions.mcp.update_config with a new mapping. The research agent's code does not change and nothing is redeployed.

Terminal output of admin/setup_mcp_config.py listing the 7 recommended Context.dev tools with read-only and write labels

The script asks for confirmation, writes the 7 Context.dev tools to Scalekit and prints the Virtual MCP server URL. The local FastAPI server starts next with python app/server.py.

Terminal output confirming the Virtual MCP server config contextdev-research-agent was created in Scalekit, followed by the local FastAPI server starting

The Virtual MCP server now appears in the Scalekit dashboard under AgentKit > Virtual MCP Servers, mapped to the Context.dev MCP connection with 7 tools.

Scalekit dashboard, AgentKit > Virtual MCP Servers, showing contextdev-research-agent with the Context.dev MCP connection and 7 tools

mcp_tools.txt is only an input to the admin script, and the running research agent never reads it. Your reviewers see the recommended tool list in a pull request. Scalekit's Virtual MCP server enforces the configured tool list.

What the Virtual MCP server gives you: one tool list per agent role, set outside the agent's code. Changing what the research agent can do is a config update in Scalekit with no redeploy, and every user of the agent gets the same 7 tools.

Scalekit's docs list every option to configure a Virtual MCP server.

Step 2: Each user connects their own Context.dev account

A connected account is Scalekit's record of one user's authorization for Context.dev. The connected account holds that user's OAuth tokens and a connection status: PENDING_AUTH until the user approves access in Context.dev, then ACTIVE. The research agent's backend creates one connected account per user. Each connected account is keyed by an identifier, which is your app's ID for that user.

def connect(user_id: str): """Return (status, link). The link is None once the account is ACTIVE.""" account = actions.get_or_create_connected_account( connection_name=CONNECTION_NAME, identifier=user_id, ).connected_account if account.status == "ACTIVE": return account.status, None link = actions.get_authorization_link( connection_name=CONNECTION_NAME, identifier=user_id, ).link return account.status, link

A new account starts as PENDING_AUTH. The user opens the authorization link and approves access in Context.dev. The status becomes ACTIVE, and from then on the research agent can call Context.dev tools as that user. The research agent's backend checks the status before every run: ACTIVE proceeds, and any other status gets a new link.

Chat page of the GTM research agent asking a new user to connect their Context.dev account

Context.dev shows its consent screen with the permissions the connection receives:

Context.dev OAuth consent screen listing the permissions granted to the connection, with access delivered to agentkit.scalekit.com

After approval, the connected account appears in the Scalekit dashboard under AgentKit > Connected Accounts with the user's identifier and the status Connected.

Scalekit dashboard, AgentKit > Connected Accounts, showing two connected accounts on the Context.dev MCP connection, one per user identifier

Securing the connection. Scalekit encrypts each employee's Context.dev token with AES-256-GCM, under a key that belongs to one environment. Scalekit refreshes the token and adds it to each outgoing request, so the research agent's backend never receives it. Encryption keys rotate without downtime, and you can hold the master key in your own KMS. To revoke one employee's access, delete their connected account. The stored token goes with it. Scalekit's docs cover how credentials are stored.

Why each employee connects their own account: with one shared Context.dev key, every search comes from a single account. With a connected account per employee, credits are spent from that employee's own Context.dev account, one person's access can be removed without touching anyone else's, and every call traces back to a person.

In the demo, app/server.py wraps this in two endpoints. GET /api/status returns the status for the user ID in the request header, and POST /api/connect returns the link. The chat page opens the link in a new tab and closes it when the account is ACTIVE.

Each employee connects Context.dev once: Scalekit runs the OAuth flow, stores each token and makes every call as that employee

Step 3: Retrieve the tools this research agent is allowed to use

Before each run, the research agent's backend asks Scalekit to mint a session token for one user on this Virtual MCP server. The token is short-lived: one hour unless you set an expiry, and it cannot be refreshed. The token works only on the Virtual MCP server it was minted for.

import json import requests def session_token(config_id: str, user_id: str) -> str: """A short-lived token that acts as this user on this Virtual MCP server.""" return actions.mcp.create_session_token( mcp_config_id=config_id, identifier=user_id, ).token def rpc(server_url: str, token: str, method: str, params: dict): """One JSON-RPC call to the Virtual MCP server over streamable HTTP.""" resp = requests.post( server_url, headers={ "Authorization": f"Bearer {token}", "Content-Type": "application/json", "Accept": "application/json, text/event-stream", }, json={"jsonrpc": "2.0", "id": 1, "method": method, "params": params}, timeout=120, ) resp.raise_for_status() body = resp.content.decode("utf-8").strip() if body.startswith(("event:", "data:")): # server-sent-event framing body = "\n".join(l[5:].lstrip() for l in body.split("\n") if l.startswith("data:")) data = json.loads(body) if "error" in data: raise RuntimeError(data["error"].get("message", str(data["error"]))) return data["result"] def tools_for_claude(server_url: str, token: str) -> list: """The tools Scalekit exposes on this server, in Claude's tool format.""" result = rpc(server_url, token, "tools/list", {}) return [ { "name": t["name"], "description": t.get("description", ""), "input_schema": t.get("inputSchema", {"type": "object", "properties": {}}), } for t in result["tools"] if t["name"] != "connect_account" # the app handles connecting itself ]

tools/list returns the seven Context.dev tools and their schemas, plus a connect_account helper that the demo leaves out because the chat page already handles connecting.

The research agent asks Scalekit's Virtual MCP server which tools it may use, and the Virtual MCP server answers with the tool list you configured. No code path in the research agent names a Context.dev tool. If you add an eighth tool, the next tools/list returns eight.

Any MCP client can connect to the same URL with the same session token. The demo sends the JSON-RPC calls directly, so each request is readable in the code. Expiry and access level are set when you mint a session token.

Step 4: Run the Claude tool-use loop over the Virtual MCP server

The loop is the standard Claude tool-use loop. One line is specific to Scalekit: the tools/call request that executes each Context.dev tool.

import anthropic claude = anthropic.Anthropic() MODEL = os.getenv("ANTHROPIC_MODEL", "claude-sonnet-5-5") MAX_TURNS = 15 def ask(question: str, user_id: str, config_id: str, server_url: str) -> str: token = session_token(config_id, user_id) tools = tools_for_claude(server_url, token) messages = [{"role": "user", "content": question}] response = claude.messages.create( model=MODEL, max_tokens=16000, tools=tools, messages=messages ) turns = 0 while response.stop_reason == "tool_use" and turns < MAX_TURNS: turns += 1 results = [] for block in response.content: if block.type != "tool_use": continue try: # Scalekit runs the tool as this user and returns the result. result = rpc(server_url, token, "tools/call", {"name": block.name, "arguments": block.input}) text = "\n".join(c.get("text", "") for c in result.get("content", [])) results.append({"type": "tool_result", "tool_use_id": block.id, "content": text}) except Exception as exc: # give the failure to the model results.append({"type": "tool_result", "tool_use_id": block.id, "content": str(exc), "is_error": True}) messages.append({"role": "assistant", "content": response.content}) messages.append({"role": "user", "content": results}) response = claude.messages.create( model=MODEL, max_tokens=16000, tools=tools, messages=messages ) return "".join(b.text for b in response.content if b.type == "text")

The model call carries the 7 Context.dev tool definitions. When the stop reason is tool_use, each requested call goes to the Virtual MCP server with the session token. The result goes back to the model as a tool_result, and the loop continues until the model answers in text.

The version in app/agent.py is the same loop with three additions:

  • Progress events, so the chat page shows each Context.dev tool call as it happens.
  • Conversation history, so follow-up prompts work.
  • Spend limits from app/guardrails.py, applied to every tool call.

When the research agent calls an out-of-scope tool

Scalekit protects the research agent's scope in two layers:

  • The research agent sees only 7 tools. tools/list on the Virtual MCP server returns the 7 configured Context.dev tools. The other 44 are never sent to the model, so the research agent does not know they exist.
  • Scalekit executes only those 7 tools. The Virtual MCP server rejects a tools/call for any other tool name. That holds when a user names another Context.dev tool in a prompt. It also holds when a user describes a new tool in a prompt and asks the research agent to run it.

Take one prompt as the example. A user types: "Set up a monitor that alerts me when stripe.com/pricing changes."

Context.dev has a tool for monitors, contextdevmcp_create_monitor. create_monitor is one of Context.dev's ten write tools, and it is outside the seven tools configured in the Virtual MCP server.

With the first layer alone, the research agent replies that it has no monitor tool, and no call is sent. To show the second layer in the chat, the demo adds a local probe tool, attempt_unlisted_tool. The probe lets Claude name a Context.dev tool outside the 7, and the research agent's backend forwards that call to the Virtual MCP server unchanged:

try: rpc(server_url, token, "tools/call", {"name": "contextdevmcp_create_monitor", "arguments": {"url": "https://stripe.com/pricing"}}) except RuntimeError as exc: print(exc) # unknown tool "contextdevmcp_create_monitor"

Scalekit's Virtual MCP server answers with JSON-RPC error -32602 and the message unknown tool "contextdevmcp_create_monitor". Nothing reaches Context.dev. No monitor is created and no Context.dev credits are spent. The Virtual MCP server rejects the call before any tool runs, so the refusal is not an executed tool call and does not appear in the tool call logs.

Chat page showing create_monitor refused by Scalekit because the tool is not in the research agent's tool set

In the chat, the tool line reads "create_monitor refused by Scalekit: not in this agent's tool set," and the research agent tells the user that the tool exists but this agent is not allowed to use it.

Scalekit's Virtual MCP server enforces the refusal, whatever the model does. The same unknown tool error comes back for a misspelled tool name and for an invented one. A production research agent leaves out the probe.

Two users, one research agent

Open the chat page at http://localhost:8000 in two browser profiles. In the first profile, enter any user ID, for example user_a, and connect one Context.dev account. In the second profile, enter a different user ID, for example user_b, and connect a second Context.dev account. The chat page appends a random suffix to each user ID before sending it to Scalekit as the identifier, so user_a becomes an identifier such as user-a_6ec77d.

Both users reach the same Virtual MCP server and the same seven Context.dev tools. The session token is what differs. Each run's token is bound to one user and that user's connected accounts, so user_a's searches run with user_a's Context.dev token and draw on that account's credits. Ask each profile "How many Context.dev credits do I have left?" and contextdevmcp_get_usage returns two different balances.

Two users of the GTM research agent, user-a and user-b, each getting a different Context.dev credit balance from the get_usage tool

Context.dev's own usage page for the first account shows the same 24 credits: two company searches and two people searches, all made through the Context.dev MCP API key that the OAuth connection created.

Context.dev usage page showing 4 API calls and 24 credits used, split between Search People and Search Companies

Open AgentKit > Logs in the Scalekit dashboard. Every tool call to Context.dev is there with the timestamp, the connection, the tool name, the identifier and the duration. Filter the list by status, by connection or by identifier to see one user's activity. Tool inputs and responses are not stored.

Scalekit dashboard, AgentKit > Logs, showing Context.dev tool calls from two user identifiers with timestamp, tool name and duration
What per-user logging gives you: every Context.dev call is recorded with the employee's identifier, the tool, the status and the duration, and kept for 90 days. An internal security review asks which call ran and for which employee. One filtered view answers both.

Recommended Reading: Agent Tool Observability: Your Agent Is Running. Is It Actually Working?

Every Context.dev tool call traced to a user in Scalekit's agent logs

The five problems, solved

Each of the five problems from the opening is settled by one part of the architecture:

Problem
What solves it
Giving the agent access to live web data
Context.dev, reached through 7 tools on Scalekit's Virtual MCP server
Keeping the agent to its job
The Virtual MCP server lists and runs only the 7 configured tools. A call to any other tool is rejected
Avoiding tool bloat
The same tool list. Claude receives 7 tool definitions where the full connector has 51
Acting on behalf of each employee
Per-user OAuth and a session token per run. Every call uses that employee's own Context.dev token
Securing the connections
Tokens stay encrypted in Scalekit and never reach the agent's code. Deleting a connected account removes that employee's access

What you still own

Scalekit scopes the Context.dev tools and holds each user's credentials. You own the rest of the research agent:

Scalekit handles
You handle
The Context.dev OAuth flow and authorization links
Knowing who the user is, and sending their ID
Storing each user's token, encrypted, and refreshing it
Minting a session token before each run
Which tools the research agent can see and call
The model loop and the output format
Running each call as the right user
Spend limits and result quality
Tool call logs with the user's identifier
Conversation state and saved output

The demo covers two rows of your column. app/guardrails.py caps one prompt at 300 estimated Context.dev credits, and the system prompt sets the output format. Both are in the repository.

What this demo leaves out

The demo runs on your machine with your own keys. Before your team relies on a GTM research agent like this, add five things:

  • Real sign-in. The demo asks for a name and uses it as the user ID. In production, authenticate the user first and pass your app's own user ID as the identifier. The identifier should be stable and unique per user, and hard to guess.
  • User verification. Scalekit can confirm that the person approving an authorization link is the user your app intended. New environments start with verification off, which is for development only. For production, turn on the custom user verifier.
  • Separate admin credentials. The demo's backend and its admin script share one set of Scalekit credentials. In production, the process that serves users should not hold credentials that can change the tool list.
  • Hosting and access control. The local FastAPI server binds to 127.0.0.1 and trusts the user ID header. A hosted version needs its own authentication in front of every endpoint.
  • Durable state. Conversations live in server memory. Store conversations in a database, and trim long histories before they exceed the model's context window.

None of these five additions changes the architecture. The tool list stays in Scalekit's Virtual MCP server, and every Context.dev call still runs as one user.

Extending the GTM research agent

The same architecture holds as the research agent grows:

  • A second connector. A CRM joins the same Virtual MCP server with its own short tool list, and each user connects that account once.
  • A second agent role. An account-monitoring agent that does need contextdevmcp_create_monitor gets its own Virtual MCP server with its own tool list. The research agent keeps its seven Context.dev tools.

Decide the tool list per agent role, and enforce it in the layer that executes the call.

Next steps:

Frequently asked questions

Does every user need their own Virtual MCP server?

No. A Virtual MCP server is created once per agent role, and all users of that agent share its URL. The Virtual MCP server defines which tools exist. The session token defines who is calling. Each token is minted for one user and works only on the Virtual MCP server it was minted for. The token expires after an hour by default. So the research agent has one Virtual MCP server with seven Context.dev tools, and each user calls it with their own session token. A second server is needed only when a different agent role needs a different tool list.

What does the research agent see if a user has not connected Context.dev yet?

The connected account exists with the status PENDING_AUTH, and tool calls for that user cannot run. The demo checks the status before showing the chat. If the status is not ACTIVE, the chat page shows a Connect button and requests an authorization link for that user. Authorization links are short-lived, so the research agent's backend requests a new link each time the user clicks. Once the user approves, the status becomes ACTIVE and the same identifier works for every later run without another sign-in.

How do I change which MCP tools the research agent can use?

Update the tool mapping in Scalekit's Virtual MCP server. The research agent's code stays as it is. In the demo that means editing mcp_tools.txt or picking from the full list of 51 Context.dev tools, then running python admin/setup_mcp_config.py again, which calls actions.mcp.update_config with the new mapping. The research agent asks the Virtual MCP server for its tools at the start of each run, so the next run picks up the change. No tool name sits in the research agent's code, and nothing is redeployed.

Can a prompt make the model call a tool outside the list?

A model can be prompted into attempting the call. The attempt fails, because Scalekit's Virtual MCP server does not have that tool. A call to anything outside the configured list returns JSON-RPC error -32602 with the message unknown tool, and nothing is sent to Context.dev. The demo shows this: ask the research agent to set up a monitor, and the call to contextdevmcp_create_monitor comes back refused. The tool list is configured in Scalekit, and a conversation cannot change it.

What is recorded for each tool call, and for how long?

Each record carries the user's identifier alongside the tool name and the outcome, so a call can always be traced to the person it ran for. Tool inputs and tool responses are not stored, which keeps research results out of the log. Tool call logs are kept for 90 days and appear under AgentKit > Logs in the dashboard. Because the identifier is on every record, the two demo users, user_a and user_b, appear as two sets of records for the same research agent, each filterable by identifier.

Where do the user's Context.dev tokens live?

In Scalekit. When a user approves the authorization link, their Context.dev OAuth tokens are encrypted with AES-256-GCM under a key that belongs to one environment. The tokens are kept until the connected account is deleted. The research agent's code only ever holds a Scalekit session token, which acts for one user on one server and expires. The demo's backend therefore runs tool calls for two users without storing anything about their Context.dev accounts beyond a user ID.

No items found.
Agent
Auth Quickstart
On this page
Share this article
Scalekit
Scoped tools per agent

Acquire enterprise customers with
‍zero upfront cost.

Every feature unlocked. No hidden fees.