Enterprise Data MCP Server
Enterprise Data Agent 🗄️
Groq LLMのツール呼び出しとローカルのSQLiteデータベースを活用した、エンタープライズ従業員データベースへの自然言語インターフェースです。Streamlitフロントエンドと**Model Context Protocol (MCP)**サーバーバックエンドを備えています。
アーキテクチャ
flowchart TD
%% Styling
classDef client fill:#2d3748,stroke:#94a3b8,stroke-width:1px,color:#f8fafc,rx:10px
classDef core fill:#0f172a,stroke:#3b82f6,stroke-width:2px,color:#eff6ff,rx:6px
classDef db fill:#064e3b,stroke:#10b981,stroke-width:2px,color:#ecfdf5,rx:6px
classDef ai fill:#312e81,stroke:#8b5cf6,stroke-width:2px,color:#eef2ff,rx:6px
%% Nodes
User(["👤 User Browser"]):::client
ExtAI(["🤖 MCP Client (Claude, Cursor)"]):::client
App["⚡ Streamlit App"]:::core
Server["🔌 MCP Server"]:::core
DBLayer["⚙️ Shared DB Layer"]:::core
Groq{"🧠 Groq LLM"}:::ai
SQLite[("💾 SQLite Database")]:::db
%% Connections
User <-->|"Chat Interface"| App
App <-->|"Prompts & Tools"| Groq
App -->|"Execute Tools"| DBLayer
ExtAI <-->|"MCP / stdio"| Server
Server -->|"Execute Tools"| DBLayer
DBLayer <-->|"SQL Operations"| SQLiteRelated MCP server: OCP AI Custom HR MCP Server
クイックスタート
1. 前提条件
Python 3.11以上
2. クローンとセットアップ
git clone <your-repo-url>
cd mcp_project
# Create and activate a virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS/Linux
# Install dependencies
pip install -r requirements.txt3. 環境設定
プロジェクトのルートディレクトリ(F:\PROJECTS\MCP\.env)に.envファイルを作成します:
GROQ_API_KEY=gsk_your_key_here
GROQ_MODEL=llama-3.3-70b-versatile # optional, this is the default4. データベースの初期化
# From the project root (F:\PROJECTS\MCP\)
sqlite3 enterprise_data.db < schema.sql5. アプリの実行
# From F:\PROJECTS\MCP\
streamlit run mcp_project/app.pyブラウザで http://localhost:8501 を開きます。
利用可能なツール
LLMはクエリに基づいて、以下のツールを自動的に呼び出すことができます:
ツール | 説明 |
| すべてのアクティブユーザーとその役割を一覧表示 |
| 新しいユーザーを追加(名前 + 役割) |
| 名前を指定してアクティブユーザーを無効化 |
| 合計、アクティブ、非アクティブの数を取得 |
| 名前の一部でユーザーを検索 |
クエリの例
"アクティブなユーザーは誰ですか?"
"Jane Doeをマネージャーとして追加して"
"合計で何人のユーザーがいますか?"
"Aliceという名前のユーザーを検索して"
"Bob Jonesを無効化して"
"ユーザー統計を表示して"
MCPサーバーの実行(スタンドアロン)
server.pyは、Model Context Protocolを通じて同じツールを公開します。ローカルのstdio接続とHTTPベースのsseトランスポートの両方をサポートしています!
現在公開されているもの:
ツール: DBクエリおよび更新操作
リソース: MCP経由で
schema.sqlを公開プロンプト:
hr-assistantのような事前設定されたプロンプトを提供
AIデスクトップアプリ(Claude Desktop / Cursorなど)でローカル実行する場合:
python mcp_project/server.py --transport stdioポート8000でHTTP SSEサーバーとして実行する場合:
python mcp_project/server.py --transport sse --port 8000プロジェクト構造
F:\PROJECTS\MCP\
├── .env # ← API key (never commit this!)
├── .gitignore
├── requirements.txt
├── schema.sql # DB schema — use to recreate the database
├── enterprise_data.db # SQLite database (gitignored)
└── mcp_project\
├── app.py # Streamlit frontend
├── server.py # MCP stdio server
└── db.py # Shared database access layerセキュリティ上の注意
.envファイルをコミットしないでください。.gitignoreで除外されています。enterprise_data.dbをコミットしないでください。 再作成にはschema.sqlを使用してください。Groq APIキーが漏洩した場合は、console.groq.comでキーを更新(ローテーション)してください。
This server cannot be deployed
Maintenance
Related MCP Connectors
- mcpOAuthcom.gibsonai
GibsonAI MCP server: manage your databases with natural language
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
- mcp-serverOAuthio.klokin
MCP server exposing klokin time-tracking operations (employees, time entries, stores) to AI clients.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn open-source MCP server that imports HR CSV data into an in-memory SQLite database for structured querying and metadata retrieval. It enables users to perform read-only SQL queries and structured searches on employee data through natural language.MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server for interacting with an HR database, enabling querying employee data and HR operations via natural language.-
- FlicenseNot gradedqualityDmaintenanceA comprehensive MCP server that enables database operations, schema management, and statistics via natural language through SQL queries and resources.18 npm-
- FlicenseNot gradedqualityDmaintenanceMCP server for managing users in PostgreSQL, enabling CRUD operations and search via natural language commands.-