NitishRaman/mcp_server
3.2
If you are the rightful owner of mcp_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
MCP Server is a modular Python-based platform designed to ingest, describe, query, and visualize structured datasets using LLMs, vector databases, and an intuitive Streamlit UI.
๐ MCP Server
A modular Python-based platform to ingest, describe, query, and visualize structured datasets using LLMs, vector databases, and an intuitive Streamlit UI.
๐ Overview & Use Case
MCP Server is ideal for:
- ๐ Data analysts exploring unknown datasets
- ๐ง LLM-based schema summarization
- ๐งพ Prompt-to-SQL generation with conversational context
- ๐ Teams working with Supabase or local data pipelines
๐ง Key Features
- ๐ฅ Upload & parse CSV, Excel, ZIP, JSON, XML, and SQLite
- ๐ง Generate column descriptions, PK/FK inference, and tags via LLM
- ๐ Vectorize schemas with
sentence-transformers
and ChromaDB - ๐งพ Translate prompts to SQL (with logs)
- ๐ฌ Multi-turn chat with LLM to explore database
- ๐ Build visual charts from structured data
- ๐ข๏ธ Push SQLite tables to Supabase
- ๐ Streamlit UI + FastAPI API backend
๐๏ธ Project Structure
๐ mcp_server_project/
โโโ ๐ app/ # Core modules
โ โโโ core/ # Constants and config
โ โโโ chromadb_prompt_utils.py
โ โโโ chart_generator.py
โ โโโ data_ingestor.py
โ โโโ data_ingestor_server.py
โ โโโ llm_client.py
โ โโโ natural_sql_query.py
โ โโโ schema_describer.py
โ โโโ schema_diagram.py
โ โโโ schema_vectorizer.py
โ โโโ supabase_utils.py
โ
โโโ ๐ mcp_server/
โ โโโ files/ # Generated files per dataset
โ โโโ chroma/ # Vector DB store
โ
โโโ ๐ sample_datasets/ # Sample datasets to test flow
โโโ ๐ pages/ # Streamlit UI pages (modular)
โ โโโ 1 Upload & Preview.py
โ โโโ 2 Description & Schema Generator.py
โ โโโ 3 Prompt to SQL.py
โ โโโ 4 Chart Generator.py
โ โโโ 5 Supabase.py
โ โโโ 6 Interactive Prompt Chat.py
โ
โโโ Home.py # Landing page
โโโ app_server.py # FastAPI backend
โโโ requirements.txt
โโโ run.bat # One-click launcher
โโโ mcp-documentation.pdf # Full documentation
โโโ mcp-presentation.pdf # Project presentation deck
โโโ README.md # This file
โ๏ธ Setup
โ One-click (Windows)
run.bat
This will:
- Create
.venv
- Install dependencies
- Launch ChromaDB, pull Ollama, start backend + UI
๐ง Manual (Linux/macOS)
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app_server:app --reload
๐ Streamlit Modules
1. Upload & Preview
save_and_ingest_file()
- Helpers:
read_csv_from_bytes()
,read_zip()
, etc.
2. Description & Schema
describe_database()
- Helpers:
llm_infer_keys_from_description()
,vectorize_database()
3. Prompt to SQL
generate_sql_from_prompt()
- Helpers:
run_query_on_db()
,log_successful_query()
4. Chart Generator
plot_chart(df, chart_type, x_col, y_col)
5. Supabase
handle_supabase_connection()
- Helpers:
fetch_supabase_tables()
,fetch_table_sample()
6. Interactive Prompt Chat
generate_sql_from_prompt()
- Helpers:
generate_sql_strict()
,log_query()
๐พ Output Directory (per dataset)
๐ files/my_dataset/
โโโ my_dataset.db # SQLite version
โโโ *.csv / *.json / *.xml # Original input
โโโ my_dataset_description.txt # LLM-generated schema summary
โโโ my_dataset_metadata.json # PK, FK, tags, etc.
โโโ query_log.txt # Prompt-to-SQL history
โโโ interactive_query_log.txt # Chat history
โโโ my_dataset_supabase.png # ER Diagram (optional)
๐ Vector Embedding (ChromaDB)
Uses sentence-transformers
to embed column names, types, and summaries. Stored per dataset under collection schema_<dataset>
.
โ Enables context-aware SQL, semantic search, and chat memory.
๐งช Run & Test
streamlit run Home.py # Run full UI
uvicorn app_server:app --reload # Backend API only
๐ฆ Key Dependencies (requirements.txt
)
๐น Core
pandas
,numpy
,openpyxl
,sqlparse
,pyyaml
,xmlschema
,jsonschema
,tqdm
,jinja2
,chardet
๐น Visualization
matplotlib
,graphviz
,eralchemy
๐น UI & Backend
streamlit>=1.30
,fastapi
,uvicorn
,ipywidgets
,ipython
,notebook
๐น LLM + Vector DB
openai
,ollama
,gpt4all
,chromadb>=0.5.0
,sentence-transformers
,torch
,scikit-learn
๐น SQL / DB
sqlite-utils
,psycopg2-binary
๐น Utilities
typing-extensions
โ Troubleshooting
Issue | Solution |
---|---|
Port 8000 in use | Kill existing app or change port |
Ollama pull fails | Make sure Ollama CLI is installed |
ChromaDB won't start | Activate venv + ensure port open |
No module named xyz | Run pip install -r requirements.txt |
๐ ๏ธ Extending the Project
- Add new file readers in
data_ingestor.py
- Swap models in
llm_client.py
- Customize outputs (descriptions, diagrams, SQL prompts)
๐ Documentation
- ๐ Full Guide โ
mcp-documentation.pdf
- ๐ Pitch Deck โ
mcp-presentation.pdf