# Mcp Cloudflare (`celfons/mcp-cloudflare`) Actor

- **URL**: https://apify.com/celfons/mcp-cloudflare.md
- **Developed by:** [Marcel Fonseca Resende de Oliveira](https://apify.com/celfons) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $250.00 / 1,000 full due diligence reports

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## KYB Brasil — Brazilian company due diligence by CNPJ

Check any Brazilian company in one run: Receita Federal registration status, ownership (corporate partners; no personal IDs), screening against the official CGU sanction lists (CEIS, CNEP, CEPIM, leniency agreements), federal government contracts and a deterministic 0-100 risk score with explained red flags. Every result carries a summary in English and Portuguese and the source URL and fetch time of each fact.

Every dossier, risk screen and sanctions result includes `attestation` inside `result`: an Ed25519 signature over the answer, with `sha256`, `signed_at` and `key_id`. Keep the JSON as audit evidence; anyone can verify it later at `POST https://kyb-br-agents.marcelfons.workers.dev/v1/verify` or with the public key at `/.well-known/kyb-attestation.json`.

### Input

- **CNPJs**: list, with or without punctuation. Up to 500 per run.
- **Report**: full dossier (default), risk screen (red flags only, cheaper), sanctions screening only, registration check only, **name search** (fill **Company names** instead of CNPJs; optional state/UF; up to 10 candidates per name), or **prospecting list** (active companies by CNAE, state, city and opening date; one dataset row per establishment, charged per page of 100).

### Output (dataset)

One row per CNPJ: `cnpj`, `legal_name`, `registration_status`, `risk_level`, `risk_score`, `sanctions_clear`, `summary_en`, `summary_pt`, and `result` with the complete JSON (partners, sanctions hits with evidence URLs, federal contracts, red flags, sources, data freshness). Rows with `error` set (invalid or unknown CNPJ, source unavailable) are not charged.

### Pricing

Pay per successful result, by report type (full dossier, risk screen, sanctions screening, registration check, name search), or per page of 100 for the prospecting list. Invalid CNPJs and upstream failures are free. The run respects your "maximum charge per run" and stops when it is reached.

### Data and privacy

Only official open data: Receita Federal open CNPJ data, CGU / Portal da Transparência. No CPF numbers are stored or returned; individuals are never profiled (LGPD). Sanction lists refresh daily; registration data follows the Receita Federal monthly dump.

### Operator setup (not shown to buyers)

Environment variables in the Actor settings: `KYB_BASE_URL` (the Worker URL) and `KYB_INTERNAL_KEY` (equal to the Worker's `INTERNAL_API_KEY` secret). Enable pay-per-event with six events: `dossier-result`, `risk-result`, `sanctions-result`, `company-result`, `search-result` and `list-page`. Deploy from this directory with `apify push` or connect the GitHub repo with folder `apps/apify-actor`.

# Actor input Schema

## `cnpjs` (type: `array`):

Brazilian CNPJs to check, with or without punctuation (e.g. 33.000.167/0001-01). Up to 500 per run. Not used in the 'Name search' report.

## `tool` (type: `string`):

dossier = full due diligence. risk = red flags only, cheaper. sanctions = sanctions screening only. company = registration check only. search = find CNPJs by company NAME (fill 'Company names'). list = prospecting list of active companies by CNAE / state / city (fill the filters; charged per page of 100).

## `names` (type: `array`):

Legal or trade names to resolve to CNPJs, one per line. Used only by the 'Name search' report. Up to 500 per run.

## `state` (type: `string`):

Two-letter state, e.g. SP. Narrows the name search; filters the prospecting list.

## `cnae` (type: `string`):

CNAE code or prefix: 6201-5/00, 6201500, 6201 (class) or 62 (division).

## `city` (type: `string`):

Municipality name, accents and case ignored.

## `opened_after` (type: `string`):

YYYY-MM-DD

## `opened_before` (type: `string`):

YYYY-MM-DD

## `hq_only` (type: `boolean`):

One row per company (skip branches).

## `max_pages` (type: `integer`):

How many pages of 100 establishments to fetch, 1 to 100. Each page is charged once.

## Actor input object example

```json
{
  "cnpjs": [
    "33.000.167/0001-01",
    "00.000.000/0001-91"
  ],
  "tool": "dossier",
  "names": [],
  "hq_only": true,
  "max_pages": 1
}
```

# Actor output Schema

## `overview` (type: `string`):

Table view: company, status, risk, sanctions and summary.

## `full` (type: `string`):

All fields, including the complete due diligence report per CNPJ.

# 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 = {
    "cnpjs": [
        "33.000.167/0001-01",
        "00.000.000/0001-91"
    ],
    "names": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("celfons/mcp-cloudflare").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 = {
    "cnpjs": [
        "33.000.167/0001-01",
        "00.000.000/0001-91",
    ],
    "names": [],
}

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

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

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

```

## CLI example

```bash
echo '{
  "cnpjs": [
    "33.000.167/0001-01",
    "00.000.000/0001-91"
  ],
  "names": []
}' |
apify call celfons/mcp-cloudflare --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,celfons/mcp-cloudflare"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/GhP2zGd5JjLUHYlnv/builds/8oqAKqCzjNlRKV4yX/openapi.json
