Skip to main content
Glama
CodeCraftingDevelopment

codecrafting-cloudflare-mcp

codecrafting-cloudflare-mcp

Serveur MCP local (stdio, Node ≥ 22) qui expose en lecture seule l'analytics de trafic Cloudflare de la zone codecrafting.fr. Destiné à tes sessions Claude Code locales (pas à la routine cloud — celle-ci utilise le serveur MCP officiel Cloudflare).

Outils exposés

Outil

Rôle

cf_get_traffic

Trafic agrégé par jour (requêtes, pages vues, visiteurs uniques, menaces, cache) sur N jours.

cf_get_threats_by_country

Menaces bloquées réparties par pays d'origine.

cf_get_targeted_paths

Chemins ciblés par les attaques + statuts. Détecte les fuites (2xx/3xx sur chemin sensible = fichier servi) et les anomalies (5xx). Fenêtre 1 jour max en plan Free (days>1 boucle jour par jour).

cf_graphql_query

Requête GraphQL analytics arbitraire (besoins avancés). Lecture seule.

Related MCP server: Clamp Analytics MCP Server

Installation

cd D:/CodeCrafting/Devs/CodeBase/MCP/codecrafting-cloudflare-mcp
npm install
cp .env.example .env   # puis renseigner le token

Le .env (gitignoré) doit contenir le token Cloudflare lecture seule (Agent-Claude-Security-Review) :

SECURITY_WATCH_CF_API_TOKEN=<token lecture seule>
SECURITY_WATCH_CF_ZONE_ID=<zone ID Cloudflare, depuis le dashboard>

Déclaration dans Claude Code

Ajouter dans la config MCP (.mcp.json du projet, ou config utilisateur Claude Code) :

{
  "mcpServers": {
    "codecrafting-cloudflare": {
      "command": "node",
      "args": ["D:/CodeCrafting/Devs/CodeBase/MCP/codecrafting-cloudflare-mcp/server.mjs"]
    }
  }
}

Le serveur lit son token depuis son propre .env ; rien à passer dans la config. Au prochain démarrage de Claude Code, les 4 outils cf_* sont disponibles.

Sécurité

  • Lecture seule : aucun outil ne modifie quoi que ce soit sur Cloudflare (uniquement des requêtes au dataset Analytics).

  • Le token vit dans le .env local (jamais committé, jamais renvoyé dans une réponse d'outil). Token scopé Analytics Read / Logs Read — aucun droit DNS/WAF/R2.

Test manuel

npm start   # démarre le serveur en stdio (Ctrl+C pour quitter)

Le serveur écrit [codecrafting-cloudflare-mcp] prêt (stdio). sur stderr quand il est prêt.

Available Tools

4 tools
cf_get_targeted_pathsA

Chemins ciblés par les attaques (statuts 4xx/5xx) avec détection de fuite : 2xx/3xx sur chemin sensible = FUITE (fichier servi), 5xx = anomalie (Worker plante au lieu de 404). Fenêtre limitée à 1 jour côté plan Free : utiliser days=1 pour un résultat exact, days>1 boucle jour par jour.

ParametersJSON Schema
NameRequiredDescriptionDefault
zoneNoZone ID Cloudflare (défaut: codecrafting.fr).
daysNoNombre de jours à couvrir (défaut 1).
limitPerDayNoNb max de chemins remontés par jour (défaut 80).

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description bears full weight. It discloses the Free plan limitation (1-day window), how day>1 behaves, and the leak detection logic (2xx/3xx on sensitive path = FUITE, 5xx = anomaly). This fully informs the agent about behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences. First front-loads purpose and detection logic; second adds crucial usage constraint. No wasted words; every piece earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description covers purpose, behavioral nuances, and parameter usage well. It does not describe return format, but the tool's output is likely a list of paths with status info, inferable from context. Considered complete enough for selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline 3. The description adds significant extra meaning for the 'days' parameter by explaining the Free plan constraint and looping behavior, exceeding what the schema provides. No extra info for 'zone' or 'limitPerDay' but schema already describes them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool finds attack-targeted paths with leak detection (FUITE/anomalie). It distinguishes itself from sibling tools like cf_get_traffic or cf_get_threats_by_country by its specific focus on path-level security analysis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear context: indicates when to use (detect leaks/anomalies) and gives a specific usage tip for the Free plan (days=1 exact, days>1 loops). Does not explicitly mention alternatives but is sufficient for understanding when to invoke.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cf_get_threats_by_countryB

Répartition des menaces bloquées par pays d'origine sur N jours. Lecture seule.

ParametersJSON Schema
NameRequiredDescriptionDefault
zoneNoZone ID Cloudflare (défaut: codecrafting.fr).
daysNoNombre de jours (défaut 7).

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It only states 'Lecture seule' (read-only), which is useful but minimal. No disclosure of rate limits, authentication, or other behavioral traits (e.g., pagination, data freshness).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no redundancy. It is front-loaded with the core purpose and efficiently conveys the read-only nature. Every word serves a purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of an output schema, the description should describe the return format (e.g., list of countries with counts). It does not, leaving the agent without crucial information about the tool's output. Sibling context is not leveraged.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds no additional parameter context beyond what the schema already provides (e.g., 'N jours' matches schema's 'Nombre de jours'). No new meaning is added.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it returns the distribution of blocked threats by country over N days and that it is read-only. It uniquely identifies the resource and action, differentiating it from siblings like cf_get_traffic (overall traffic) and cf_get_targeted_paths (specific paths).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. While 'Lecture seule' hints at safety, there is no mention of scenarios or exclusions. The description does not help the agent decide between this and sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cf_get_trafficB

Trafic agrégé de la zone Cloudflare (requêtes, pages vues, visiteurs uniques, menaces, cache) par jour sur N jours. Lecture seule.

ParametersJSON Schema
NameRequiredDescriptionDefault
zoneNoZone ID Cloudflare (défaut: codecrafting.fr).
daysNoNombre de jours (défaut 7, max ~30).

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description marks the tool as read-only ('Lecture seule'), which is the key behavioral trait. However, without annotations, it could have disclosed more (e.g., no side effects, rate limits). It is minimally sufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise (two sentences) and front-loaded with the tool's purpose. It wastes no words, though it could benefit from a bit more structure (e.g., list of metrics).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description does not explain the output format or structure of the returned data. Since there is no output schema, the agent might not know what to expect from the response (e.g., time series, aggregated totals). This is a notable gap for a data retrieval tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already provides descriptions for both parameters (zone, days) with defaults and max values. The description adds no additional semantic meaning beyond what the schema offers, so it does not compensate beyond baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool aggregates Cloudflare zone traffic metrics (requests, page views, unique visitors, threats, cache) per day. It is distinct from sibling tools like cf_get_targeted_paths which focus on specific paths.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for getting aggregated traffic data over N days but does not explicitly state when to prefer this over siblings or any prerequisites. It is adequate but lacks guidance on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cf_graphql_queryA

Exécute une requête GraphQL arbitraire contre l'API Analytics Cloudflare (https://api.cloudflare.com/client/v4/graphql). Pour des besoins avancés non couverts par les autres outils. Lecture seule (dataset analytics).

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesLa requête GraphQL.
variablesNoVariables de la requête (optionnel).

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It indicates read-only behavior and names the specific API URL, but lacks details on authentication, rate limits, or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with a URL and phrase, concise and front-loaded with no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a generic GraphQL executor, the description is adequate but could mention the expected return format or that queries must conform to the Analytics API schema. No output schema exists, so description should cover return values minimally.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with basic descriptions for both parameters. The description does not add additional meaning beyond the schema, so baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it executes arbitrary GraphQL queries against the Cloudflare Analytics API. It also specifies it's for advanced needs not covered by other tools, distinguishing it from the sibling tools which are more specialized.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description notes it is for advanced needs not covered by other tools, providing clear context for when to use it. However, it does not explicitly state when not to use it or provide exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv1.0.0
    • First observedcf_get_targeted_paths
    • First observedcf_get_threats_by_country
    • First observedcf_get_traffic
    • First observedcf_graphql_query

TDQS

A3.9/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: targeted paths, threats by country, aggregated traffic, and arbitrary GraphQL queries. No overlap.

Naming Consistency4/5

Three tools follow 'cf_get_*' pattern, but 'cf_graphql_query' uses 'query' instead of 'get', introducing a minor inconsistency.

Tool Count5/5

With 4 tools, the set is well-scoped for Cloudflare analytics, covering key metrics and offering flexibility via GraphQL.

Completeness4/5

Covers common analytics needs; arbitrary GraphQL fills gaps. Minor missing features like DNS analytics but overall sufficient.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Enables querying Rybbit Analytics data directly through MCP-compatible clients like Claude Code. It provides tools for monitoring website statistics, user sessions, error logs, funnels, and performance metrics via natural language.
    40
    13
    4
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Provides AI assistants with read access to Clamp analytics data including pageviews, visitors, referrers, and custom events. Enables traffic analysis, conversion funnel evaluation, and metric alerts through natural language queries.
    33
    32
    2
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Exposes analytics from Claude Code transcripts as MCP tools, enabling cost, audit, safety, and efficiency queries through natural language.
    4
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Connects MCP clients like Claude Desktop to Google Analytics 4 Data API, enabling natural language queries for reports, top pages, traffic sources, conversions, realtime users, and period comparisons.
    7
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CodeCraftingDevelopment/codecrafting-cloudflare-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server