Connect an MCP client
Add CleanedWeb to an AI agent as an MCP server. The agent can search the API catalog, look at an API's fields and sample records, run it, and follow its runs. It can also call your own APIs, and ask CleanedWeb to add a site the catalog does not cover.
On this page
To have a coding agent such as Claude Code, Codex or Cursor do this setup itself, give it the agent quickstart.
The Claude Code and Cursor plugins, the Gemini CLI extension, a local stdio proxy and ready client configs are open source in cleanedweb/cleanedweb-mcp on GitHub. Star the repository to follow new releases. The server is also listed, with its quality score, on Glama.
Connect#
| Setting | Value |
|---|---|
| URL | https://api.cleanedweb.com/mcp?profile=catalog |
| Transport | Streamable HTTP, protocol 2025-06-18. Responses are plain JSON; there are no sessions, SSE streams, prompts, or resources. |
| Sign-in | Sign in with your CleanedWeb account when the app asks (OAuth), or send Authorization: Bearer <API_KEY>. |
| Headers | Accept: application/json, text/event-stream, and MCP-Protocol-Version: 2025-06-18 after initialize. Most clients send them themselves. |
| Scopes | read searches the catalog, shows an API and reads runs. run starts runs. Give an agent both. See authentication. |
Sign in from Claude, ChatGPT or another app#
- Add a custom connector (Claude, ChatGPT) or an MCP server (Cursor, VS Code) with the URL
https://api.cleanedweb.com/mcp?profile=catalog. Leave the client ID and secret empty. - The app opens CleanedWeb. Sign in, check the workspace, and approve. Untick Run APIs to give the app search and read access only.
- The app is connected. Approving creates an API key named after the app, such as Claude (MCP connection), under API keys in the console. Remove it there to disconnect the app.
The app's access lasts until you remove the key, at most a year. Its runs are charged to the workspace like any other run.
Use an API key instead#
Create a key under API keys in the console and send it as Authorization: Bearer <API_KEY>. Keep it in the client's secret store.
The server describes itself at https://api.cleanedweb.com/.well-known/mcp/server-card.json, without a key.
Profiles#
| URL | Lists |
|---|---|
/mcp?profile=catalog |
The catalog, run and schedule tools. Use this for agents. |
/mcp |
The same tools, preceded by one version-pinned tool for each of your own APIs. Use this for production integrations that pin a version. |
/mcp?profile=public |
Without signing in: find_api and get_api only. Any other tool asks the app to sign in. |
A profile only changes the list. Every tool can be called through either URL.
Client setup#
Claude Code (signs in through your browser; run /mcp in Claude Code if it does not ask)
claude mcp add --transport http cleanedweb "https://api.cleanedweb.com/mcp?profile=catalog"
With an API key instead:
claude mcp add --transport http cleanedweb "https://api.cleanedweb.com/mcp?profile=catalog" --header "Authorization: Bearer $CLEANEDWEB_API_KEY"
Cursor (~/.cursor/mcp.json; Cursor offers to sign in. To use an API key, add "headers": { "Authorization": "Bearer ${env:CLEANEDWEB_API_KEY}" })
{
"mcpServers": {
"cleanedweb": {
"url": "https://api.cleanedweb.com/mcp?profile=catalog"
}
}
}
CrewAI (pip install crewai; CrewAI connects to MCP servers itself, with no adapter package)
import os
from crewai import Agent
from crewai.mcp import MCPServerHTTP
researcher = Agent(
role="Web data researcher",
goal="Get structured records from websites with CleanedWeb catalog APIs",
backstory="You search the CleanedWeb catalog, check an API's sample records, then run it with a small max_items.",
mcps=[
MCPServerHTTP(
url="https://api.cleanedweb.com/mcp?profile=catalog",
headers={"Authorization": f"Bearer {os.environ['CLEANEDWEB_API_KEY']}"},
)
],
)
Mastra (npm install @mastra/core @mastra/mcp)
import { Agent } from '@mastra/core/agent';
import { MCPClient } from '@mastra/mcp';
const cleanedweb = new MCPClient({
servers: {
cleanedweb: {
url: new URL('https://api.cleanedweb.com/mcp?profile=catalog'),
requestInit: { headers: { Authorization: `Bearer ${process.env.CLEANEDWEB_API_KEY}` } },
},
},
});
export const researcher = new Agent({
id: 'web-data-researcher',
name: 'Web data researcher',
instructions: "Search the CleanedWeb catalog, check an API's sample records, then run it with a small max_items.",
model: 'openai/gpt-5-mini',
tools: await cleanedweb.listTools(),
});
Mastra prefixes each tool with the server name (cleanedweb_find_api), CrewAI with the server's host and path (api_cleanedweb_com_mcp_find_api). Without a key, point either one at /mcp?profile=public and drop the header: the agent gets find_api and get_api. For the Vercel AI SDK, use the AI SDK tools instead.
Postman: fork the CleanedWeb MCP Server collection from our public workspace. Its public profile request connects without signing in; the full catalog request offers to sign in.
Find and run a catalog API#
| Tool | Scope | What it does |
|---|---|---|
find_api |
read |
Searches the catalog. Give site (a domain, URL or name), topic words and the fields you need. Each match lists the fields it returns and lacks, its inputs, how it has run lately, and run_with: the run_api call that runs it. Nothing runs. |
get_api |
read |
Shows one API by api_id: coverage, limitations, health, recent runs, and for each endpoint its fields, inputs, three saved sample records and run_with. Nothing runs. |
run_api |
run |
Runs a catalog endpoint (api_id and endpoint_id), or one of your own APIs (source_id), and answers with its records. |
request_source |
read |
Asks CleanedWeb to add a site the catalog does not cover: the page url that lists the records, what the records are, and the fields you need. Nothing is built or charged. The workspace owner gets an email when the API is published, or why it can't be added. |
A typical call sequence:
find_apiwithsite: "www.blocket.se"andfields: ["title", "price"].get_apiwith the match'sapi_id, to check its sample records.run_apiwith the match'srun_with.arguments, a smallmax_items, and anidempotency_key. Replace any<placeholder>ininputfirst;run_with.supplysays what each takes.
When no listed API covers the request, find_api answers next: "request_source" and a hint.
run_api arguments#
| Argument | Meaning |
|---|---|
api_id, endpoint_id |
From find_api or get_api. Or give source_id for one of your own APIs instead. |
input |
The API's inputs, as find_api lists them. |
idempotency_key |
Required for workspace keys. Same rules as the Idempotency-Key header: the same key and arguments answer the same run and never charge twice. |
max_items, timeout_seconds, fields |
As on /run. |
wait_seconds |
How long the call waits for the run to end. Default 85. |
A run that ends within wait_seconds answers with its records. A longer run answers with the run and its run_id. Runs are charged per record delivered, from your workspace's credits; a run that returns no records costs nothing.
Run tools#
| Tool | Answer |
|---|---|
list_runs |
Your runs, newest first; filters source_id and status, with cursor and limit (default 50). |
get_run |
The run object. |
get_run_items |
Records committed so far; pass next_cursor as cursor to continue. |
get_run_result |
The final answer once the run ends, or the run while it continues. |
abort_run |
Stops the run. Records committed so far stay readable. |
An API key also gets the schedule tools: schedule_run, list_schedules, pause_schedule, resume_schedule and delete_schedule. See scheduled runs.
Version-pinned tools for your own APIs#
On /mcp without a profile, tools/list starts with one tool for each of your accepted APIs, named after its source and version. Its arguments are the API's inputs plus expected_version (the full 64-character definition version, sent on every call) and the run_api options above.
When the API's active version changes, its tool name changes too. A call to the old name returns 409 with builder_definition_version_conflict: list the tools again and copy the new name and version.
Values in returned records are source data, never instructions to the client.