Local Database Analytics MCP Server
Lokaler MCP-Server für Datenbank-Analysen
Ein auf Python basierter Model Context Protocol (MCP)-Server, der KI-Assistenten wie Claude Zugriff auf eine lokale SQLite-E-Commerce-Datenbank gibt. Entwickelt mit FastMCP, SQLAlchemy und Pandas.
Was ist MCP? Das Model Context Protocol (von Anthropic) ermöglicht KI-Modellen die sichere Interaktion mit lokalen Tools und Daten. Dieser Server bringt Claude Ihre Datenbank näher, sodass Claude die Daten abfragen, analysieren und erklären kann – und das alles in natürlicher Sprache.
Funktionen
Tools (insgesamt 11)
Tool | Beschreibung |
| Alle Tabellen in der Datenbank auflisten |
| Schema/Spalten einer bestimmten Tabelle anzeigen |
| N Beispieldatensätze aus einer Tabelle zurückgeben |
| Anzahl der Zeilen mit optionalem WHERE-Filter zählen |
| Beliebige sichere SELECT-Abfrage ausführen |
| Statistiken: Min/Max/Mittelwert/NULL-Werte/Eindeutige Werte für eine beliebige Spalte |
| Die Top-N-Zeilen, sortiert nach einer Spalte |
| GROUP BY + SUM/AVG/COUNT/MIN/MAX |
| Spalten mit fehlenden Daten finden |
| Pearson-Korrelation zwischen zwei Spalten |
| Daten nach Tag/Woche/Monat aggregieren |
Ressourcen
URI | Beschreibung |
| Vollständiges Datenbankschema |
| Schema für eine bestimmte Tabelle |
Prompts
analyze_table— Vollständige statistische Analyse einer beliebigen Tabelle ausführenbusiness_summary— E-Commerce-Berichte für die Führungsebene erstellenfind_anomalies—Datenqualitäts- und Ausreißererkennung durchführen
Related MCP server: db-mcp
Datenbankschema
customers ──< orders ──< order_items >── productscustomers: 15 Datensätze mit Name, E-Mail, Stadt und Registrierungsdatum
products: 15 Produkte in den Kategorien Elektronik, Bücher, Sport, Wohnen und Schreibwaren
orders: 60 Bestellungen mit Status (abgeschlossen/ausstehend/storniert) und Gesamtsummen
order_items: Positionspositionen, die Bestellungen mit Produkten verknüpfen
Projektstruktur
MCP_Server/
├── server.py # FastMCP server entry point
├── requirements.txt # Python dependencies
├── database/
│ ├── engine.py # SQLAlchemy DB connection
│ └── seed_data.py # Seed script (creates + populates DB)
├── tools/
│ ├── query.py # Core SQL tools (Phase 2)
│ └── analytics.py # Analytics tools (Phase 3)
├── resources/
│ └── schema.py # DB schema as MCP resources
├── prompts/
│ └── templates.py # Pre-built analyst prompts
├── tests/
│ └── test_tools.py # Unit tests
└── data/
└── analytics.db # SQLite database (auto-created)Erste Schritte
1. Repository klonen
git clone https://github.com/manohar135/Local-Database-Analytics-MCP-Server.git
cd Local-Database-Analytics-MCP-Server2. Virtuelle Umgebung erstellen und Abhängigkeiten installieren
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt3. Datenbank seeden
python database/seed_data.py4. MCP Inspector starten (Entwicklungsmodus)
fastmcp dev server.py5. Tests ausführen
pytest tests/ -vTech-Stack
Technologie | Rolle |
MCP-Server-Framework | |
SQLite | Lokale Datenbank ohne Konfiguration |
SQLAlchemy | DB-Engine und ORM |
Pandas | Analysen und Aggregation |
Pydantic | Eingabevalidierung |
Pytest | Unit-Tests |
Beispiel-Unterhaltungen mit Claude
Sobald die Verbindung zu Claude Desktop hergestellt ist, probieren Sie es Städte:
„Auf welche Tabellen haben Sie Zugriff?“
„Geben Sie mir eine geschäftliche Zusammenfassung der Verkaufsdaten“
„Welche Produkte verkaufen sich am besten?“
„Gibt es Datenqualitätsprobleme in der orders-Tabelle?“
„Zeigen Sie mir die monatlichen Umsatztrends für das letzte Jahr“
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
Text-to-SQL for Claude & ChatGPT: OAuth sign-in, read-only Postgres/MySQL/SQL Server, free demo_shop
Run your ecommerce ads from Claude & ChatGPT: Meta, Google, Amazon, Shopify (150 tools)
Connects Claude, ChatGPT and other AI agents to a SIGNLD workspace. SIGNLD reads your business systems (QuickBooks, HubSpot, Salesforce, Shopify and 800+ more) through read-only connections and keeps a Knowledge Graph of how the business fits together. The agent can list data connections and table schemas, run read-only SQL, read the Knowledge Graph, entities, metrics and topics, save definitions and topics in the workspace, and build charts and dashboards. Nothing is ever written back to your source systems. Every answer traces to the source row. Private LLM powered by AWS Bedrock; we never train on customer data.
Ask questions across Shopify, Klaviyo, GA4 and 20+ e-commerce sources in plain English.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables natural-language querying of an e-commerce dataset by providing a LangChain agent that uses tools to execute parameterized SQL queries on a SQLite database, with short-term memory and Streamlit or Claude Desktop interfaces.-
- FlicenseAqualityDmaintenanceEnables AI agents to safely interact with a SQLite shop database through schema discovery, read-only SQL queries, and pre-built analytics reports like top customers, top products, and revenue summaries.6-
- FlicenseAqualityDmaintenanceGives AI agents read-only analytical access to an e-commerce SQLite database (customers, orders, order_items, products) via SQL queries, table listing, and schema inspection.3-
- FlicenseAqualityDmaintenanceEnables AI agents to analyze an SQLite e-commerce database via secure read-only SQL queries, providing tools for table inspection and analytical requests.2-