This project primarily combines the Langchain framework, Chainlit user interface, and the Model Context Protocol (MCP) to build an AI application capable of utilizing external tools.
- Core Components:
- A client application (
app.py) based on Chainlit and Langchain Agent. - Three independently running MCP Tool Servers (
MCP_Servers/):- Weather Query (
weather_server.py) - Database Query (
sql_query_server.py) - PowerPoint Translation (
ppt_translator_server.py)
- Weather Query (
- Startup and Management Scripts (
run.py,run_server.py,run_client.py) to simplify the launch process.
- A client application (
- Communication Protocol: Uses MCP (Model Context Protocol) as the standardized communication method between the client and tool servers (via SSE transport).
- Goal: To provide a foundational platform for understanding and experimenting with the MCP Client-Server architecture, Langchain Agent and Tool interaction, and Chainlit UI integration.
- Python Version: Ensure you have Python 3.10 or higher installed.
- Install Dependencies: Open a terminal in the project root directory and run the following command to install all necessary Python packages:
pip install -r requirements.txt
- Set Environment Variables (Important):
- Find the
.env_examplefile in the project root directory. - Copy it and rename the copy to
.env. - Edit the
.envfile and fill in your own API keys and database settings:OPENAI_API_KEY: Your OpenAI API key (used for PPT translation).OPENWEATHER_API_KEY: Your OpenWeatherMap API key (used for weather query).CLEARDB_DATABASE_URL: Your MySQL database connection URL, format:mysql://user:password@host:port/dbname(used for database query).USER_AGENT: (Optional, might be needed by OpenWeather) Set a User-Agent string.
- Find the
Using the Launcher