Skip to main content
Glama
gigimento

MCP SQL Server

by gigimento

MCP SQL Server

A Model Context Protocol (MCP) server that exposes a SQL Server database as tools for AI assistants like Claude, Gemini, and Copilot.

Features

  • test_connection — Verify database connectivity

  • list_tables — List all tables in the database

  • query_sql — Execute arbitrary SQL queries (read/write with 100-row limit)

  • get_oee_by_line — Calculate OEE metrics (Availability, Performance, Quality) for a production line

  • get_downtime_analysis — Aggregate downtime reasons sorted by duration

  • get_shift_performance — KPI analytics for a specific shift and date

  • get_live_kpi — Fetch the latest OEE value from the live table

Related MCP server: SQL Server MCP

Prerequisites

  • Python 3.10+

  • Microsoft ODBC Driver 17+ for SQL Server

  • Access to a SQL Server database

Installation

# Clone the repository
git clone https://github.com/gigimento/mcp-sql-server.git
cd mcp-sql-server

# Create virtual environment
python -m venv .venv
.venv\Scripts\activate  # Windows
# source .venv/bin/activate  # Linux/macOS

# Install dependencies
pip install -r requirements.txt

Configuration

Copy .env.example to .env and adjust:

DB_SERVER=localhost\SQLEXPRESS
DB_NAME=YourDatabase
DB_DRIVER=ODBC Driver 17 for SQL Server
DB_TRUSTED_CONNECTION=yes

Or set the corresponding environment variables directly.

Usage

With Claude Desktop / OpenCode

Add to your MCP config:

{
  "mcpServers": {
    "sql-server": {
      "command": "python",
      "args": ["path/to/server.py"],
      "env": {
        "DB_SERVER": "localhost\\SQLEXPRESS",
        "DB_NAME": "YourDatabase"
      }
    }
  }
}

Standalone

python server.py

The server communicates over stdio using the MCP protocol.

Expected Database Schema

The OEE tools expect tables similar to:

  • ProductionData — columns: Line, Date, Shift, Runtime, PlannedTime, GoodQty, RejectQty, TotalQty, PlannedQty

  • Downtime — columns: Line, Date, DowntimeReason, Duration

  • OEE_Live — columns: Line, OEE, Timestamp

You can adapt the queries to match your schema by editing the tool functions in server.py.

License

MIT

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

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/gigimento/mcp-sql-server'

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