Local Database Analytics MCP Server
Provides tools for querying and analyzing a local SQLite database, including listing tables, describing schemas, running SQL queries, aggregating data, and computing statistics.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Local Database Analytics MCP ServerWhich products are selling the most?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Local Database Analytics MCP Server
A Python-based Model Context Protocol (MCP) server that connects local databases to AI assistants like Claude. This project demonstrates how to build analytical abstractions on top of raw SQL data using FastMCP, SQLAlchemy, and Pandas.
Overview
Instead of just giving an LLM raw SQL access, this server provides a structured suite of analytical tools. It allows an AI assistant to natively inspect schemas, run safe queries, aggregate data, detect nulls, compute correlations, and generate time-series summaries—all through natural language.
The repository includes a seed script that generates a realistic local SQLite e-commerce database, allowing you to test the server immediately without needing external database credentials.
Related MCP server: agente-mcp-streamlit-ecommerce
Core Capabilities
Read-Only SQL Execution: Safely execute
SELECTqueries without risking data modification.Statistical Analysis: Calculate min/max, standard deviation, and Pearson correlations between columns.
Time-Series Aggregation: Group data by day, week, or month to spot trends.
Automated Data Quality Checks: Tools to scan for nulls and anomalies.
MCP Prompts: Pre-built templates for common tasks like generating business summaries and analyzing tables.
Project Structure
server.py&mcp_instance.py: The FastMCP server initialization and entry points.database/: Contains the SQLAlchemy connection logic and the data seeding script.tools/: The core of the server.query.py: Basic SQL and schema inspection tools.analytics.py: Higher-level Pandas-based statistical tools.
resources/: Exposes database schemas as static MCP resources.prompts/: Standardized MCP prompts for the AI assistant.tests/: Pytest suite verifying the functionality of all tools.
Setup Instructions
Clone the repository
git clone https://github.com/manohar135/Local-Database-Analytics-MCP-Server.git cd Local-Database-Analytics-MCP-ServerSet up a virtual environment
python -m venv .venv source .venv/bin/activate pip install -r requirements.txtGenerate the sample database This script creates a local SQLite database (
data/analytics.db) and populates it with sample e-commerce data (customers, products, orders).python database/seed_data.pyRun the MCP Inspector FastMCP comes with a built-in UI for testing tools locally without needing Claude Desktop.
fastmcp dev inspector server.py
Testing
The project includes a test suite that uses a temporary SQLite setup to verify the MCP tools.
pytest tests/ -vIntegration with Claude Desktop
To use this server directly within Claude Desktop, add the following to your claude_desktop_config.json:
{
"mcpServers": {
"local-db-analytics": {
"command": "/path/to/your/repo/.venv/bin/python",
"args": ["-m", "fastmcp", "run", "/path/to/your/repo/server.py"]
}
}
}(Replace the paths with the absolute paths to your virtual environment and repository).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Run your ecommerce ads from Claude & ChatGPT: Meta, Google, Amazon, Shopify (150 tools)
Ask questions across Shopify, Klaviyo, GA4 and 20+ e-commerce sources in plain English.
Ask data questions in natural language. Get SQL, insights, and charts from your databases.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables LLMs to interact with a SQLite e-commerce database via safe, typed MCP tools with read-only guards and auth-gated mutations, plus a Claude agent for answering business questions.1MIT
- FlicenseNot gradedqualityCmaintenanceEnables 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.-
- AlicenseAqualityBmaintenanceEnables 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.683MIT
- FlicenseAqualityBmaintenanceGives 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-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/manohar135/Local-Database-Analytics-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server