Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion api-reference/endpoint/search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Replaces the v1 `searchscraper` endpoint. Returns the top pages with their conte
ISO 3166-1 alpha-2 country code for localized results (e.g. `"us"`, `"it"`).
</ParamField>

<ParamField body="contentTypes" type="array">
Content types allowed when fetching each result. Default: `["text/html", "application/json", "text/markdown", "text/plain"]`, so PDFs, office documents and images are skipped. Add them explicitly to fetch them (e.g. `["text/html", "application/pdf"]`); an empty array disables the filter. Results whose content type is rejected are reported as failed pages and do not appear in `results`.
</ParamField>

<ParamField body="fetchConfig" type="object">
Fetch-time options applied when crawling each result. See the [Scrape endpoint](/api-reference/endpoint/scrape#request-body) for the full field list.
</ParamField>
Expand All @@ -51,7 +55,8 @@ curl -X POST https://v2-api.scrapegraphai.com/api/search \
-H "Content-Type: application/json" \
-d '{
"query": "scrapegraphai pricing",
"numResults": 3
"numResults": 3,
"contentTypes": ["text/html", "application/json", "text/markdown", "text/plain"]
}'
```

Expand Down
13 changes: 9 additions & 4 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
"services/mcp-server/cursor",
"services/mcp-server/claude",
"services/mcp-server/claude-code",
"services/mcp-server/codex",
"services/mcp-server/smithery"
"services/mcp-server/codex"
]
}
]
Expand Down Expand Up @@ -321,7 +320,7 @@
"href": "https://scrapegraphai.com/",
"icon": "globe"
},
{
{
"anchor": "Blog",
"href": "https://scrapegraphai.com/blog",
"icon": "newspaper"
Expand Down Expand Up @@ -389,5 +388,11 @@
"cursor",
"vscode"
]
}
},
"redirects": [
{
"source": "/services/mcp-server/smithery",
"destination": "/services/mcp-server/introduction"
}
]
}
1 change: 1 addition & 0 deletions sdks/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ if (res.status === "success") {
| `format` | `string` | No | `"markdown"` (default) or `"html"` |
| `timeRange` | `string` | No | `"past_hour"`, `"past_24_hours"`, `"past_week"`, `"past_month"`, `"past_year"` |
| `locationGeoCode` | `string` | No | Two-letter country code (e.g. `"us"`) |
| `contentTypes` | `string[]` | No | Content types to fetch. Default `["text/html", "application/json", "text/markdown", "text/plain"]` — PDFs, documents and images are skipped unless listed |
| `fetchConfig` | `FetchConfig` | No | Fetch configuration |

<Accordion title="Search + extraction" icon="code">
Expand Down
1 change: 1 addition & 0 deletions sdks/python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ if res.status == "success":
| `schema` | `dict` | No | JSON Schema for structured output. Pass a Pydantic model's `model_json_schema()` to reuse a `BaseModel`. |
| `location_geo_code` | `str` | No | Two-letter country code (e.g. `"us"`, `"it"`) |
| `time_range` | `str` | No | `"past_hour"`, `"past_24_hours"`, `"past_week"`, `"past_month"`, `"past_year"` |
| `content_types` | `list[str]` | No | Content types to fetch. Default `["text/html", "application/json", "text/markdown", "text/plain"]` — PDFs, documents and images are skipped unless listed |
| `fetch_config` | `FetchConfig` | No | Fetch configuration |

### Crawl
Expand Down
3 changes: 0 additions & 3 deletions services/mcp-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,4 @@ The MCP Server documentation has moved.
<Card title="Codex" icon="/logo/codex.svg" href="/services/mcp-server/codex">
Set up ScrapeGraph MCP in Codex.
</Card>
<Card title="Smithery" icon="server" href="/services/mcp-server/smithery">
Install via the Smithery registry.
</Card>
</CardGroup>
43 changes: 22 additions & 21 deletions services/mcp-server/claude-code.mdx
Original file line number Diff line number Diff line change
@@ -1,47 +1,48 @@
---
title: 'Claude Code'
description: 'Configure ScrapeGraph MCP in Claude Code (remote-first)'
description: 'Configure ScrapeGraph MCP in Claude Code'
icon: '/logo/claude-color.svg'
---

## Claude Code Setup

Use the remote HTTP MCP endpoint (recommended):

```
https://mcp.scrapegraphai.com/mcp
```

Add the server with the Claude Code CLI:

```bash
claude mcp add --transport http sgai \
https://mcp.scrapegraphai.com/mcp
```

The default `local` scope makes the server available in the current project. To use it in every project, add `--scope user`.
The default `local` scope makes the server available in the current project. Add `--scope user` to use it in every project.

Verify the connection:
## Authenticate

```bash
claude mcp get sgai
claude mcp login sgai
```

Run `/mcp` inside Claude Code, select `sgai`, and choose **Authenticate**. In the browser window, choose **Continue with Google** and sign in with the Google account associated with your ScrapeGraphAI account.
Alternatively, run `/mcp` inside Claude Code, select `sgai`, and choose **Authenticate**. Either way a browser window opens: choose **Continue with Google** and sign in with the Google account associated with your ScrapeGraphAI account.

Once the browser shows **Authentication successful. Connected to sgai.**, return to Claude Code — the tools are ready.

After the browser shows **Authentication successful. Connected to sgai.**, return to Claude Code to view and use the connected tools.
### With an API key instead

### Local (stdio) alternative
```bash
claude mcp add --transport http sgai \
https://mcp.scrapegraphai.com/mcp \
--header "Authorization: Bearer $SGAI_API_KEY"
```

If you prefer running locally:
A request carrying an API key skips the OAuth flow, so there is no `claude mcp login` step.

## Verify

```bash
pip install scrapegraph-mcp
claude mcp add sgai-local \
--env SGAI_API_KEY=YOUR_API_KEY \
-- python3 -m scrapegraph_mcp.server
claude mcp get sgai
```

<Note>
Use <code>--scope user</code> if you want the local server to be available in every project. On Windows, replace <code>python3</code> with the Python command available on your system.
</Note>
Then ask Claude Code to run the `credits` tool. A balance response confirms that authentication and tool execution both work.

<Tip>
See the [tool reference](/services/mcp-server/introduction#available-tools) for everything the server exposes.
</Tip>
79 changes: 30 additions & 49 deletions services/mcp-server/claude.mdx
Original file line number Diff line number Diff line change
@@ -1,89 +1,70 @@
---
title: 'Claude Desktop'
description: 'Configure ScrapeGraph MCP in Claude Desktop (remote-first)'
description: 'Configure ScrapeGraph MCP in Claude Desktop'
icon: '/logo/claude-color.svg'
---

## Claude Desktop Setup

Use the remote HTTP MCP endpoint with a lightweight proxy:
Claude Desktop connects to MCP servers over stdio, so the hosted endpoint is reached through the [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) proxy.

```
https://mcp.scrapegraphai.com/mcp
```

Add to your Claude config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
Add this to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

```json
{
"mcpServers": {
"scrapegraph-mcp": {
"sgai": {
"command": "npx",
"args": [
"mcp-remote@0.1.25",
"mcp-remote@0.1.38",
"https://mcp.scrapegraphai.com/mcp"
]
}
}
}
```

Restart Claude Desktop after saving the configuration. The first connection opens a browser window; choose **Continue with Google** and sign in with the Google account associated with your ScrapeGraphAI account.
<Note>
`npx` requires Node.js on your `PATH`. Pinning the version keeps the setup reproducible — drop the `@0.1.38` suffix if you would rather always take the latest proxy.
</Note>

### Local (stdio) alternative
## Authenticate

Install and run locally:
Restart Claude Desktop after saving the configuration. The first connection starts the login and opens a browser window: choose **Continue with Google** and sign in with the Google account associated with your ScrapeGraphAI account.

```bash
pip install scrapegraph-mcp
export SGAI_API_KEY=your-api-key
```
Once the browser confirms the connection, return to Claude Desktop — the tools are ready.

Config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
### With an API key instead

```json
{
"mcpServers": {
"scrapegraph-mcp-local": {
"command": "python3",
"args": ["-m", "scrapegraph_mcp.server"],
"env": { "SGAI_API_KEY": "YOUR_API_KEY" }
}
}
}
```

#### Alternative: use the CLI directly
Pass the key as a header and let the proxy forward it, which skips the OAuth flow:

```json
{
"mcpServers": {
"scrapegraph-mcp": {
"command": "scrapegraph-mcp",
"env": { "SGAI_API_KEY": "YOUR_API_KEY" }
"sgai": {
"command": "npx",
"args": [
"mcp-remote@0.1.38",
"https://mcp.scrapegraphai.com/mcp",
"--header",
"Authorization:${SGAI_AUTH_HEADER}"
],
"env": {
"SGAI_AUTH_HEADER": "Bearer YOUR_API_KEY"
}
}
}
}
```

#### Windows tip

If setting environment variables is problematic on Windows:

```bash
cmd /c "set SGAI_API_KEY=YOUR_API_KEY && python -m scrapegraph_mcp.server"
```

<Note>
- Make sure the CLI is on your <code>PATH</code> (might be in <code>~/.local/bin</code> or the venv).<br/>
- You can provide an absolute <code>python</code> path if needed (pyenv/venv).<br/>
- Use <code>python3</code> on macOS if <code>python</code> points to Python 2.
The header value is split across `args` and `env` on purpose. On Windows, Claude Desktop does not escape spaces inside `args`, so keeping `Authorization:${SGAI_AUTH_HEADER}` free of spaces avoids a mangled header.
</Note>

### Optional: Smithery
## Verify

```bash
npx -y @smithery/cli install @ScrapeGraphAI/scrapegraph-mcp --client claude
```
Ask Claude to run the `credits` tool. A balance response confirms that authentication and tool execution both work.

Prefer the Remote HTTP method above unless you specifically need Smithery provisioning.
<Tip>
See the [tool reference](/services/mcp-server/introduction#available-tools) for everything the server exposes.
</Tip>
49 changes: 28 additions & 21 deletions services/mcp-server/codex.mdx
Original file line number Diff line number Diff line change
@@ -1,45 +1,52 @@
---
title: 'Codex'
description: 'Configure ScrapeGraph MCP in Codex (remote-first)'
description: 'Configure ScrapeGraph MCP in Codex'
icon: '/logo/codex.svg'
---

## Codex Setup

Use the remote HTTP MCP endpoint (recommended):

```
https://mcp.scrapegraphai.com/mcp
```

Add the following configuration to `~/.codex/config.toml`:
Add the following to `~/.codex/config.toml`:

```toml
[mcp_servers.sgai]
url = "https://mcp.scrapegraphai.com/mcp"
```

Restart Codex after saving the configuration. Run `/mcp`, select `sgai`, and authenticate. In the browser window, choose **Continue with Google** and sign in with the Google account associated with your ScrapeGraphAI account.
<Note>
The ChatGPT desktop app, Codex CLI, and the Codex IDE extension share the same MCP configuration on a given host, so this only needs to be done once.
</Note>

After the browser shows **Authentication successful. Connected to sgai.**, return to Codex and verify the connection:
## Authenticate

```bash
codex mcp get sgai
codex mcp login sgai
```

To authenticate with an API key instead, set `SGAI_API_KEY` in the environment and add `bearer_token_env_var = "SGAI_API_KEY"` below the `url`.
Alternatively, restart Codex, run `/mcp`, select `sgai`, and authenticate. Either way a browser window opens: choose **Continue with Google** and sign in with the Google account associated with your ScrapeGraphAI account.

Once the browser shows **Authentication successful. Connected to sgai.**, return to Codex — the tools are ready.

### Local (stdio) alternative
### With an API key instead

If you prefer running locally:
Set `SGAI_API_KEY` in your environment and point Codex at it:

```toml
[mcp_servers.sgai]
url = "https://mcp.scrapegraphai.com/mcp"
bearer_token_env_var = "SGAI_API_KEY"
```

A request carrying an API key skips the OAuth flow, so there is no `codex mcp login` step.

## Verify

```bash
pip install scrapegraph-mcp
codex mcp add scrapegraph-mcp-local \
--env SGAI_API_KEY=YOUR_API_KEY \
-- python3 -m scrapegraph_mcp.server
codex mcp get sgai
```

<Note>
The ChatGPT desktop app, Codex CLI, and Codex IDE extension share the same MCP configuration on the same host. On Windows, replace <code>python3</code> with the Python command available on your system.
</Note>
Then ask Codex to run the `credits` tool. A balance response confirms that authentication and tool execution both work.

<Tip>
See the [tool reference](/services/mcp-server/introduction#available-tools) for everything the server exposes.
</Tip>
Loading