FastAPI SSE MCP Random
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
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FastAPI SSE MCP Randomgenerate a random number between 1 and 50"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: Agent Construct
Prerequisites
Python 3.10+
Azure OpenAI API access (for image generation)
Installation
Clone the repository:
git clone <repository-url>
cd fastapi_sse_mcp_randomInstall the dependencies:
pip install -r requirements.txtOr using uv:
uv pip install -e .Usage
Starting the server
Run the server with:
python main.pyThe 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
{
"name": "echo_tool",
"parameters": {
"message": "Hello, world!"
}
}Random Number Generator
{
"name": "random_number",
"parameters": {
"min_value": 1,
"max_value": 100
}
}Image Generation
{
"name": "generate_image",
"parameters": {
"prompt": "A beautiful landscape with mountains and a lake"
}
}Podcast Generation
{
"name": "generate_podcast",
"parameters": {
"prompt": "The future of artificial intelligence",
"duration": 5,
"name1": "Mark",
"voice1": "Thomas",
"name2": "Sophia",
"voice2": "Emily"
}
}Think Tool
{
"name": "think_tool",
"parameters": {
"input": "What are the implications of quantum computing?"
}
}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
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI assistants to make HTTP requests (GET, POST, PUT, DELETE) to external APIs through standardized MCP tools.Last updated42MIT
- Alicense-quality-maintenanceA standardized MCP server implementation that provides AI models with dynamic tool discovery, execution, and context management capabilities. Built with FastAPI, it offers a modular architecture for easily adding new tools and managing AI application interactions through the Model Context Protocol.Last updated13
- Flicense-qualityDmaintenanceA Model Context Protocol server implementation built with FastAPI that enables AI agent interactions. Provides a structured foundation for building AI-powered applications with proper data validation and modern Python tooling.Last updated
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hk4crprasad/fastapi_sse_mcp_random'
If you have feedback or need assistance with the MCP directory API, please join our Discord server