A fast and simple Model Context Protocol server with FastAPI and Gradio frontend enabling AI model chat interactions via Google Gemini API, designed for seamless integration and easy setup.
Unlock the full potential of Basic MCP Application through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.
Free tier available • No credit card required
A simple app that shows how Model Context Protocol (MCP) works with FastAPI and Gradio (because i am not a dev who enjoys Streamlit headaches).
This project demonstrates a basic MCP server with a Gradio frontend (Streamlit was a headache, and life's too short for unnecessary pain). Users can chat with AI models through what marketing people would call a "simple interface" and what developers know as "the best I could do before I moveon 🥲 ."
⚠️ Please Note
This project works great with uv
, a super fast Python package installer! Instead of waiting for pip to finish sometime next century, you can use uv
to install dependencies in seconds. I highly recommend this for a smoother experience (and to reclaim hours of your life staring at progress bars).
uv
)Clone this project:
git clone https://github.com/yourusername/basic-mcp-app.git cd basic-mcp-app
Create a virtual environment (because global dependencies are the path to emotional damage):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
Install required packages:
Using pip (the tortoise way):
pip install -r requirements.txt
Using uv (the hare way that actually wins the race):
# Install uv first if you don't have it curl -LsSf https://astral.sh/uv/install.sh | sh
or
pip install uv
Then install dependencies with uv:
uv pip install -r requirements.txt
Using uv
makes Python package installation go brrrr! It's much faster than regular pip (motherpromise🤞). In the time it takes pip to realize what you've asked it to do, uv has already finished, made coffee, and started writing your next app for you.
Set up your API keys (the things you should never commit to GitHub but someone always does anyway):
cp .env.example .env # Open .env and add your API keys
Run both servers with one command (like magic, but with more semicolons):
python run.py
This starts both the backend and frontend at once. It's like having your cake and eating it too, but with fewer calories.
You can also start them separately if needed (for the control freaks among us):
uvicorn backend.main:app --reload
python frontend/app.py
Open your web browser and go to http://localhost:8501 (if this doesn't work, try turning it off and on again 😑)
Look at this beautiful directory structure that will never stay this clean once development really starts:
basic-mcp-app/
├── .env.example # Template for your API keys(Please don't make your api keys public🙏)
├── .gitignore # Files to ignore in git (like the emotional baggage)
├── README.md # This help file that nobody reads until desperate
├── requirements.txt # Required packages (aka dependency hell)
├── run.py # Script to start both servers
├── backend/
│ └── main.py # Backend server code with MCP (where the real magic happens)
└── frontend/
└── app.py # Gradio frontend interface (pretty buttons go here)
MIT (Because I'm nice and don't want to read long licenses either)
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!