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
| Name | Required | Description | Default |
|---|---|---|---|
| message | No | pong |
Implementation Reference
- src/tools/echo.ts:30-40 (handler)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 } ] }; },
- src/tools/echo.ts:5-7 (schema)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'), });
- src/tools/echo.ts:13-29 (schema)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>;
- src/index.ts:48-52 (helper)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; }