# MCP Research Agent (`enezli/mcp-research-agent`) Actor

Structured web research for AI agents. Search, fetch and structure web data into the exact JSON schema you request. Clean, predictable output for Claude and MCP workflows, ready to drop into RAG pipelines.

- **URL**: https://apify.com/enezli/mcp-research-agent.md
- **Developed by:** [Turgay NANTA](https://apify.com/enezli) (community)
- **Categories:** AI, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $100.00 / 1,000 web searches

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## MCP Research Agent — Schema-Based Web Data for AI Agents

Give AI agents (Claude, ChatGPT, custom LLMs) **schema-based, structured web data**: send a research question + the fields you want (a schema) → the actor searches the web, fetches pages, and structures them into your requested JSON schema → it returns **clean, predictable JSON**.

> **No subscription — pay per event.** You pay per run + per search + per page structured. Nothing else.

---

### What it does

LLM agents don't want web data as a raw markdown blob — they want it in a **shape they can consume directly**. This actor combines "search → fetch → fit to schema" into a single tool. The agent only says *what* it wants (the fields); the output comes back in the same shape every time.

- 🔎 **Searches** the web for your question (via an upstream search actor).
- 📄 **Fetches** the result pages.
- 🧩 **Structures** each page into exactly your JSON schema — missing fields become `null`, types are coerced (`"19,999.90 TL"` → `19999.9`).
- 🛡️ **Per-field confidence:** every field gets a deterministic confidence label so the agent knows what it can trust.

### Input

| Field | Description |
|---|---|
| `query` | The research question (required). |
| `schema` | The fields to extract (required). `["name","price"]` or `[{"name":"price","type":"number"}]`. Types: `string \| number \| boolean \| array \| object`. |
| `maxResults` | Max number of sources to structure (1-50, cost control). |
| `language` | Output language of the natural-language text values (JSON keys stay unchanged). |
| `model` | (Advanced) LLM model — the default is cheap and fast. |

### Output (dataset)

```json
{
  "query": "...",
  "schema": ["name", "price", "in_stock"],
  "result_count": 5,
  "results": [
    {
      "name": "...",
      "price": 19999.9,
      "in_stock": true,
      "_source_url": "...",
      "_confidence": {"name": "high", "price": "high", "in_stock": "grounded"}
    }
  ],
  "sources": [{"title": "...", "url": "..."}]
}
````

Missing fields come back as `null` — the schema integrity is always preserved (the agent parses safely). Values are coerced to the schema type.

Each record carries two meta fields:

- `_source_url` — the source page the value was extracted from.
- `_confidence` — a deterministic confidence label per field. **All types go through real grounding** (boolean/array included — there is no blind "filled" flag):

  - `high` — a string/number value was found verbatim in the source (digit-aware matching for numbers).
  - `grounded` — a boolean/array value is supported by evidence in the source (e.g. for `in_stock=true` the source contains "in stock"; at least one list element appears in the source). Word-boundary-aware matching reduces false positives.
  - `unverified` — the field is filled but unsupported in the source (may be an LLM inference — the agent should verify). `object` fields cannot be verified deterministically, so they honestly return `unverified`.
  - `null` — the field is empty.

  Important: `high`/`grounded` means "verified in the fetched source text" — **not** "absolutely true on the internet". For critical decisions, the agent should verify `unverified` fields itself.

### Honest boundary

This actor is a **research + structuring** layer, not a ground-truth database. Output quality depends directly on the **quality of the fetched web sources**: the web search is delegated to an upstream search actor (e.g. `apify/rag-web-browser`), and the actor structures only that fetched text to the schema, putting `null` where the source has no information (no fabrication). If the source is weak/incomplete, fields come back `unverified` or `null` — that is an honest signal, not a defect.

### Using it as an MCP server

This actor runs both ways:

1. **As a classic Apify Actor** — call it directly (query → structured JSON), via the Apify Console, API, or schedule.
2. **As an MCP-server tool** — Apify exposes the actor over its **hosted MCP endpoint** (`https://mcp.apify.com`). An MCP-compatible AI agent (e.g. Claude Desktop, or any client implementing the Model Context Protocol) connects to that endpoint and calls this actor as a `structured_web_research`-style tool: the agent passes `query` + `schema`, the actor runs, and the structured JSON is returned to the agent as the tool result.

The actor logic is identical in both modes — same input, same output, same Pay-Per-Event billing (the agent pays per call). To use it from an MCP client, add the Apify hosted MCP server to your client's MCP configuration and reference this actor; consult the Apify MCP documentation for the exact connection/auth setup.

### Why this actor?

Almost every MCP tool is free; paid, value-adding MCP tools are rare. "Search → fetch → fit to schema" in a single tool, with predictable output — a structure agents can connect to with confidence.

### Pricing (Pay-Per-Event)

You only pay for what you use: per run + per search + per page structured. No monthly subscription.

# Actor input Schema

## `query` (type: `string`):

The question/topic to search the web for. e.g. 'Top 5 vegan restaurants in Istanbul' or 'X brand phone prices'.

## `schema` (type: `array`):

The output fields the AI agent wants. A flat array of names OR {name, type, description} objects. type: string | number | boolean | array | object (default string).

## `maxResults` (type: `integer`):

The maximum number of sources to structure (cost control). 1-50.

## `language` (type: `string`):

The language of the structured natural-language text values. JSON keys stay unchanged.

## `model` (type: `string`):

The LLM model. The default is cheap + fast; pick a stronger model for harder extraction.

## Actor input object example

```json
{
  "query": "Top 5 open-source vector databases",
  "schema": [
    {
      "name": "name",
      "type": "string",
      "description": "product/tool name"
    },
    {
      "name": "license",
      "type": "string"
    },
    {
      "name": "star_count",
      "type": "number",
      "description": "GitHub star count"
    },
    {
      "name": "features",
      "type": "array"
    }
  ],
  "maxResults": 5,
  "language": "English",
  "model": "claude-haiku-4-5-20251001"
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "Top 5 open-source vector databases",
    "schema": [
        {
            "name": "name",
            "type": "string",
            "description": "product/tool name"
        },
        {
            "name": "license",
            "type": "string"
        },
        {
            "name": "star_count",
            "type": "number",
            "description": "GitHub star count"
        },
        {
            "name": "features",
            "type": "array"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("enezli/mcp-research-agent").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "query": "Top 5 open-source vector databases",
    "schema": [
        {
            "name": "name",
            "type": "string",
            "description": "product/tool name",
        },
        {
            "name": "license",
            "type": "string",
        },
        {
            "name": "star_count",
            "type": "number",
            "description": "GitHub star count",
        },
        {
            "name": "features",
            "type": "array",
        },
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("enezli/mcp-research-agent").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "Top 5 open-source vector databases",
  "schema": [
    {
      "name": "name",
      "type": "string",
      "description": "product/tool name"
    },
    {
      "name": "license",
      "type": "string"
    },
    {
      "name": "star_count",
      "type": "number",
      "description": "GitHub star count"
    },
    {
      "name": "features",
      "type": "array"
    }
  ]
}' |
apify call enezli/mcp-research-agent --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=enezli/mcp-research-agent",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "MCP Research Agent",
        "description": "Structured web research for AI agents. Search, fetch and structure web data into the exact JSON schema you request. Clean, predictable output for Claude and MCP workflows, ready to drop into RAG pipelines.",
        "version": "0.1",
        "x-build-id": "5LxEPCJyMuyUUNepf"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/enezli~mcp-research-agent/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-enezli-mcp-research-agent",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/enezli~mcp-research-agent/runs": {
            "post": {
                "operationId": "runs-sync-enezli-mcp-research-agent",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/enezli~mcp-research-agent/run-sync": {
            "post": {
                "operationId": "run-sync-enezli-mcp-research-agent",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "query",
                    "schema"
                ],
                "properties": {
                    "query": {
                        "title": "Research question",
                        "type": "string",
                        "description": "The question/topic to search the web for. e.g. 'Top 5 vegan restaurants in Istanbul' or 'X brand phone prices'."
                    },
                    "schema": {
                        "title": "Fields to extract (schema)",
                        "type": "array",
                        "description": "The output fields the AI agent wants. A flat array of names OR {name, type, description} objects. type: string | number | boolean | array | object (default string)."
                    },
                    "maxResults": {
                        "title": "Maximum results",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "The maximum number of sources to structure (cost control). 1-50.",
                        "default": 5
                    },
                    "language": {
                        "title": "Output language",
                        "enum": [
                            "English",
                            "Türkçe",
                            "Deutsch",
                            "Español",
                            "Français"
                        ],
                        "type": "string",
                        "description": "The language of the structured natural-language text values. JSON keys stay unchanged.",
                        "default": "English"
                    },
                    "model": {
                        "title": "Model (advanced)",
                        "enum": [
                            "claude-haiku-4-5-20251001",
                            "claude-sonnet-4-6"
                        ],
                        "type": "string",
                        "description": "The LLM model. The default is cheap + fast; pick a stronger model for harder extraction.",
                        "default": "claude-haiku-4-5-20251001"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
