Cloudflare AI Gateway MCP Server provides a Model Context Protocol (MCP) implementation that connects to Cloudflare's AI Gateway API. This server enables access to Cloudflare's global Internet traffic insights and AI tools through a secure OAuth authentication flow.
The MCP server currently offers these tools:
list_gateways
- Lists all AI Gateways in your account with pagination supportlist_logs
- Retrieves gateway logs with filtering options for date ranges, feedback scores, and moreget_log_details
- Fetches detailed information about a specific log by IDget_log_request_body
- Retrieves the request body for a specific logget_log_response_body
- Retrieves the response body for a specific logNote: You must have an active account set to use these tools. If needed, use accounts_list
to see your accounts and set_active_account
to select one.
If your MCP client directly supports remote MCP servers:
https://ai-gateway.mcp.cloudflare.com
in your client interfaceThis is supported in tools like Cloudflare AI Playground.
If your client doesn't directly support remote MCP servers:
Install the mcp-remote package:
npm install mcp-remote
Create or modify your client's configuration file with:
{
"mcpServers": {
"cloudflare": {
"command": "npx",
"args": ["mcp-remote", "https://ai-gateway.mcp.cloudflare.com/sse"]
}
}
}
Restart your MCP client
Complete the OAuth authentication flow in the browser window that opens
After authentication, the tools will be available in your client
Try these example prompts to get started:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.