Skip to main content
Glama

FastAPI MCP Server

by arrehman3
setup.sh•1.73 kB
#!/bin/bash # Startup script for FastAPI + MCP Server integration echo "šŸš€ Starting FastAPI + MCP Server Integration" # Check if Python is installed if ! command -v python3 &> /dev/null; then echo "āŒ Python3 is not installed. Please install Python 3.8+ first." exit 1 fi # Check if pip is installed if ! command -v pip3 &> /dev/null; then echo "āŒ pip3 is not installed. Please install pip first." exit 1 fi # Create virtual environment if it doesn't exist if [ ! -d "venv" ]; then echo "šŸ“¦ Creating virtual environment..." python3 -m venv venv fi # Activate virtual environment and install dependencies echo "šŸ“¦ Installing Python dependencies..." source venv/bin/activate pip install -r requirements.txt # Check if Node.js is installed (for Gemini CLI) if ! command -v node &> /dev/null; then echo "āš ļø Node.js is not installed. Installing Gemini CLI will require Node.js." echo " Please install Node.js from https://nodejs.org/" fi # Check if npm is installed if ! command -v npm &> /dev/null; then echo "āš ļø npm is not installed. Installing Gemini CLI will require npm." echo " Please install Node.js from https://nodejs.org/" fi echo "āœ… Setup complete!" echo "" echo "šŸ“‹ Next steps:" echo "1. Activate virtual environment: source venv/bin/activate" echo "2. Start the FastAPI app: python sample_app.py" echo "3. In another terminal, activate venv and start MCP server: source venv/bin/activate && python mcp_server.py" echo "4. Install Gemini CLI: npm install -g @google/gemini-cli@latest" echo "5. Add MCP server to Gemini CLI: gemini mcp add fastapi-sample stdio python $(pwd)/mcp_server.py" echo "6. Test with: gemini call fastapi-sample get_app_info"

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/arrehman3/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server