mcp-server-ai-bot
Provides AI-powered chat and summarization capabilities using Google Gemini 1.5 Flash for customer service assistance.
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-server-ai-botWhat is the balance on account ABC123?"
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 Assistant Platform
A Model Context Protocol (MCP) server integrated with Google Gemini LLM for intelligent customer service assistance. This platform provides natural language chat capabilities and AI-powered customer data analysis and summarization.
๐ Features
๐ง MCP Tool Integration: Standardized tool interface following Model Context Protocol
๐ค AI-Powered Chat: Natural language interaction using Google Gemini 1.5 Flash
๐ Smart Analytics: AI-generated customer insights and summaries
๐ Secure API: Bearer token authentication for external API calls
๐ Professional Web Interface: Modern UI for customer service operations
๐ Auto-Generated Docs: FastAPI automatic API documentation
Related MCP server: MCP Agentic AI Server
๐ Project Structure
ai-assistant-platform/
โโโ app/
โ โโโ __init__.py
โ โโโ main.py # FastAPI application entry point
โ โโโ server.py # MCP server setup
โ โโโ llm_agent.py # Gemini LLM integration
โ โโโ core/
โ โ โโโ __init__.py
โ โ โโโ config.py # Configuration management
โ โโโ tools/
โ โ โโโ __init__.py
โ โ โโโ user_tools.py # MCP tools implementation
โ โโโ static/
โ โโโ index.html # Web interface
โโโ .env # Environment variables (not in git)
โโโ .env.example # Environment template
โโโ .gitignore # Git ignore rules
โโโ requirements.txt # Python dependencies
โโโ LICENSE # MIT License
โโโ README.md # This file๐ Quick Start
Prerequisites
Python 3.10 or higher
pip package manager
Google Gemini API key (Get one here)
External API credentials (for customer data integration)
Installation
Clone the repository
git clone https://github.com/yourusername/ai-assistant-platform.git cd ai-assistant-platformCreate and activate virtual environment
Windows:
python -m venv venv venv\Scripts\activateLinux/Mac:
python -m venv venv source venv/bin/activateInstall dependencies
pip install -r requirements.txtConfigure environment variables
# Copy the example file cp .env.example .env # Edit .env with your actual credentials # On Windows: notepad .env # On Linux/Mac: nano .envRequired environment variables:
API_KEY=your_api_key_here API_URL=https://your-api-url.com GEMINI_API_KEY=your_gemini_api_key_hereRun the server
# Using uvicorn directly uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload # OR using Python module python -m app.mainAccess the application
๐ Home/Health Check: http://localhost:8000/
๐ API Documentation: http://localhost:8000/docs
๐ Web Interface: http://localhost:8000/ui
๐ง List Tools: http://localhost:8000/tools
๐ API Endpoints
Core Endpoints
Method | Endpoint | Description |
GET |
| Health check |
GET |
| Web interface |
GET |
| List available MCP tools |
GET |
| View current configuration |
GET |
| Interactive API documentation |
MCP Tool Endpoints
Method | Endpoint | Description |
POST |
| Test MCP tool with file number |
Request Body:
{
"file_number": "ABC123"
}LLM Endpoints
Chat with LLM
POST /llm/chat
Natural language chat with optional customer context.
Request Body:
{
"message": "What's my current balance?",
"file_number": "ABC123" // Optional
}Response:
{
"success": true,
"response": "Based on your account, your current balance is $1,500.00..."
}AI Summary
POST /llm/summarize
Generate AI-powered summary of customer account.
Request Body:
{
"file_number": "ABC123"
}Response:
{
"success": true,
"summary": "Account Summary for John Doe:\n\nCurrent Balance: $1,500.00..."
}๐ง Configuration
All configuration is managed through environment variables in the .env file:
# API Configuration
API_KEY=your_api_key_here
API_URL=https://api.example.com
API_TIMEOUT=30
# LLM Configuration
GEMINI_API_KEY=your_gemini_key_here
# Server Configuration
SERVER_HOST=0.0.0.0
SERVER_PORT=8000
DEBUG=false
# MCP Configuration
MCP_SERVER_NAME=company-mcp-server
MCP_SERVER_VERSION=1.0.0๐๏ธ Architecture
Data Flow
User Request โ FastAPI โ LLM Agent โ MCP Tools โ External API
โ
Gemini AI Processing
โ
AI-Enhanced ResponseComponents
FastAPI Server (
main.py): Handles HTTP requests and routingLLM Agent (
llm_agent.py): Manages Gemini AI interactionsMCP Server (
server.py): Implements Model Context ProtocolUser Tools (
user_tools.py): External API integrationConfiguration (
config.py): Environment management
๐ก Usage Examples
Example 1: Get Customer Details
import requests
response = requests.post(
"http://localhost:8000/test/get_user_details",
json={"file_number": "CUST123"}
)
print(response.json())Example 2: Chat with Context
import requests
response = requests.post(
"http://localhost:8000/llm/chat",
json={
"message": "What payment options are available?",
"file_number": "CUST123"
}
)
print(response.json()["response"])Example 3: Get AI Summary
import requests
response = requests.post(
"http://localhost:8000/llm/summarize",
json={"file_number": "CUST123"}
)
print(response.json()["summary"])๐ MCP Client Integration
To use this server with an MCP client (like Claude Desktop):
{
"mcpServers": {
"company-mcp-server": {
"command": "python",
"args": [
"/path/to/mcp-llm-server/app/main.py"
],
"env": {
"API_KEY": "your_api_key_here",
"GEMINI_API_KEY": "your_gemini_key_here",
"API_URL": "https://api.example.com"
}
}
}
}๐งช Testing
Using the Web Interface
Enter a file number (default: 14226904)
Test different features:
MCP Tool Testing
LLM Chat
AI Summary
Using curl
# Test health check
curl http://localhost:8000/
# Test MCP tool
curl -X POST http://localhost:8000/test/get_user_details \
-H "Content-Type: application/json" \
-d '{"file_number": "14226904"}'
# Test LLM chat
curl -X POST http://localhost:8000/llm/chat \
-H "Content-Type: application/json" \
-d '{"message": "What is the current balance?", "file_number": "14226904"}'๐ ๏ธ Development
Adding New MCP Tools
Define the tool in
app/tools/user_tools.py:async def new_tool(self, param: str) -> Dict[str, Any]: """Your tool implementation""" passRegister in
app/server.py:@mcp_server.list_tools() async def list_tools() -> list[Tool]: return [ Tool(name="new_tool", description="...", inputSchema={...}) ]Add handler in
app/server.py:@mcp_server.call_tool() async def call_tool(name: str, arguments: dict): if name == "new_tool": result = await user_tools.new_tool(arguments["param"])
Running in Development Mode
# Enable debug mode in .env
DEBUG=true
# Run with auto-reload
uvicorn app.main:app --reload --log-level debug๐ฆ Dependencies
FastAPI: Modern web framework for building APIs
uvicorn: ASGI server for FastAPI
google-generativeai: Google Gemini AI SDK
httpx: Async HTTP client for external APIs
python-dotenv: Environment variable management
mcp: Model Context Protocol SDK
See requirements.txt for complete list with versions.
๐ Security Best Practices
Never commit
.envfile - Already in.gitignoreUse environment variables for all secrets
Rotate API keys regularly
Use HTTPS in production
Implement rate limiting for production use
Validate all inputs before processing
Log security events for monitoring
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ค Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Fork the repository
Create your feature branch (
git checkout -b feature/AmazingFeature)Commit your changes (
git commit -m 'Add some AmazingFeature')Push to the branch (
git push origin feature/AmazingFeature)Open a Pull Request
๐ Troubleshooting
Common Issues
Problem: Could not import module "main"
Solution: Use
uvicorn app.main:appinstead ofuvicorn main:app
Problem: Server not accessible at http://0.0.0.0:8000
Solution: Use
http://localhost:8000orhttp://127.0.0.1:8000in browser
Problem: API_KEY must be set in environment variables
Solution: Create
.envfile from.env.exampleand fill in your keys
Problem: Gemini API errors
Solution: Verify your
GEMINI_API_KEYis valid and has sufficient quota
๐ Support
For issues, questions, or contributions:
๐ Report bugs via GitHub Issues
๐ฌ Discussions via GitHub Discussions
๐ง Email: your.email@example.com
๐ Acknowledgments
FastAPI for the excellent web framework
Google Gemini for LLM capabilities
Model Context Protocol for standardized tool interfaces
Made with โค๏ธ for intelligent debt collection assistance
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/AbdurXCode/mcp-server-ai-bot'
If you have feedback or need assistance with the MCP directory API, please join our Discord server