Skip to main content
Glama
manohar135

Local Database Analytics MCP Server

by manohar135

Local Database Analytics MCP Server

ローカルSQLite eコマースデータベースをClaudeなどのAIアシスタントに公開する、PythonベースのModel Context Protocol (MCP) サーバーです。FastMCPSQLAlchemyPandasで構築されています。

MCPとは? Model Context Protocol (Anthropic製) は、AIモデルがローカルのツールやデータと安全にやり取りできるようにするものです。このサーバーはClaudeにデータベースの情報を教え、自然言語だけでデータのクエリ、分析、説明を可能にします。


機能

ツール (全11個)

ツール

説明

list_tables

データベース内のすべてのテーブルを一覧表示

describe_table

特定のテーブルのスキーマ/カラムを表示

get_sample_rows

テーブルからN件のサンプル行を返す

get_row_count

オプションのWHEREフィルターで行数をカウント

run_sql_query

安全なSELECTクエリを実行

summarize_column

統計: 任意のカラムの最小値/最大値/平均値/ヌル数/ユニーク数

find_top_n

カラムでソートした上位N行

group_and_aggregate

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

detect_nulls

欠損データのあるカラムを検出

compute_correlation

2つのカラム間のピアソン相関

time_series_summary

日/週/月単位でデータを集計

リソース

URI

説明

db://schema

データベース全体のスキーマ

db://tables/{name}

特定のテーブルのスキーマ

プロンプト

  • analyze_table — 任意のテーブルの完全な統計分析

  • business_summary — 経営層向けのeコマースレポート

  • find_anomalies — データ品質と外れ値の検出


Related MCP server: SQLite MCP Server

データベーススキーマ

customers ──< orders ──< order_items >── products
  • customers: 名前、メール、都市、登録日を含む15件のレコード

  • products: エレクトロニクス、書籍、スポーツ、ホーム、文房具にわたる15製品

  • orders: ステータス (完了/保留/キャンセル) と合計金額を含む60件の注文

  • order_items: 注文と製品を結びつける明細項目


プロジェクト構成

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)

はじめに

1. リポジトリをクローン

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

2. 仮想環境を作成して依存関係をインストール

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

3. データベースにシードデータを投入

python database/seed_data.py

4. MCP Inspectorを起動 (開発モード)

fastmcp dev server.py

5. テストを実行

pytest tests/ -v

技術スタック

技術

役割

FastMCP

MCPサーバーフレームワーク

SQLite

設定不要のローカルデータベース

SQLAlchemy

DBエンジン & ORM

Pandas

分析 & 集計

Pydantic

入力検証

Pytest

ユニットテスト


Claudeとの会話例

Claude Desktopに接続したら、以下を試してみてください:

  • 「どのテーブルにアクセスできますか?」

  • 「売上データのビジネスサマリーを教えて」

  • 「最も売れている製品はどれですか?」

  • 「ordersテーブルにデータ品質の問題はありますか?」

  • 「過去1年間の月次売上トレンドを見せて」

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