Skip to main content
Glama
Diluksha-Upeka

Enterprise Data MCP Server

엔터프라이즈 데이터 에이전트 🗄️

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"| SQLite

Related MCP server: OCP AI Custom HR MCP Server

빠른 시작

1. 사전 요구 사항

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.txt

3. 환경 구성

프로젝트 루트(F:\PROJECTS\MCP\.env)에 .env 파일을 생성합니다:

GROQ_API_KEY=gsk_your_key_here
GROQ_MODEL=llama-3.3-70b-versatile   # optional, this is the default

4. 데이터베이스 초기화

# From the project root (F:\PROJECTS\MCP\)
sqlite3 enterprise_data.db < schema.sql

5. 앱 실행

# From F:\PROJECTS\MCP\
streamlit run mcp_project/app.py

브라우저에서 http://localhost:8501을 엽니다.


사용 가능한 도구

LLM은 사용자의 쿼리에 따라 다음 도구를 자동으로 호출할 수 있습니다:

도구

설명

get_active_users

모든 활성 사용자와 그들의 역할 나열

add_user

새 사용자 추가 (이름 + 역할)

deactivate_user

이름으로 활성 사용자 비활성화

get_user_stats

전체, 활성 및 비활성 사용자 수 가져오기

search_users

이름 조각으로 사용자 검색


예시 쿼리

  • "현재 활성 사용자는 누구인가요?"

  • "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에서 키를 교체하십시오.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An 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
  • F
    license
    Not graded
    quality
    D
    maintenance
    An MCP server for interacting with an HR database, enabling querying employee data and HR operations via natural language.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    A comprehensive MCP server that enables database operations, schema management, and statistics via natural language through SQL queries and resources.
    18 npm
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    MCP server for managing users in PostgreSQL, enabling CRUD operations and search via natural language commands.
    -