Skip to main content
Glama
jeffgolden

Cloudflare MCP Server

by jeffgolden

cloudflare-dns-mcp_list_zone_settings

Retrieve and manage DNS, security, and redirect settings for a specified zone on Cloudflare. Streamlines configuration and monitoring tasks for AI-assisted automation.

Instructions

Retrieve all settings for a specific zone

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
zone_nameYes

Implementation Reference

  • The core handler function for the tool. It validates the input zone_name, queries Cloudflare zones API to get zone ID, then fetches and returns the zone settings from /zones/{zoneId}/settings endpoint.
    const { zone_name } = ListZoneSettingsInputSchema.parse(params); const zones = await client.get<Array<{ id: string; name: string }>>('/zones', { name: zone_name }); if (zones.length === 0) throw new Error(`Zone ${zone_name} not found`); const settings = await client.get<any>(`/zones/${zones[0].id}/settings`); return settings; },
  • Zod input schema definition requiring a 'zone_name' string parameter. The inputSchema and outputSchema are derived from this and set on the tool object.
    const listZoneSettingsTool: Tool = {
  • Local registration of the tool object within the 'tools' record returned by getDnsTools(client) function.
    'cloudflare-dns-mcp/list_zone_settings': listZoneSettingsTool,
  • src/index.ts:25-31 (registration)
    Aggregation of all tools objects, including dnsTools.tools (which contains the list_zone_settings tool), into a single allTools map used by the MCP server.
    const allTools = { ...dnsTools.tools, ...securityTools.tools, ...sslCertTools.tools, ...echoTools.tools, ...redirectTools.tools, ...zoneTools.tools,
  • Helper code that sanitizes tool names by replacing non-alphanumeric chars (like '/') with '_', transforming 'cloudflare-dns-mcp/list_zone_settings' to 'cloudflare-dns-mcp_list_zone_settings' for client use.
    const toolsMap: Record<string, any> = {}; for (const tool of Object.values(allTools)) { const safeName = tool.name.replace(/[^a-zA-Z0-9_-]/g, '_'); toolsMap[safeName] = tool; }

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/jeffgolden/cloudflare_mcp'

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