Skip to main content
Glama

Streamable HTTP MCP Server

by tevinric
setup.sh3.12 kB
#!/bin/bash # MCP Server Setup and Usage Script echo "🚀 MCP Server Setup" echo "====================" # Check if docker-compose is installed if ! command -v docker-compose &> /dev/null; then echo "❌ docker-compose is not installed. Please install it first." exit 1 fi # Check if .env file exists if [ ! -f ".env" ]; then echo "📝 Creating .env file from example..." cp .env.example .env echo "⚠️ Please edit .env file with your Azure OpenAI credentials" echo " Required variables:" echo " - AZURE_OPENAI_API_KEY" echo " - AZURE_OPENAI_ENDPOINT" echo " - AZURE_OPENAI_DEPLOYMENT_NAME (optional)" echo " - AZURE_OPENAI_API_VERSION (optional)" echo "" echo " Example:" echo " AZURE_OPENAI_API_KEY=abc123..." echo " AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/" echo "" exit 1 fi # Function to start MCP server start_server() { echo "🔧 Starting MCP Server..." docker-compose up -d mcp-server echo "✅ MCP Server started on http://localhost:8000" echo "" echo "🔍 Available endpoints:" echo " - Health check: http://localhost:8000/health" echo " - List tools: http://localhost:8000/tools" echo " - SSE endpoint: http://localhost:8000/sse" echo "" } # Function to run client run_client() { echo "🤖 Running GPT-4o client..." docker-compose run --rm client } # Function to run client locally run_client_local() { echo "🤖 Running GPT-4o client locally..." source .env python client.py } # Function to stop services stop_services() { echo "🛑 Stopping services..." docker-compose down echo "✅ Services stopped" } # Function to view logs view_logs() { echo "📋 Viewing logs..." docker-compose logs -f mcp-server } # Function to test server test_server() { echo "🧪 Testing MCP Server..." echo "Checking health..." curl -s http://localhost:8000/health | jq . echo "" echo "Listing available tools..." curl -s http://localhost:8000/tools | jq . echo "" } # Main menu case "${1:-menu}" in "start") start_server ;; "client") run_client ;; "client-local") run_client_local ;; "stop") stop_services ;; "logs") view_logs ;; "test") test_server ;; "restart") stop_services start_server ;; "menu"|*) echo "📋 Available commands:" echo " ./setup.sh start - Start MCP server" echo " ./setup.sh client - Run GPT-4o client (Docker)" echo " ./setup.sh client-local - Run GPT-4o client (Local)" echo " ./setup.sh test - Test MCP server" echo " ./setup.sh logs - View server logs" echo " ./setup.sh stop - Stop all services" echo " ./setup.sh restart - Restart MCP server" echo "" echo "📖 Usage Example:" echo " 1. ./setup.sh start" echo " 2. ./setup.sh client" echo "" ;; esac

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