acme-knowledge
Provides read-only Text-to-SQL access to the local SQLite sales database, including schema inspection, validated SELECT queries, KPI calculations, semantic row lookup, EDA/charting/trend analysis, and CSV/XLSX export.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Unified Local MCP Server (acme-knowledge)
A local Model Context Protocol (MCP) server over stdio combining Document RAG (ChromaDB + local all-MiniLM-L6-v2 embeddings), read-only Text-to-SQL (SQLite), and fixed-function analytics, charting, EDA, and data export—with zero server-side LLM API keys required.
Architecture
data/sales_data.xlsx ──► load_sql.py ──► data/sales.db (SQLite, runtime read-only)
│
data/docs/*.docx ──────► ingest.py ◄───────────┘
│
▼
chroma_db/ (excel_data & docs_data collections)
│
MCP Client (LLM) ◄──stdio──► server.py (10 tools)
├── retrieval.py (ChromaDB RAG & parameterized SQL KPIs)
└── analytics.py (charts, EDA, trend analysis, CSV/XLSX export)Zero internal LLM keys: Embeddings (
all-MiniLM-L6-v2) run locally, and SQL/tool selection is performed by the connected MCP client's LLM.Fast startup & clean STDIO: Heavy dependencies (
chromadb,sentence-transformers,pandas,numpy,matplotlib) are lazily imported on first tool use; all logs go strictly tostderr.No arbitrary code execution: All analytics and chart generation use fixed, schema-whitelisted Python operations (
analytics.py) instead ofexec()/eval().
Related MCP server: sales-agent-mcp
Implemented MCP Tools (10)
Tool | Category | Purpose |
| Discovery | Lists SQLite tables, row counts, valid |
| Text-to-SQL | Returns every table's columns, SQLite types, and 3 sample rows. Call before writing SQL. |
| Text-to-SQL | Executes a validated single read-only |
| KPIs | Parameterized SQL totals ( |
| Document RAG | Semantic search over |
| Row Lookup | Semantic search over database rows indexed in |
| Visualization | Generates |
| Statistics / EDA | Runs |
| Trends | Computes month-over-month |
| Export | Exports validated read-only |
Security Controls
Read-only SQLite: Runtime DB access uses
sqlite3.connect("file:...?mode=ro", uri=True)with a 10-secondconn.interrupt()timeout.Schema Whitelisting & Parameter Binding: Table and column identifiers in
analytics.pyandretrieval.pyare validated against cached DB metadata and quoted; filter values are validated against distinct DB values and bound via?parameters.SQL Guardrails:
run_sql_queryandexport_datareject comments (--,/*,*/), non-SELECTstatements, multi-statement;, andDROP,DELETE,UPDATE,INSERT,ALTER,ATTACH,PRAGMA, andCREATE.Path Confinement & Retention: Output filenames are server-generated under
outputs/{charts,eda,exports}/with title sanitization and automatic pruning to the newest 100 files per subfolder.
Quickstart (Windows)
1. Create virtual environment & install dependencies
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt2. Build the local SQLite database & ChromaDB index
python refresh_data.py(Runs load_sql.py to build data/sales.db from data/sales_data.xlsx, then ingest.py to populate chroma_db/.)
Tip: Copy
.env.exampleto.envor setHF_HUB_OFFLINE=1after the first run soall-MiniLM-L6-v2loads from local cache without network checks.
3. Configure your MCP Client
{
"mcpServers": {
"acme-knowledge": {
"command": "<PATH_TO_REPO>/.venv/Scripts/python.exe",
"args": ["<PATH_TO_REPO>/server.py"],
"env": {
"HF_HUB_OFFLINE": "1"
}
}
}
}4. Run Tests
$env:HF_HUB_OFFLINE="1"
.\.venv\Scripts\python.exe test_retrieval.py
.\.venv\Scripts\python.exe test_analytics.py
.\.venv\Scripts\python.exe test_client.pyProject Layout
SQL_MCP/
├── server.py # MCP stdio server & 10 tool wrappers
├── retrieval.py # ChromaDB retrieval & parameterized SQL KPIs
├── analytics.py # Fixed-function charts, EDA, trend analysis & exports
├── load_sql.py # Excel -> SQLite loader (offline)
├── ingest.py # SQLite & DOCX -> ChromaDB indexer (offline)
├── refresh_data.py # Runs load_sql.py then ingest.py
├── requirements.txt # Python dependencies
├── test_client.py # MCP stdio end-to-end test (10 tools)
├── test_analytics.py # Tests for create_chart, run_eda, run_analysis, export_data
├── test_retrieval.py # Known-answer & vector retrieval tests
├── mcp_config.example.json # Example MCP client configuration
├── .env.example # Optional environment variable reference
├── LICENSE # MIT License
└── data/
├── sales_data.xlsx # Sample synthetic Excel dataset
└── docs/ # Sample internal Word documents (.docx)License
MIT — see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Read-only MCP over your Excel or Airtable plus the PDFs beside it, joined as one relational dataset.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables users to query enterprise sales data from a local SQLite database and investigate anomalies through an inline dashboard with human-in-the-loop review buttons.3-
- FlicenseNot gradedqualityDmaintenanceEnables natural language sales analysis by connecting to a SQLite database, generating charts, and exporting results to CSV/Excel.-
- AlicenseAqualityCmaintenanceA production-grade MCP server for enterprise sales analytics, enabling LLM clients to query, analyze, and visualize sales data from a SQLite database through structured tools, resources, and prompts.6MIT
- FlicenseNot gradedqualityDmaintenanceEnables natural-language sales queries against a SQLite database, generating and executing read-only SQL through a secure MCP server with table listing, schema description, and query execution.-