MCP-Server-Python
Enables the MCP server to use Google Gemini models for generating context-aware conversational responses, with support for streaming and multi-modal processing.
Enables the MCP server to use OpenAI's language models (e.g., GPT-4o-mini) for generating context-aware conversational responses, with support for streaming and multi-modal processing.
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-PythonResearch and summarize top AI news this week"
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 (Model Context Protocol) Server: Intelligent Conversational Platform
Overview
MCP (Model Context Protocol) is a sophisticated AI-powered server designed to provide intelligent, context-aware conversational capabilities. This standalone server leverages multiple LLM providers (OpenAI, Anthropic, and Google Gemini), FastAPI, and Pyppeteer for web browsing capabilities to deliver nuanced, contextually relevant responses across various business domains.
Note: This repository contains only the MCP server implementation. While frontend examples are provided in the documentation for illustrative purposes, the actual frontend implementation is not included in this repository. The MCP server is designed to be integrated with any frontend through its RESTful API.
Key Features
🤖 Role-based AI advisor system with customizable instructions and tones
🧠 Semantic memory management with vector similarity search
🌊 Real-time streaming responses for improved user experience
🌐 Integrated web browsing capabilities for AI-assisted research
🔄 Dynamic context switching based on conversation triggers
📝 Enhanced markdown formatting for professional-looking content
🖼️ Multi-modal context support for processing images and other media
🔍 Advanced role search and filtering by keywords, domains, and tone
🔗 Advanced memory features with tagging, sharing, and inheritance
🔄 Multiple LLM provider support (OpenAI, Anthropic, Google Gemini)
Technology Stack
Backend: Python with asyncio
Web Framework: FastAPI
AI Models:
OpenAI GPT-4o-mini
Anthropic Claude models
Google Gemini models
Browser Automation: Pyppeteer (Python port of Puppeteer)
API Documentation: Swagger UI via FastAPI
Setup and Installation
Prerequisites
Python 3.11+
OpenAI API key
Git (for cloning the repository)
Installation Steps
Clone the repository
Create a virtual environment:
python -m venv venvActivate the virtual environment:
Windows:
venv\Scripts\activatemacOS/Linux:
source venv/bin/activate
Install dependencies:
pip install -r requirements.txtConfigure environment variables (see below)
Run the server:
python -m app.mainAccess the API documentation at
http://localhost:8000/docs
Configuration
Create a .env file based on .env.example with the following variables:
# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-4o-mini
OPENAI_VISION_MODEL=gpt-4o
# Anthropic Configuration (Optional)
ANTHROPIC_API_KEY=your_anthropic_api_key
ANTHROPIC_MODEL=claude-3-haiku-20240307
# Google Gemini Configuration (Optional)
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-1.5-pro
# Default Provider Configuration
DEFAULT_PROVIDER=openai # Options: openai, anthropic, gemini
EMBEDDING_MODEL=text-embedding-ada-002
# Server Settings
PORT=8000
DEBUG=FalseRecent Improvements
Contextual Analysis for Specialized Domains
Implemented domain-specific analysis capabilities for various business areas
Created specialized analysis templates for finance, marketing, operations, sales, and more
Added automatic extraction of domain-specific terminology and patterns
Integrated domain-specific metrics and frameworks into AI responses
Enhanced system prompts with domain-specific guidance
Created API endpoints for domain analysis and template management
Improved relevance and specificity of AI responses for specialized domains
Advanced Memory Features
Implemented memory tagging and categorization system for better organization
Created hierarchical memory access control with role-based permissions
Designed role-based memory inheritance mechanism for knowledge sharing
Added configurable memory sharing permissions between roles
Developed semantic search for cross-role memory retrieval
Implemented memory embedding and similarity scoring for relevance ranking
Added API endpoints for memory sharing and inheritance management
Created comprehensive documentation for advanced memory features
Role Search and Filtering
Implemented advanced search capabilities for finding roles by keywords
Added domain-based filtering to find roles with specific expertise
Created tone-based filtering for communication style preferences
Added API endpoints for role search with combined filtering options
Implemented domain discovery endpoint to retrieve all unique domains
Created comprehensive test suite for search and filtering functionality
Multi-Modal Context Support
Added support for processing images alongside text queries
Implemented dedicated multi-modal processing service
Created API endpoints for multi-modal content processing
Added file upload capabilities for media content
Integrated with vision-capable models across providers
Added streaming support for multi-modal responses
Multiple LLM Provider Support
Implemented support for multiple LLM providers (OpenAI, Anthropic, Google Gemini)
Created a modular provider architecture with a common interface
Added provider-specific optimizations for each LLM service
Implemented provider selection for all API endpoints
Test Script Improvements
Updated all test scripts to use the API prefix consistently across endpoints
Enhanced test structure with proper skipping of unimplemented endpoints
Improved test reliability by using consistent client fixtures
Added comprehensive test coverage for role management, domain analysis, and memory features
Implemented proper mocking for various services to isolate tests
Fixed import errors and KeyError issues in test files
Created dedicated provider routes for direct provider access
Added fallback mechanisms for multi-modal content when primary provider lacks capabilities
Implemented provider discovery endpoint to list available providers
Updated configuration to support provider-specific settings
Enhanced Formatting
Added explicit formatting instructions to all prompts
Standardized markdown formatting across different content types
Improved client-side rendering of formatted content
Enhanced CSS styling for better readability
Streaming Functionality
Implemented real-time streaming of AI responses
Added visual indicators for streaming state
Fixed string literal issues in SSE handling
Improved UI to show different loading states
Comprehensive Test Suite
Created feature-specific test scripts for all major components
Implemented tests for context switching functionality
Added tests for memory features including tagging and retrieval
Created tests for web browsing capabilities with mocked responses
Implemented tests for multiple LLM provider integration
Added tests for domain analysis capabilities
Created tests for role editing and management features
Implemented tests for role search and filtering
Added tests for multimodal content processing
Created comprehensive test documentation with usage instructions
Development
Use
requirements.txtfor server dependency managementUpdate
todo.txtwith new features and improvements after each iterationUpdate README.md after each new feature implementation
Documentation
Detailed documentation is available in the docs directory:
ROUTES.md: API endpoints and their functionalityMODELS.md: Data structures and schemasARCHITECTURE.md: System design and component interactionsSERVICES.md: Core business logic implementationSERVER_CAPABILITIES.md: Features and capabilitiesmultimodal_context_support.md: Multi-modal processing capabilitiesrole_search_filtering.md: Role search and filtering functionalityrole_editing.md: Role management and editing featuresCONTEXT_SWITCHING.md: Dynamic context switching between rolesadvanced_memory_features.md: Advanced memory features including tagging, sharing, and inheritance
Contributing
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
License
[Specify License]
Contact
[Your Contact Information]
This server cannot be installed
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
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/Chris-June/MCP-Server-Python'
If you have feedback or need assistance with the MCP directory API, please join our Discord server