Mcp

Deploy MCP Server on Cloudflare Workers

Copy page

Deploy a Model Context Protocol server to Cloudflare Workers with semantic search and Q&A capabilities.

Overview

This self-hosted option deploys your MCP server to Cloudflare's infrastructure.

Key Features

  • Semantic search: RAG-powered search through your knowledge base
  • AI Q&A: Direct answers from an AI assistant trained on your content
  • Inkeep Analytics integration: Logs interactions for insights and improvements
  • Serverless: No server management required
  • Custom domains: Use your own domain with Cloudflare

Quick Start

View the complete template on GitHub →

All setup instructions, configuration details, and deployment steps are in the repository README.

The template provides a complete MCP server implementation ready to deploy:

git clone https://github.com/inkeep/mcp-for-cloudflare
cd mcp-for-cloudflare
npm install
wrangler secret put INKEEP_API_KEY
wrangler deploy

Implementation Example

Below is a snippet of the server tool that calls the inkeep-qa-expert model.

src/index.ts
// Q&A tool using inkeep-qa-expert model
const qaTool = this.server.tool(
  "ask-question-about-inkeep",
  { question: z.string().describe("Question about the product") },
  async ({ question }) => {
    const openai = new OpenAI({ 
      baseURL: INKEEP_API_BASE_URL, 
      apiKey: INKEEP_API_KEY 
    });
 
    const resp = await openai.chat.completions.create({
      model: "inkeep-qa-expert",
      messages: [
        { role: "system", content: "You are an AI assistant knowledgeable about Inkeep." },
        { role: "user", content: question },
      ],
    });
 
    const answer = resp.choices?.[0]?.message?.content;
    return answer ? { content: [{ type: "text", text: answer }] } : { content: [] };
  },
);

MCP Client Setup

Configure your MCP client to use your Cloudflare Workers deployment:

Cursor:

.cursor/mcp.json
{
  "mcpServers": {
    "Inkeep Cloudflare": {
      "url": "https://your-worker-name.your-subdomain.workers.dev/mcp"
    }
  }
}

Claude Desktop:

claude_desktop_config.json
{
  "mcpServers": {
    "inkeep-cf": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://your-worker-name.your-subdomain.workers.dev/mcp"]
    }
  }
}

Need help? Contact support

On this page