AI Voice Assistant MCP Server
Provides a web search tool via DuckDuckGo (no API key required) for searching the web and summarising top results.
Uses Google Gemini API (gemini-2.0-flash) as the AI brain for a voice-enabled assistant, providing context-aware multi-turn conversation and MCP tool calling.
Click on "Deploy 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., "@AI Voice Assistant MCP ServerWhat's the weather in Tokyo and calculate 25 * 4?"
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.
AI Voice Assistant with MCP Tool Calling
A fully free, end-to-end voice-enabled AI assistant built with Python.
Component | Technology |
π§ AI Brain | Google Gemini API ( |
ποΈ Speech-to-Text | Google Web Speech API via |
π Text-to-Speech |
|
π οΈ Tool Calling | Model Context Protocol (MCP) β free |
π Web Search | DuckDuckGo β free, no key needed |
π€οΈ Weather | wttr.in REST API β free, no key needed |
Features
ποΈ Voice Input β speak naturally; the assistant understands you
π Voice Output β responses are read aloud via offline TTS
π€ Gemini AI β context-aware, multi-turn conversation
π οΈ 7 MCP Tools available to the AI:
Calculator β safe math expression evaluator
Web Search β DuckDuckGo (no API key)
Weather β real-time via wttr.in (no API key)
Date/Time β current date and time
Read File β read any local file
Write File β write/append to a local file
List Directory β browse local folders
π¬ Multi-turn memory β remembers conversation context
β¨οΈ Text mode β works without a microphone (
--textflag)
Related MCP server: Gemini MCP Chatbot
Prerequisites
Python 3.11+
A free Gemini API key β get one at https://aistudio.google.com/app/apikey
Internet connection (for speech recognition, Gemini API, and web tools)
Microphone (optional β text mode works without one)
Installation
1. Clone / download the project
# If using git:
git clone <your-repo-url>
cd "AI voice assistant"
# Or just open the folder in your terminal
cd "C:\Users\sasid\Downloads\AI voice assistant"2. Create and activate a virtual environment (recommended)
python -m venv .venv
# Windows:
.venv\Scripts\activate
# macOS / Linux:
source .venv/bin/activate3. Install PyAudio (Windows β required for microphone)
PyAudio on Windows needs a pre-built binary. The easiest way:
pip install pipwin
pipwin install pyaudioOr download the correct .whl from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
and install with:
pip install PyAudioβ0.2.14βcpXXβcpXXβwin_amd64.whl4. Install remaining dependencies
pip install -r requirements.txt5. Set your Gemini API key
Option A β .env file (recommended):
copy .env.example .env
# Then open .env and replace "your_gemini_api_key_here" with your actual keyOption B β edit config.py directly:
Open config.py and change:
GEMINI_API_KEY: str = os.getenv("GEMINI_API_KEY", "YOUR_GEMINI_API_KEY_HERE")to:
GEMINI_API_KEY: str = "your_actual_api_key"Running
Voice mode (default β microphone + TTS)
python main.pyText-only mode (no microphone needed)
python main.py --textList available TTS voices
python main.py --list-voicesExample Interactions
You say | What happens |
"What's the weather in Tokyo?" | Calls |
"Calculate 2 to the power of 32" | Calls |
"Search for the latest Python news" | Calls |
"What day is today?" | Calls |
"Read the file notes.txt" | Calls |
"Write 'Hello World' to test.txt" | Calls |
"Reset conversation" | Clears chat history |
"Goodbye" / "Exit" | Exits the assistant |
Project Structure
AI voice assistant/
βββ main.py # Entry point β CLI, banner, main loop
βββ assistant.py # Gemini + MCP integration (agentic tool-call loop)
βββ speech.py # SpeechRecognition (STT) + pyttsx3 (TTS)
βββ mcp_server.py # MCP tool server with 7 built-in tools
βββ config.py # All settings and API key placeholder
βββ requirements.txt # Python dependencies
βββ .env.example # API key template
βββ README.md # This fileCustomisation
Change the AI's personality
Edit SYSTEM_PROMPT in config.py.
Adjust microphone sensitivity
Edit MIC_ENERGY_THRESHOLD in config.py (lower = more sensitive).
Change TTS voice or speed
Edit TTS_RATE and TTS_VOICE_PREFERENCE in config.py.
Run python main.py --list-voices to see available voice names.
Add more MCP tools
Open mcp_server.py, add a new function, then register it in list_tools() and call_tool().
Gemini Free Tier Limits
Limit | Value |
Requests per minute | 15 |
Tokens per day | 1,000,000 |
Cost | $0 |
Get your key at: https://aistudio.google.com/app/apikey
Troubleshooting
"No module named 'pyaudio'" β See PyAudio installation step above.
"Could not understand audio"
β Speak clearly; adjust MIC_ENERGY_THRESHOLD lower in config.py.
"Speech recognition service error" β Check your internet connection (Google Web Speech API requires internet).
Gemini 429 / rate limit error β You've hit the free tier limit. Wait a minute and try again.
Assistant doesn't speak / TTS silent
β Check system audio / volume. Try python main.py --list-voices to verify pyttsx3 works.
License
MIT β free to use, modify, and distribute.
This server cannot be deployed
Maintenance
Related MCP Connectors
Carbon Voice MCP serves as a bridge that connects AI assistants like ChatGPT, Claude, and Cursor to a user's Carbon Voice account, turning voice messages and conversations into a private, on-demand knowledge base. It provides 28 specialized tools for comprehensive voice messaging management, including creating and sending messages, accessing conversation history with instant transcription, running AI actions (summarization, TLDR generation, meeting notes), and managing workspace collaboration through folders, contacts, and team communications.
Set up and run an in-product AI assistant from your AI client: create and tune assistants, connect knowledge sources, host an MCP server on an existing API, and read usage. Every tool is annotated read-only or destructive, so writes ask before they act.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceConnects local LLMs to external tools (calculator, knowledge base) via MCP protocol, enabling automatic tool detection and execution to enhance query responses.MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server exposing calculator, file read, and file write tools for the Gemini CLI agent, enabling mathematical computations and file operations through natural language.-
- FlicenseNot gradedqualityDmaintenanceEnables AI agents and users to manage workspace files, monitor system metrics, take persistent notes, and retrieve weather data via MCP tools and resources.-
- AlicenseNot gradedqualityBmaintenanceEnables voice-first interactions with AI agents and MCP tools, supporting speech input/output, STT/TTS, and a provider-independent agent core.1MIT