Provides web search capabilities through DuckDuckGo's search engine, automatically routing search queries and returning relevant web results.
Enables chat interactions and AI-powered responses using Google's Gemini 2.0 Flash Exp model through LangChain integration, supporting conversational AI capabilities.
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., "@MCP API Toolswhat's the weather forecast for Tokyo this weekend?"
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.
MCP Server dengan Google AI Studio
Server FastAPI yang menyediakan berbagai tools dan integrasi dengan Google Gemini AI.
Fitur
Auto Tool Router: Routing otomatis ke tool yang tepat berdasarkan prompt
Google Gemini Integration: Integrasi dengan Google AI Studio (Gemini 2.0 Flash Exp) menggunakan LangChain
Multiple Tools:
Weather (Cuaca)
News (Berita)
Web Search (Pencarian Web)
Dictionary (Kamus)
Quotes (Kutipan Bijak)
Persyaratan
Python 3.8+
pip (Python package manager)
Instalasi
Clone atau download repository ini
Install dependencies:
Atau install manual:
PENTING: Konfigurasi API Key Google
a. Dapatkan API key dari Google AI Studio
b. Buat/edit file
.envdi root folder project:GOOGLE_API_KEY=your_actual_api_key_herec. Pastikan API key valid dan aktif (bukan expired atau restricted)
Catatan: Ganti
your_actual_api_key_heredengan API key Anda sendiri
Menjalankan Aplikasi
1. Jalankan FastAPI Server
Buka terminal pertama dan jalankan:
Server akan berjalan di http://localhost:8000
2. Jalankan Streamlit App (Opsional)
Buka terminal kedua dan jalankan:
Aplikasi Streamlit akan terbuka otomatis di browser (http://localhost:8501)
Cara Penggunaan
Menggunakan Streamlit UI (Recommended)
Setelah menjalankan kedua server (FastAPI dan Streamlit), buka browser di http://localhost:8501
Fitur Streamlit App:
Auto Tool Router: Masukkan pertanyaan dan sistem otomatis memilih tool yang tepat
Google Gemini AI: Chat interaktif dengan AI Google Gemini
Manual Tools: Pilih dan gunakan tool secara manual:
Weather Tool: Cek cuaca kota
News Tool: Cari berita berdasarkan topik
Dictionary Tool: Cari definisi kata
Quotes Tool: Dapatkan kutipan bijak
Web Search Tool: Pencarian web
Menggunakan API (curl/Postman)
1. Auto Tool Router (/auto)
Endpoint ini secara otomatis memilih tool yang tepat berdasarkan kata kunci dalam prompt.
Endpoint: POST /auto
Request Body:
Contoh Penggunaan:
Cek Cuaca
Cari Berita
Cari Definisi Kata
Dapatkan Quote
Web Search (Default)
2. Google Gemini LLM (/llm)
Endpoint untuk berkomunikasi langsung dengan Google Gemini AI.
Endpoint: POST /llm
Request Body:
Contoh Penggunaan:
3. Health Check (/)
Cek status server.
Endpoint: GET /
Response:
Dokumentasi API Interaktif
Setelah server berjalan, akses dokumentasi API interaktif di:
Swagger UI:
http://localhost:8000/docsReDoc:
http://localhost:8000/redoc
Struktur Proyek
Kata Kunci Auto Router
Auto router mendeteksi kata kunci berikut:
Kata Kunci | Tool | Contoh |
| Weather Tool | "cuaca di Jakarta" |
| News Tool | "berita teknologi" |
| Dictionary Tool | "definisi python" |
| Quotes Tool | "quote bijak" |
Lainnya | Web Search | "python tutorial" |
Screenshot Streamlit App
Aplikasi Streamlit menyediakan 3 mode:
Auto Tool Router - Routing otomatis berdasarkan kata kunci
Google Gemini AI - Chat interface dengan history
Manual Tools - Pilih tool secara manual dengan UI yang user-friendly
Troubleshooting
Error: Module not found
Pastikan semua dependencies sudah terinstall:
Streamlit tidak bisa connect ke server
Pastikan FastAPI server sudah berjalan di http://localhost:8000 sebelum menjalankan Streamlit
Error: API key not valid / GOOGLE_API_KEY not found
Penyebab umum:
API key tidak ada di file
.envAPI key expired atau tidak valid
API key memiliki restrictions yang tidak sesuai
Solusi:
Pastikan file
.envada di root folder projectDapatkan API key baru dari Google AI Studio
Copy API key dan paste ke file
.env:GOOGLE_API_KEY=AIzaSy...your_actual_keyRestart server FastAPI setelah mengubah
.envPastikan tidak ada spasi atau karakter tambahan di API key
Server tidak bisa diakses
Pastikan server sudah berjalan dengan perintah:
Request loading lama / timeout
Lihat panduan lengkap di
Quick Fix:
Test components:
python test_simple.pyTry server without LLM:
uvicorn server_simple:app --reload --port 8001Check API key dan ganti jika perlu di file
.envGanti model di
providers/google_llm.py:model="models/gemini-1.5-flash" # More stable