Skip to main content
Glama
jeffgolden

Cloudflare MCP Server

by jeffgolden

cloudflare-dns-mcp_echo

Validate connectivity by sending a payload and receiving the same in response. Use this tool to test communication with Cloudflare MCP Server for DNS and security configurations.

Instructions

Simple connectivity check that returns the same payload sent by the client.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNopong

Implementation Reference

  • The handler function for the 'cloudflare-dns-mcp/echo' tool. It parses the input message using Zod schema and returns it wrapped in the MCP content format with type 'text'.
    handler: async (params: unknown) => { const { message } = EchoInputSchema.parse(params); return { content: [ { type: "text", text: message } ] }; },
  • Zod input schema for the echo tool, defining an optional 'message' field defaulting to 'pong'.
    const EchoInputSchema = z.object({ message: z.string().optional().default('pong'), });
  • JSON schema for the output of the echo tool, expecting an object with a 'content' array of text blocks.
    outputSchema: { type: 'object', properties: { content: { type: 'array', items: { type: 'object', properties: { type: { type: 'string' }, text: { type: 'string' } } } } }, required: ['content'], additionalProperties: false, },
  • src/tools/echo.ts:4-44 (registration)
    The getEchoTools function defines and exports the echo tool object, which is later imported and merged into the server's tools map.
    export function getEchoTools() { const EchoInputSchema = z.object({ message: z.string().optional().default('pong'), }); const echoTool = { name: 'cloudflare-dns-mcp/echo', description: 'Simple connectivity check that returns the same payload sent by the client.', inputSchema: zodToJsonSchema(EchoInputSchema), outputSchema: { type: 'object', properties: { content: { type: 'array', items: { type: 'object', properties: { type: { type: 'string' }, text: { type: 'string' } } } } }, required: ['content'], additionalProperties: false, }, handler: async (params: unknown) => { const { message } = EchoInputSchema.parse(params); return { content: [ { type: "text", text: message } ] }; }, }; return { tools: { 'cloudflare-dns-mcp/echo': echoTool } }; }
  • src/index.ts:22-32 (registration)
    In the main server file, getEchoTools is called and its tools are merged into the allTools object used for MCP server registration.
    const echoTools = getEchoTools(); const redirectTools = getRedirectTools(cfClient); const allTools = { ...dnsTools.tools, ...securityTools.tools, ...sslCertTools.tools, ...echoTools.tools, ...redirectTools.tools, ...zoneTools.tools, } as Record<string, any>;
  • Helper code that sanitizes tool names by replacing non-alphanumeric characters (like '/') with '_', transforming 'cloudflare-dns-mcp/echo' to 'cloudflare-dns-mcp_echo' for the toolsMap used in MCP calls.
    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