Skip to main content
Glama
sharozdawa

indexnow-mcp

by sharozdawa

indexnow_generate_key

Generate an IndexNow API key and verification file content to submit URLs for instant indexing, requiring hosting the file at your domain root.

Instructions

Generate an IndexNow API key and the verification file content. You need to host this file at your domain root.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
custom_keyNoCustom API key (optional — a UUID will be generated if not provided)

Implementation Reference

  • Handler implementation for indexnow_generate_key tool.
    async ({ custom_key }) => {
      const key = custom_key || crypto.randomUUID();
      const fileContent = generateApiKeyFile(key);
    
      let output = `## IndexNow API Key Generated\n\n`;
      output += `**Your API Key:** \`${key}\`\n\n`;
      output += `### Setup Instructions\n\n`;
      output += `1. Create a file named \`${key}.txt\` in your website's root directory\n`;
      output += `2. The file should contain only: \`${fileContent}\`\n`;
      output += `3. Verify it's accessible at: \`https://yourdomain.com/${key}.txt\`\n\n`;
      output += `### File Content\n\`\`\`\n${fileContent}\n\`\`\`\n\n`;
      output += `### Quick Setup Commands\n\`\`\`bash\n`;
      output += `# For static sites\necho "${key}" > public/${key}.txt\n\n`;
      output += `# For Next.js\necho "${key}" > public/${key}.txt\n\n`;
      output += `# For WordPress\necho "${key}" > ${key}.txt\n`;
      output += `# Upload to your WordPress root directory\n\`\`\`\n\n`;
      output += `### Supported Search Engines\n`;
  • src/index.ts:388-410 (registration)
    Registration of indexnow_generate_key tool.
    server.tool(
      "indexnow_generate_key",
      "Generate an IndexNow API key and the verification file content. You need to host this file at your domain root.",
      {
        custom_key: z.string().optional().describe("Custom API key (optional — a UUID will be generated if not provided)"),
      },
      async ({ custom_key }) => {
        const key = custom_key || crypto.randomUUID();
        const fileContent = generateApiKeyFile(key);
    
        let output = `## IndexNow API Key Generated\n\n`;
        output += `**Your API Key:** \`${key}\`\n\n`;
        output += `### Setup Instructions\n\n`;
        output += `1. Create a file named \`${key}.txt\` in your website's root directory\n`;
        output += `2. The file should contain only: \`${fileContent}\`\n`;
        output += `3. Verify it's accessible at: \`https://yourdomain.com/${key}.txt\`\n\n`;
        output += `### File Content\n\`\`\`\n${fileContent}\n\`\`\`\n\n`;
        output += `### Quick Setup Commands\n\`\`\`bash\n`;
        output += `# For static sites\necho "${key}" > public/${key}.txt\n\n`;
        output += `# For Next.js\necho "${key}" > public/${key}.txt\n\n`;
        output += `# For WordPress\necho "${key}" > ${key}.txt\n`;
        output += `# Upload to your WordPress root directory\n\`\`\`\n\n`;
        output += `### Supported Search Engines\n`;
  • Helper function to generate the content for the API key file.
    function generateApiKeyFile(apiKey: string): string {
      return apiKey;
    }

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/sharozdawa/indexnow-mcp'

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