Uses FastAPI to implement the Model Context Protocol server with Server-Sent Events for streaming communication
Connects to Azure OpenAI DALL-E 3 for image generation based on text prompts
Built with Python 3.10+ and includes various utility tools like random number generation, echo functionality, and AI podcast generation
FastAPI SSE MCP Random
A FastAPI server that implements the Model Context Protocol (MCP) using Server-Sent Events (SSE) for streaming communication. This project provides various utility tools including random number generation, image generation using Azure OpenAI DALL-E, and AI podcast generation.
Features
- Server-Sent Events (SSE) for real-time streaming communication
- Model Context Protocol (MCP) implementation for structured tool use
- Multiple utility tools:
- Echo tool and resources
- Random number generator
- Image generation via Azure OpenAI DALL-E 3
- AI podcast generation
- "Think tool" for reflective responses
Prerequisites
- Python 3.10+
- Azure OpenAI API access (for image generation)
Installation
- Clone the repository:
- Install the dependencies:
Or using uv
:
Usage
Starting the server
Run the server with:
The server will start at http://0.0.0.0:8000
Available Endpoints
GET /
: Health check endpointGET /sse/
: SSE connection endpointPOST /messages/
: Endpoint for client messages
Available Tools
Echo Tool
Random Number Generator
Image Generation
Podcast Generation
Think Tool
Project Structure
main.py
: Main FastAPI application and MCP tools implementationsse.py
: Server-Sent Events (SSE) implementationpyproject.toml
: Project metadata and dependenciesrequirements.txt
: Basic dependencies list
Dependencies
- FastAPI: Web framework for building APIs
- MCP: Model Context Protocol implementation
- OpenAI: Client for Azure OpenAI services
- Uvicorn: ASGI server for running FastAPI applications
- Requests: HTTP library for API calls
License
[Specify your license here]
Contributing
[Instructions for contributing to the project]
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A FastAPI server implementing the Model Context Protocol (MCP) for structured tool use, providing utility tools including random number generation, image generation via Azure OpenAI DALL-E, and AI podcast generation.
Related MCP Servers
- AsecurityFlicenseAqualityA FastMCP server implementation that facilitates resource-based access to AI model inference, focusing on image generation through the Replicate API, with features like real-time updates, webhook integration, and secure API key management.Last updated -1815Python
- -securityAlicense-qualityA high-performance FastAPI server supporting Model Context Protocol (MCP) for seamless integration with Large Language Models, featuring REST, GraphQL, and WebSocket APIs, along with real-time monitoring and vector search capabilities.Last updated -9PythonMIT License
- -securityFlicense-qualityA production-ready MCP server built with FastAPI, providing an enhanced tool registry for creating, managing, and documenting AI tools for Large Language Models (LLMs).Last updated -32Python
- -securityAlicense-qualityA FastMCP server implementation that provides a standardized interface for accessing AI models hosted on Replicate's API, currently supporting image generation with customizable parameters.Last updated -3PythonMIT License