Local Database Analytics MCP Server
Local Database Analytics MCP Server
ローカルSQLite eコマースデータベースをClaudeなどのAIアシスタントに公開する、PythonベースのModel Context Protocol (MCP) サーバーです。FastMCP、SQLAlchemy、Pandasで構築されています。
MCPとは? Model Context Protocol (Anthropic製) は、AIモデルがローカルのツールやデータと安全にやり取りできるようにするものです。このサーバーはClaudeにデータベースの情報を教え、自然言語だけでデータのクエリ、分析、説明を可能にします。
機能
ツール (全11個)
ツール | 説明 |
| データベース内のすべてのテーブルを一覧表示 |
| 特定のテーブルのスキーマ/カラムを表示 |
| テーブルからN件のサンプル行を返す |
| オプションのWHEREフィルターで行数をカウント |
| 安全なSELECTクエリを実行 |
| 統計: 任意のカラムの最小値/最大値/平均値/ヌル数/ユニーク数 |
| カラムでソートした上位N行 |
| GROUP BY + SUM/AVG/COUNT/MIN/MAX |
| 欠損データのあるカラムを検出 |
| 2つのカラム間のピアソン相関 |
| 日/週/月単位でデータを集計 |
リソース
URI | 説明 |
| データベース全体のスキーマ |
| 特定のテーブルのスキーマ |
プロンプト
analyze_table— 任意のテーブルの完全な統計分析business_summary— 経営層向けのeコマースレポートfind_anomalies— データ品質と外れ値の検出
Related MCP server: SQLite MCP Server
データベーススキーマ
customers ──< orders ──< order_items >── productscustomers: 名前、メール、都市、登録日を含む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-Server2. 仮想環境を作成して依存関係をインストール
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt3. データベースにシードデータを投入
python database/seed_data.py4. MCP Inspectorを起動 (開発モード)
fastmcp dev server.py5. テストを実行
pytest tests/ -v技術スタック
技術 | 役割 |
MCPサーバーフレームワーク | |
SQLite | 設定不要のローカルデータベース |
SQLAlchemy | DBエンジン & ORM |
Pandas | 分析 & 集計 |
Pydantic | 入力検証 |
Pytest | ユニットテスト |
Claudeとの会話例
Claude Desktopに接続したら、以下を試してみてください:
「どのテーブルにアクセスできますか?」
「売上データのビジネスサマリーを教えて」
「最も売れている製品はどれですか?」
「ordersテーブルにデータ品質の問題はありますか?」
「過去1年間の月次売上トレンドを見せて」
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 Servers
- Alicense-qualityDmaintenanceEnables 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.853MIT
- Alicense-qualityDmaintenanceEnables natural language interaction with local SQLite databases through Claude Desktop, translating plain English queries into SQL for data analysis and exploration.3MIT
- Alicense-qualityBmaintenanceEnables 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
- Flicense-qualityCmaintenanceEnables 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.
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.
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