Skip to main content
Glama
manohar135

Local Database Analytics MCP Server

by manohar135

Local Database Analytics MCP Server

A Python-based Model Context Protocol (MCP) server that exposes a local SQLite e-commerce database to AI assistants like Claude. Built with FastMCP, SQLAlchemy, and Pandas.

What is MCP? The Model Context Protocol (by Anthropic) lets AI models securely interact with local tools and data. This server teaches Claude about your database so it can query, analyze, and explain the data — all using natural language.


Features

Tools (11 total)

Tool

Description

list_tables

List all tables in the database

describe_table

Show schema/columns of a specific table

get_sample_rows

Return N sample rows from a table

get_row_count

Count rows with optional WHERE filter

run_sql_query

Execute any safe SELECT query

summarize_column

Stats: min/max/mean/nulls/unique for any column

find_top_n

Top N rows sorted by a column

group_and_aggregate

GROUP BY + SUM/AVG/COUNT/MIN/MAX

detect_nulls

Find columns with missing data

compute_correlation

Pearson correlation between two columns

time_series_summary

Aggregate data by day/week/month

Resources

URI

Description

db://schema

Full database schema

db://tables/{name}

Schema for a specific table

Prompts

  • analyze_table — Full statistical analysis of any table

  • business_summary — Executive-level e-commerce report

  • find_anomalies — Data quality & outlier detection


Related MCP server: SQLite MCP Server

Database Schema

customers ──< orders ──< order_items >── products
  • customers: 15 records with name, email, city, signup date

  • products: 15 products across Electronics, Books, Sports, Home, Stationery

  • orders: 60 orders with status (completed/pending/cancelled) and totals

  • order_items: Line items linking orders to products


Project Structure

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)

Getting Started

1. Clone the repo

git clone https://github.com/manohar135/Local-Database-Analytics-MCP-Server.git
cd Local-Database-Analytics-MCP-Server

2. Create a virtual environment and install dependencies

python -m venv .venv
source .venv/bin/activate       # On Windows: .venv\Scripts\activate
pip install -r requirements.txt

3. Seed the database

python database/seed_data.py

4. Launch the MCP Inspector (dev mode)

fastmcp dev server.py

5. Run tests

pytest tests/ -v

Tech Stack

Technology

Role

FastMCP

MCP server framework

SQLite

Zero-config local database

SQLAlchemy

DB engine & ORM

Pandas

Analytics & aggregation

Pydantic

Input validation

Pytest

Unit testing


Example Claude Conversations

Once connected to Claude Desktop, try:

  • "What tables do you have access to?"

  • "Give me a business summary of the sales data"

  • "Which products are selling the most?"

  • "Are there any data quality issues in the orders table?"

  • "Show me monthly revenue trends for the past year"

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    Enables Claude to connect to and interact with SQLite, SQL Server, PostgreSQL, and MySQL databases through natural language. Supports executing queries, managing tables, exporting data, and storing business insights with authentication options including AWS IAM.
    853
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    Enables natural language interaction with local SQLite databases through Claude Desktop, translating plain English queries into SQL for data analysis and exploration.
    3
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    Enables 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.
    1
    MIT
  • F
    license
    -
    quality
    C
    maintenance
    Enables 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.

View all related MCP servers

Related MCP Connectors

  • Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…

  • Manage your Savanto store from your AI: catalog, content, prompts, and analytics, by chat.

  • Amazon brand, seller, niche & buy-box intelligence inside your own Claude or ChatGPT.

View all MCP Connectors

Latest Blog Posts

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