Skip to main content
Glama
deepan2003

Database-MCP

by deepan2003

🏢 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 ロジックを分離しています:

  1. サーバー(server.pymodels.py:SQLite データベースツール(setup_databaseadd_recordsearch_database)をホストする独立した FastMCP サーバーを実行します。

  2. クライアント(client.pyapp.py:Groq の llama-3.3-70b-versatile または openai/gpt-oss-120b を搭載した LangGraph エージェントを実行します。

  3. プロトコル(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_mcp

3. 依存関係のインストール

requirements.txt ファイルから必要なパッケージをすべてインストールします:

pip install -r requirements.txt

4. 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 にアップロードされないように事前設定されています。

F
license - not found
Not graded
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

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables comprehensive SQLite database management through natural language, including database creation, table operations, data CRUD operations, backup/restore functionality, and CSV import/export capabilities.
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.
    36
    MIT

View all related MCP servers

Related MCP Connectors

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/deepan2003/Database-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server