Skip to main content
Glama
kamaleshayyala-0608

SQL MCP Server Demo

SQL MCP Server Demo

This repository implements a local Model Context Protocol (MCP) server for SQL Server using Microsoft Data API Builder (DAB) 2.0. It exposes read-only data access tools (describe_entities, read_records, and aggregate_records) to a local Ollama model (qwen3:8b) via a Python MCP client.

Repository Structure

A:\sql-mcp-demo
│   .env                 - Environment variables configuration
│   README.md            - Project documentation
│   requirements.txt     - Python dependencies
│   test_ollama.py       - Verifies basic connection to Ollama
│   test_tools.py        - Verifies tool-calling capability of qwen3:8b
│
├── .venv/               - Python virtual environment
│
├── dab/
│   └── dab-config.json  - Schema-valid Data API Builder configuration
│
└── database/
    └── verify.sql       - Reference database queries

Related MCP server: Python MSSQL MCP Server

Architecture

           ┌──────────────────────┐
           │      Qwen3:8B        │
           │       Ollama         │
           └──────────┬───────────┘
                      │
                      │ Tool Calling
                      ▼
           ┌──────────────────────┐
           │    MCP Client        │
           │     Python           │
           └──────────┬───────────┘
                      │
                      │ MCP HTTP
                      ▼
           ┌──────────────────────┐
           │ Data API Builder     │
           │    SQL MCP Server    │
           │ localhost:5000/mcp   │
           └──────────┬───────────┘
                      │
                      │
                      ▼
           ┌──────────────────────┐
           │ SQL Server LocalDB   │
           │                      │
           │ EmployeeDB           │
           │ └── dbo.Employee     │
           └──────────────────────┘

Running the Project

  1. Verify Services: Ensure SQL Server LocalDB and Ollama are started:

    sqllocaldb start MSSQLLocalDB
    ollama run qwen3:8b
  2. Start the Data API Builder MCP Server: From a:\sql-mcp-demo:

    dab start --config .\dab\dab-config.json

    The MCP endpoint is exposed at http://localhost:5000/mcp.

  3. Verify via MCP Inspector: Launch the Inspector in proxy mode:

    npx -y @modelcontextprotocol/inspector http://localhost:5000/mcp

    Open the printed URL in your browser to verify that the describe_entities, read_records, and aggregate_records tools are active.

  4. Run Python Client Verification: Ensure your virtual environment is active:

    .venv\Scripts\activate

    Verify Ollama connection:

    python test_ollama.py

    Verify tool calling:

    python test_tools.py

Schema Validation Bug Fixed

A critical schema validation issue in Microsoft's Data API Builder v2.0.9 was addressed:

  • The standard DAB schema validator contains a bug where defining "mcp" at the entity level for table types incorrectly triggers a stored-procedure constraint (requiring source.type to be stored-procedure).

  • This was resolved by removing the redundant entity-level "mcp" block since MCP capability is already configured globally at the runtime level.

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.

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    Enables Language Models to interact with Microsoft SQL Server databases by inspecting table schemas, executing SQL queries, and reading table data through a standardized Model Context Protocol interface.
    27
  • A
    license
    A
    quality
    C
    maintenance
    Read-only Model Context Protocol server for Microsoft SQL Server, enabling safe schema discovery, profiling, and querying with zero risk of data modification.
    14
    1,622
    5
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    A Model Context Protocol server that exposes SQL Server metadata and read-only query execution as a structured HTTP API, with safety validation and allowlist policy enforcement.
    1

View all related MCP servers

Related MCP Connectors

  • Read-only MCP server for ClassQuill, a tutoring-business-management platform.

  • Read-only access to your VortexIQ store data: audits, KPIs, alerts, Brand DNA, reports, Ask VIQ.

  • Read-only MCP server for Muovi, Argentina's trust-first local services marketplace (6 tools).

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/kamaleshayyala-0608/SQL-Demo'

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