Skip to main content
Glama
jeffgolden

Cloudflare MCP Server

by jeffgolden

cloudflare-dns-mcp_get_zone_settings

Retrieve the complete settings object for a specified Cloudflare DNS zone using structured inputs to streamline configuration management and analysis.

Instructions

Get full settings object for a zone

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
zone_nameYes

Implementation Reference

  • The handler function for the 'cloudflare-dns-mcp/get_zone_settings' tool. It resolves the zone ID by name, fetches the settings from Cloudflare API, and returns them in MCP content format.
    handler: async (params: any) => {
      const { zone_name } = GetZoneSettingsInputSchema.parse(params);
      const zones = await client.get<any[]>('/zones', { name: zone_name });
      if (zones.length === 0) throw new Error(`Zone ${zone_name} not found`);
      const zoneId = zones[0].id;
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(await client.get(`/zones/${zoneId}/settings`), null, 2)
          }
        ]
      };
    },
  • Zod input schema for the get_zone_settings tool, requiring a zone_name string.
    const GetZoneSettingsInputSchema = z.object({
      zone_name: z.string(),
    });
  • Local registration of the get_zone_settings tool within the getZoneManagementTools function.
    return {
      tools: {
        'cloudflare-dns-mcp/list_zones': listZonesTool,
        'cloudflare-dns-mcp/get_zone_settings': getZoneSettingsTool,
        'cloudflare-dns-mcp/update_zone_settings': updateZoneSettingsTool,
        'cloudflare-dns-mcp/purge_cache': purgeCacheTool,
      },
    };
  • src/index.ts:48-52 (registration)
    Global tool registration where tool names are sanitized (slashes replaced with underscores, e.g., 'cloudflare-dns-mcp/get_zone_settings' becomes 'cloudflare-dns-mcp_get_zone_settings') and added to the toolsMap used by the MCP server.
    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;
    }
  • src/index.ts:25-31 (registration)
    Merging of zone management tools (including get_zone_settings) into the allTools object in the main server entry point.
    const allTools = {
      ...dnsTools.tools,
      ...securityTools.tools,
      ...sslCertTools.tools,
      ...echoTools.tools,
      ...redirectTools.tools,
      ...zoneTools.tools,

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