Back to Home
vishnusrinivas00 icon

Cloudflare-analytics-with-MCP-Server-Intergration

Verified Safe

by vishnusrinivas00

Overview

Analyzes Cloudflare Worker logs stored in DuckDB, providing error summaries and performance metrics via a FastAPI server with MCP compatibility.

Installation

Run Command
uvicorn main:app --host 0.0.0.0 --port 8000

Environment Variables

  • CLOUDFLARE_API_TOKEN
  • ACCOUNT_ID
  • WORKER_NAME
  • DB_PATH
  • PORT

Security Notes

Sensitive credentials (Cloudflare API Token, Account ID, Worker Name) are correctly handled as environment variables via `os.getenv` and `dotenv`. SQL queries in analytics endpoints (`query_error_summary_range`, `query_performance_range`, `query_summary_range`) use parameterized queries, which prevents SQL injection. The `/db/inspect` endpoint uses f-strings for `DESCRIBE` and `SELECT` statements; while the table names are internally derived from `SHOW TABLES`, which limits external injection risk, robust input validation or parameterization would be ideal if table names could ever be influenced by untrusted input. No 'eval' or malicious obfuscation patterns were found. Standard web server security practices should be applied for deployment.

Similar Servers

Stats

Interest Score0
Security Score8
Cost ClassLow
Avg Tokens100
Stars0
Forks0
Last Update2025-12-13

Tags

CloudflareAnalyticsFastAPIDuckDBMCP