Database-MCP
🏢 Company Database AI Manager
📖 概要
Company Database AI Manager は、企業データベース向けの自然言語インターフェースです。データの挿入、更新、取得のために複雑な SQL クエリを書く代わりに、ユーザーは平易な英語でコマンドを入力するだけで済みます(例:「IT 部門を追加して、5 人の従業員を割り当ててください」)。
このシスステムは、Model Context Protocol (MCP) を使用して、Groq を搭載した LangGraph エージェントをローカルの Python データベースサーバーに安全に接続します。AI はユーザーのプロンプトを自律的に解釈し、正しいデータベースツールを選択して SQL 操作を実行し、その結果をシンプルな Streamlit ウェブインターフェースで返します。
Related MCP server: PySqlitMCP
⚙️ アーキテクチャと仕組み
このプロジェクトは、真のサーバー/クライアントアーキテクチャを使用して、データベースロジックと AI ロジックを分離しています:
サーバー(
server.pyとmodels.py):SQLite データベースツール(setup_database、add_record、search_database)をホストする独立した FastMCP サーバーを実行します。クライアント(
client.pyとapp.py):Groq のllama-3.3-70b-versatileまたはopenai/gpt-oss-120bを搭載した LangGraph エージェントを実行します。プロトコル(MCP):クライアントは標準入出力(stdio)を介してサーバーに安全に接続します。サーバーに利用可能なツールを問い合わせ、それらを LangGraph エージェントに渡し、Python 関数を直接インポートすることなく呼び出します。
📂 フォルダ構成
📦 llm-db-mcp
┣ 📜 .env # Stores secure API keys (Do NOT commit to GitHub)
┣ 📜 .gitignore # Prevents sensitive files from being pushed to Git
┣ 📜 app.py # The Streamlit web UI for interacting with the AI
┣ 📜 client.py # The terminal-based LangGraph agent script
┣ 📜 company.db # The automatically generated SQLite database file
┣ 📜 models.py # SQLAlchemy schemas (Departments, Roles, Employees, Projects)
┣ 📜 requirements.txt # Project dependencies and version numbers
┗ 📜 server.py # The FastMCP server hosting the database tools🚀 セットアップとインストール
1. 前提条件
Python 3.10 以上。
無料の Groq API キー。
2. 環境構築
仮想環境を作成して有効化します(Conda 推奨):
conda create -n db_mcp python=3.11
conda activate db_mcp3. 依存関係のインストール
requirements.txt ファイルから必要なパッケージをすべてインストールします:
pip install -r requirements.txt4. API キーの設定
ルートディレクトリに .env ファイルを作成し、Groq API キーを追加します:
GROQ_API_KEY=gsk_your_api_key_here🖥️ 使用方法
オプション 1:Web UI を実行する(推奨)
対話型チャットインターフェースを起動するには、次を実行します:
streamlit run app.pyオプション 2:ターミナルクライアントを実行する
エージェントをコマンドラインのみで実行するには:
🛠️ 試してみるサンプルプロンプト
アプリの起動後、チャットに次のプロンプトを入力してみてください:
「データベースのテーブルをセットアップしてください。」(最初にこれを実行してください!)
「IT 部門を追加してください。」
「IT 部門に、給与 75000 の John Doe という名前の新しい従業員を追加してください。」
「給与が 50000 を超える従業員をすべて表示してください。」
🔒 セキュリティに関する注意事項
.env ファイルや API キーをバージョン管理にコミットしないでください。
.gitignore ファイルは、.env と company.db が GitHub にアップロードされないように事前設定されています。
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
- FlicenseNot gradedqualityDmaintenanceEnables natural language database operations and semantic document search through SQLite and vector database integration. Converts plain English instructions into SQL queries and provides RAG capabilities for uploaded documents.
- -licenseNot gradedqualityNot gradedmaintenanceEnables comprehensive SQLite database management through natural language, including database creation, table operations, data CRUD operations, backup/restore functionality, and CSV import/export capabilities.
- AlicenseNot gradedqualityDmaintenanceEnables LLM agents to perform complete database operations on SQLite databases, including creating tables, executing queries, and managing data through CRUD operations with schema inspection capabilities.36MIT
- FlicenseNot gradedqualityDmaintenanceEnables interaction with SQLite databases through natural language, supporting SQL queries, CSV imports, and schema exploration.9
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
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/deepan2003/Database-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server