- Home
- MCP servers
- Cloudflare AutoRAG
Cloudflare AutoRAG
- typescript
12
GitHub Stars
typescript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"noops888-cf-autorag-mcp": {
"command": "npx",
"args": [
"mcp-remote",
"https://your-worker-url.workers.dev/"
],
"env": {
"AI": "AI_BINDING",
"AUTORAG_NAME": "my-autorag",
"AUTORAG_INSTANCES": "default-autorag,secondary-autorag",
"AUTORAG_DESCRIPTIONS": "Main KB,Secondary KB"
}
}
}
}You use this MCP server to search across your Cloudflare AutoRAG knowledge bases with three search modes: basic vector search, AI-assisted query rewriting, and full AI-powered search. It runs on Cloudflare Workers and connects your MCP client to one or more AutoRAG instances, delivering relevant document chunks and optional AI responses.
How to use
You connect an MCP client to the Cloudflare AutoRAG MCP Server to perform searches across your AutoRAG indices. You can run a basic search to get document chunks based on vector similarity, a rewrite search that enhances the query with AI rewriting while returning document chunks only, or an AI search that optionally includes an AI-generated answer. If you have multiple AutoRAG instances, you can search across them and paginate through large result sets when using AI search.
From your MCP client, choose one of the three tools and provide a query along with optional parameters such as score_threshold, max_num_results, and whether to rewrite the query or include an AI response. For multi-instance setups, specify the target AutoRAG by name when invoking the tool. Use the default score threshold of 0.5 if you do not supply a value.
How to install
Prerequisites you need before deploying and using the server:
-
Node.js (for building and running development scripts)
-
npm (comes with Node.js) for dependency management
-
Wrangler CLI for deploying Cloudflare Workers
-
A Cloudflare account with AutoRAG access and an AutoRAG index ready for querying
Follow these steps to set up and deploy the MCP server, then configure your MCP client to connect to the generated Worker URL.
# Step 1: Install dependencies
npm install
# Step 2: Deploy to Cloudflare Workers
npx wrangler deploy
# Step 3: Note the Worker URL printed after deployment and use it in your MCP client configuration
Additional sections
Configuration and deployment details help you tailor the MCP server to your AutoRAG setup and your Cloudflare environment.
Environment bindings and configuration keys include the AutoRAG instance names, descriptions for multiple instances, and the Cloudflare AI binding used to access AutoRAG data.
Claude Desktop users can add the MCP server to your client by pointing to the deployed Worker URL and then restarting Claude Desktop to enable the AutoRAG search tools in conversations.
Important notes:
- The server connects to AutoRAG via Cloudflare’s AI binding and does not require a separate VECTORIZE binding.
- Default search score threshold is 0.5 for all tools. You can override it per request in your MCP client.
- AI search supports pagination via a cursor for large result sets (v1.2.0+). If there are more results, you receive a next_page cursor and a nextCursor field in the response.
Configuration details
The server supports single or multiple AutoRAG instances. In a single instance setup, provide AUTORAG_NAME. In a multi-instance setup (v2.0.0+), provide AUTORAG_INSTANCES and AUTORAG_DESCRIPTIONS to describe each instance.
Wrangler configuration includes the AI binding and the AutoRAG-related environment values. The worker uses the AI binding to access AutoRAG data.
Typical deployment flow involves cloning the project, installing dependencies, configuring wrangler.toml with your AutoRAG names, and running the deploy command. The deployed Worker URL becomes your MCP endpoint for client configuration.
# Wrangler.toml (example excerpt)
name = "cf-autorag-mcp"
main = "src/server.ts"
compatibility_date = "2024-09-23"
compatibility_flags = ["nodejs_compat"]
[vars]
# For single AutoRAG instance:
AUTORAG_NAME = "your-autorag-instance-name"
# For multiple AutoRAG instances (v2.0.0+):
# AUTORAG_INSTANCES = "default-autorag,secondary-autorag,specialized-autorag"
# AUTORAG_DESCRIPTIONS = "Main knowledge base,Secondary knowledge base,Specialized documents"
[ai]
binding = "AI"
Troubleshooting
Common issues you might encounter include an AutoRAG instance not found, MCP server disconnected, tool not found errors, or empty search results. Address these by verifying the configured AutoRAG name, ensuring the Worker URL is correct and accessible, restarting the MCP client, and adjusting the score threshold if necessary.
# Tail logs during development or after deployment
npx wrangler tail
Notes on usage with Claude Desktop
To use with Claude Desktop, configure the MCP server by adding the provided configuration that points to your deployed Worker URL. Restart Claude Desktop to enable the AutoRAG search tools in conversations.
Available tools
autorag_basic_search
Performs a basic vector similarity search in your AutoRAG index without AI query rewriting or answer generation. Returns raw document chunks only.
autorag_rewrite_search
Performs a vector search with AI query rewriting but returns only document chunks. Uses rewrite_query to improve semantic matching.
autorag_ai_search
Performs AI-powered search with optional AI-generated response and optional query rewriting. Returns document chunks and optionally an AI answer. Supports pagination.
list_autorags
Lists all configured AutoRAG instances available on the MCP server (v2.0.0+).
get_current_autorag
Returns information about the currently configured default AutoRAG instance (v2.0.0+).