Streamable HTTP MCP Server
Provides containerized deployment options using Docker and Docker Compose for easy setup and operation of the MCP server.
Implements a streamable HTTP MCP server using FastAPI with Server-Sent Events (SSE) support for real-time communication and response streaming.
Integrates with Azure OpenAI GPT-4o for intelligent tool usage, enabling capabilities like calculations, weather queries, and time-related functions through tool calling features.
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., "@Streamable HTTP MCP Servercalculate the total cost for 5 items at $12.99 each"
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.
Streamable HTTP MCP Server with Azure OpenAI GPT-4o
This project implements a Streamable HTTP MCP (Model Context Protocol) Server using FastAPI and integrates it with Azure OpenAI GPT-4o for intelligent tool usage.
🚀 Features
MCP Server: Streamable HTTP server with SSE support
Azure OpenAI Integration: GPT-4o with tool calling capabilities
Simple Tools: Calculator, Weather (mock), and Time tools
Docker Setup: Easy deployment with docker-compose
Real-time Communication: Server-Sent Events (SSE) for streaming responses
Related MCP server: Azure DevOps MCP Server
📋 Prerequisites
Docker and Docker Compose
Azure OpenAI account with GPT-4o deployment
Python 3.11+ (for local development)
🛠️ Quick Setup
Clone and setup:
# Copy environment file
cp .env.example .env
# Edit .env with your Azure OpenAI credentials
nano .envConfigure Azure OpenAI:
AZURE_OPENAI_API_KEY=your_api_key_here
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
AZURE_OPENAI_API_VERSION=2024-02-01Start the MCP server:
./setup.sh startRun the GPT-4o client:
./setup.sh client📖 Usage Examples
Basic Tool Usage
The client automatically demonstrates various tool interactions:
Query: What's the current time?
Response: The current time is 2024-01-15T14:30:45.123456
Query: Calculate 15 * 42 + 33
Response: The result is 663
Query: What's the weather like in New York?
Response: The weather in New York is currently sunny with a temperature of 22°C...Complex Multi-tool Usage
Query: Can you get the weather for London and then calculate the percentage if the temperature was 20 degrees and now it's 25 degrees?
Response: The weather in London is currently 22°C and sunny...
The percentage increase from 20°C to 25°C is 25%.🔧 Available Tools
Calculator: Evaluate mathematical expressions
Weather: Get mock weather data for any location
Time: Get current timestamp
🏗️ Architecture
[GPT-4o Client] <--HTTP--> [MCP Server] <--SSE--> [Tools]
| |
| [Calculator]
| [Weather]
| [Time]🌐 API Endpoints
POST /sse- Main MCP communication endpointGET /health- Health checkGET /tools- List available tools
📝 Manual Testing
Test the MCP server directly:
# Health check
curl http://localhost:8000/health
# List tools
curl http://localhost:8000/tools
# Test SSE endpoint
curl -X POST http://localhost:8000/sse \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": "1", "method": "tools/list", "params": {}}'🐳 Docker Commands
# Start MCP server only
docker-compose up -d mcp-server
# Run client once
docker-compose run --rm client
# View logs
docker-compose logs -f mcp-server
# Stop everything
docker-compose down🧪 Development
Local Development
# Install dependencies
pip install -r requirements.txt
# Run server locally
python mcp_server.py
# Run client locally (in another terminal)
source .env
python client.pyAdding New Tools
Create a new tool class in
mcp_server.pyAdd tool definition to
TOOLSdictionaryAdd handler in
MCPHandler.handle_tools_call
Example:
class NewTool:
@staticmethod
def do_something(param: str) -> Dict[str, Any]:
return {"result": f"Processed: {param}"}
# Add to TOOLS dictionary
TOOLS["new_tool"] = {
"name": "new_tool",
"description": "Does something useful",
"inputSchema": {
"type": "object",
"properties": {
"param": {"type": "string", "description": "Input parameter"}
},
"required": ["param"]
}
}🐛 Troubleshooting
Common Issues
Connection refused: Make sure MCP server is running on port 8000
Authentication errors: Check your Azure OpenAI credentials in
.envTool call failures: Check MCP server logs for detailed error messages
Debug Mode
Enable debug logging:
docker-compose logs -f mcp-server🔒 Security Notes
Never commit your
.envfile with real credentialsUse environment variables in production
Consider adding authentication for production deployments
📄 License
MIT License - feel free to use and modify as needed.
This server cannot be installed
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
- Alicense-qualityFmaintenanceThis server provides a convenient API for interacting with Azure DevOps services, enabling AI assistants and other tools to manage work items, code repositories, boards, sprints, and more. Built with the Model Context Protocol, it provides a standardized interface for communicating with Azure DevOpsLast updated8158MIT
- AlicenseBqualityAmaintenanceA Model Context Protocol server that enables AI assistants to interact with Azure DevOps resources including projects, work items, repositories, pull requests, branches, and pipelines through a standardized protocol.Last updated463,603382MIT
- -license-quality-maintenanceA reference server implementation for the Model Context Protocol that enables AI assistants to interact with Azure DevOps resources and perform operations such as project management, work item tracking, repository operations, and code search programmatically.Last updated7
- AlicenseAqualityFmaintenanceA Model Context Protocol server that enables AI assistants to interact with Azure DevOps services, allowing users to query work items with plans to support creating/updating items, managing pipelines, handling pull requests, and administering sprints and branch policies.Last updated2179MIT
Related MCP Connectors
A Model Context Protocol server for Wix AI tools
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.
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/tevinric/mcp-protocol-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server