Model Context Protocol (MCP) FastAPI SSE Streaming Server Boilerplate
Full-stack Python FastAPI MCP server architecture with SSE streaming endpoints, session state management, and Zod/Pydantic tool schema verification for Claude & Cursor.
Parametric Customizer & Compiler Live Tool
Adjust the variables below. The prompt code and API payload update dynamically in real time.
Scope of tools provided by the MCP server
List of functions Claude or Cursor can execute
Underlying data source and libraries
You are a Principal Backend Engineer building a production-grade remote Model Context Protocol (MCP) Server using Python, FastAPI, and Server-Sent Events (SSE).
### ARCHITECTURAL REQUIREMENTS:
1. **Protocol Compliance**: Implement the official JSON-RPC 2.0 MCP standard specification for `initialize`, `tools/list`, `tools/call`, and `resources/list`.
2. **SSE Transport Mechanism**: Expose `GET /sse` for event streaming (session handshake and server-to-client notifications) and `POST /messages?session_id=...` for client execution requests.
3. **Input Validation with Pydantic**: Every tool definition must expose a rigorous JSON Schema for arguments with type constraints, regex patterns, and default values.
4. **Security & Authentication**: Implement Bearer Token API authorization, per-tenant workspace rate limiting, and defensive error serialization (never leak internal stack traces to the LLM).
Service Details:
- **Server Domain**: {Enterprise Cloud Infrastructure & Kubernetes Orchestration}
- **Target Tools to Expose**: {get_pod_status, scale_deployment, fetch_cluster_metrics, inspect_ingress_logs}
- **Backend Data Source**: {Kubernetes API Client & Prometheus HTTP Endpoint} Open standard for connecting AI assistants to data systems and developer tools.
Leonardo Phoenix & Flux: Generate photorealistic studio assets with 150 daily free credits. Zero setup required.
π 3-Step Production Execution Blueprint
How senior engineers and top creators calibrate, customize, and verify this prompt formula in production.
Target Engine Calibration
Drop this prompt into your project root as `.cursorrules` or load it into Claude 3.5 Sonnet / DeepSeek-R1 system instructions.
Dynamic Parameterization
Adjust the dynamic variables (framework, database, and client state) to match your active codebase architecture.
Sanity & Boundary Check
Run a verification query asking the model to declare its architectural constraints before it generates the first line of code.
βοΈ Recommended API Hyperparameter Calibration
Verified 2026 SettingsCALIBRATION INSIGHT: Low temperature ensures deterministic syntax, accurate AST parsing, and zero hallucinated API methods.
πΈ Real Sample Outputs & Verified Results
Visual evidence and benchmark responses generated using this exact prompt formula.
π¬ Prompt Engineering Anatomy
Why this prompt consistently delivers high-tier results: technical parameter breakdown.
SSE Transport Decoupling Separating the SSE stream (GET) from client command delivery (POST) enables connection multiplexing and auto-reconnection across enterprise firewalls.
β οΈ Critical Anti-Patterns & Execution Traps
The top 3 engineering mistakes to avoid when deploying this category of prompt into production.
Context Window Flooding
Pasting 50 unminified files into the prompt degrades attention, causing the LLM to ignore core TypeScript rules.
Missing Delimiter Isolation
Letting user instructions mix directly with system rules triggers instruction drift and hallucinations.
Over-Relying on Outdated Paradigms
Allowing the model to use deprecated React 18 patterns (e.g. useEffect for data fetching) creates security vulnerabilities.
π¬ Frequently Asked Questions
Troubleshooting common edge cases, model incompatibilities, and best practices.
Can Claude Desktop connect to remote SSE MCP servers?
Yes. In claude_desktop_config.json, provide the URL endpoint with type 'sse' instead of a local command path.
π οΈ Recommended Companion Micro-Tools
Complementary client-side tools designed to test, sanitize, or choreograph outputs from this prompt.
Vibe Coding Prompt Architect (.cursorrules Studio)
Generate production-grade .cursorrules, .windsurfrules, and CLAUDE.md for Next.js 15, FastAPI, and Go with zero-hallucination guardrails.
Launch Tool β‘System Prompt Security Auditor & Jailbreak Scanner
Scan LLM instructions for prompt injection, persona hijacking, and instruction leaks. Score defense 0-100 and auto-harden in 0ms.
Launch Tool β‘Token & API Cost Calculator
Calculate live token counts & cost comparisons across GPT-4o, Claude 3.5, and DeepSeek-R1 with prompt caching discounts.
Launch Tool β‘Cursor AI & Claude 3.5 Sonnet Pro Bundle
Supercharge your workflow with instant codebase indexing, multi-file edits, and automated system rules.
Explore Related Agentic Tooling & Protocols Prompts View all β
Claude 3.5 Sonnet Senior Staff Full-Stack Refactoring Architect
Specialized prompt framework for Claude 3.5 Sonnet and Claude 3.7. Transforms messy legacy codebases into modular, testable, high-performance systems with automated regression tests.
cursorCursor AI (.cursorrules) for Next.js 15, React 19 & Tailwind CSS
Stops Cursor from writing outdated Next.js 13 patterns, Pages Router syntax, or deprecated React hooks. Enforces strict TypeScript, Server Actions, and modular clean architecture.
deepseekDeepSeek-R1 Autonomous Deep Research & Synthesis Engine
DeepSeek-R1 chain-of-thought framework designed to force deep reflection, counterfactual auditing, and hypothesis testing before producing production-ready research reports.