This is an AI-powered application that leverages the Model Context Protocol (MCP) to connect a Large Language Model (LLM) with various local and remote tools. It features a modern Streamlit user interface that acts as a central hub for chatting with an agent capable of tracking expenses, checking weather, and interacting with social media.
This project demonstrates a complete multi-server MCP architecture with three main components working together:
The application includes three MCP servers that expose tools to the LLM:
- Location:
DatabaseServer/ - Technology: FastMCP + FastAPI + SQLite
- MCP Tools Exposed:
add_expense- Add new expenses with automatic categorizationlist_expenses- Retrieve expense history with filteringsummarize_expenses- Get expense analytics and summaries
- FastAPI Endpoints:
POST /expenses- Create expenseGET /expenses- List all expensesGET /expenses/summary- Get expense summary
- How it works: The MCP server wraps FastAPI endpoints and exposes them as callable tools for the LLM
- Location:
WeatherServer/ - Technology: FastMCP + FastAPI + Open-Meteo API
- MCP Tools Exposed:
get_forecast- Get weather forecast for any location
- FastAPI Endpoints:
GET /forecast- Fetch weather data
- How it works: Integrates with Open-Meteo API to provide real-time weather information via MCP
- Location: External NPM package (
@enescinar/twitter-mcp) - Technology: Node.js MCP Server
- MCP Tools Exposed:
post_tweet- Post tweetssearch_tweets- Search Twitterget_user_timeline- Fetch user tweets
Each server also provides direct HTTP access for testing and debugging:
Database Server (`http://
- Location:
Client/main.py - Technology: Streamlit + LangChain + langchain-mcp-adapters
- Functionality:
- Connects to all MCP servers using
MultiServerMCPClient - Orchestrates LLM interactions via LangChain + Groq
- Provides conversational UI for natural language requests
- Automatic tool calling - LLM decides which MCP tools to use
- Connects to all MCP servers using
How the Client Works:
User Input β Streamlit UI β LangChain Agent β Groq LLM β MCP Tools β Response
The client:
- Initializes connections to all MCP servers on startup
- Converts MCP tools to LangChain-compatible format
- Sends user queries to the Groq LLM
- LLM analyzes the query and calls appropriate MCP tools
- Results are displayed in the chat interface
Example Interactions:
- "Add 500 rupees for lunch today" β Calls
add_expensetool - "What's the weather in Paris?" β Calls
get_forecasttool - "Show my expenses from last week" β Calls
list_expensestool - "Post a tweet saying hello" β Calls
post_tweettool
The project follows a multi-server MCP architecture:
- Client (
/Client): A Streamlit frontend that connects to multiple MCP servers. It uses LangChain to orchestrate interactions between the user, the LLM (Groq), and the available tools. - Database Server (
/DatabaseServer): A local FastAPI + SQLite server that provides expense tracking capabilities (Add, List, Summarize). - Weather Server (
/WeatherServer): A FastAPI server that fetches real-time weather data from open-meteo APIs. - Twitter MCP: An external MCP server (via
npx) for Twitter interactions.
- Frontend: Streamlit (with custom CSS for a fixed-layout Dashboard)
- AI/LLM orchestration:
- LangChain
langchain-mcp-adapterslangchain-groq
- Backend / Servers:
- FastMCP
uvandpipfor dependency management
- Database: SQLite (for Expense Tracker)
- External APIs: Open-Meteo (Weather), Twitter API.
Inxtinct_MCP/
βββ Client/
β βββ main.py # Main Streamlit application & MCP Client
β βββ test.py # Testing utilities
β βββ .env # Environment variables (create this)
βββ DatabaseServer/
β βββ server.py # FastAPI server for Expenses
β βββ main.py # MCP Entrypoint
β βββ categories.json # Expense categories configuration
β βββ expenses.db # SQLite Database (auto-generated)
βββ WeatherServer/
β βββ server.py # FastAPI server for Weather
β βββ main.py # MCP Entrypoint
βββ pyproject.toml # Project metadata & dependencies
βββ requirements.txt # Python dependencies
βββ README.md # This file
Before you begin, ensure you have the following installed:
- Python 3.13+ - Download Python
- uv (Package manager) - Install via:
# Windows (PowerShell) powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # macOS/Linux curl -LsSf https://astral.sh/uv/install.sh | sh
- Node.js 18+ and npx - Download Node.js (npx comes bundled)
- Git - Download Git
git clone https://github.com/Devgambo/Inxtinct_MCP.git
cd Inxtinct_MCPInstall all required Python packages using uv:
uv syncAlternatively, if you prefer using pip:
pip install -r requirements.txtCreate a .env file in the Client/ directory with your API keys:
cd Client
# Create .env file (Windows)
New-Item .env -ItemType File
# Create .env file (macOS/Linux)
touch .envAdd the following configuration to your .env file:
# Groq API Configuration (Required)
GROQ_API_KEY=your_groq_api_key_here
# Twitter API Configuration (Optional - only if using Twitter features)
API_KEY=your_twitter_api_key
API_SECRET_KEY=your_twitter_api_secret_key
ACCESS_TOKEN=your_twitter_access_token
ACCESS_TOKEN_SECRET=your_twitter_access_token_secretHow to get API Keys:
- Groq API Key: Sign up at console.groq.com
- Twitter API Keys: Create a developer account at developer.twitter.com
After cloning, you MUST update the absolute file paths in Client/main.py to match your local setup.
Open Client/main.py and locate the SERVERS configuration (around lines 14-53). Update the paths in the args sections:
Before (Example paths):
"ExpenseTracker": {
"args": [
"run",
"--with",
"fastmcp",
"fastmcp",
"run",
"C:\\Users\\priya\\OneDrive\\Desktop\\Inxtinct\\DatabaseServer\\main.py", # β Change this
]
},
"weather-server": {
"args": [
"run",
"--with",
"fastmcp",
"--with",
"httpx",
"fastmcp",
"run",
"C:\\Users\\priya\\OneDrive\\Desktop\\Inxtinct\\WeatherServer\\main.py" # β Change this
]
}After (Your actual paths):
# Replace with your actual project path
# Windows example: C:\\Users\\YourUsername\\path\\to\\Inxtinct_MCP\\DatabaseServer\\main.py
# macOS/Linux example: /home/yourusername/path/to/Inxtinct_MCP/DatabaseServer/main.py
"ExpenseTracker": {
"args": [
"run",
"--with",
"fastmcp",
"fastmcp",
"run",
"YOUR_ABSOLUTE_PATH/DatabaseServer/main.py", # Update this path
]
},
"weather-server": {
"args": [
"run",
"--with",
"fastmcp",
"--with",
"httpx",
"fastmcp",
"run",
"YOUR_ABSOLUTE_PATH/WeatherServer/main.py" # Update this path
]
}π‘ Tip: To get your current directory path:
- Windows PowerShell: Run
Get-Locationorpwd - macOS/Linux: Run
pwd
Once setup is complete, navigate to the Client directory and start the app:
# From the project root
cd Client
# Run the Streamlit application
uv run streamlit run main.py
# Alternative (if using pip)
streamlit run main.pyThe application will open in your default browser at http://localhost:8501
Note: The Database and Weather MCP servers are automatically started as subprocesses by the client. You don't need to run them separately.
- Natural Language Expense Tracking: "Add 500 for lunch" -> Automatically categorized and saved to DB.
- Live Weather Updates: "What's the weather in London?" -> Fetches live data.
- Twitter Integration: Post and search tweets directly from the chat.
- Persistent Chat History: Maintains context during the session.
- Modern UI: Dark-themed, fixed-layout interface with dedicated Tools sidebar.
Problem: Missing Python dependencies
Solution:
# Reinstall dependencies
uv sync
# Or with pip
pip install -r requirements.txtProblem: Environment variables not loaded
Solution:
- Verify
.envfile exists inClient/directory - Check that
GROQ_API_KEYis correctly set in.env - Restart the Streamlit application
Problem: Incorrect server paths in SERVERS configuration
Solution:
- Double-check the absolute paths in
Client/main.pymatch your system - Ensure paths use correct separators (
\\for Windows,/for macOS/Linux) - Verify
DatabaseServer/main.pyandWeatherServer/main.pyexist
Problem: Missing or invalid Twitter API credentials
Solution:
- Twitter features are optional - the app will work without them
- If needed, add all four Twitter API keys to your
.envfile - Verify credentials at developer.twitter.com
Problem: Streamlit default port (8501) is occupied
Solution:
# Specify a different port
uv run streamlit run main.py --server.port 8502Problem: uv is not installed or not in PATH
Solution:
# Reinstall uv (Windows PowerShell)
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Restart your terminal after installationIf you encounter issues not listed here:
- Check the terminal output for specific error messages
- Verify all prerequisites are installed correctly
- Ensure you're using Python 3.13 or higher:
python --version - Open an issue on GitHub
- the compromised twitter api keys have been taken care of.