SQL Server Table Assistant (Hbla Dcom)

MCP数据服务

提供方 未标注

数据服务 stdio · 本地进程 未标注 社区 / 第三方
查看接入方式

全面解析Sql Server Table AssistantMCP Server的核心功能、安装配置和实用案例。作为顶级Model Context Protocol服务器,Sql Server Table Assistant能让AI助手访问实时数据、执行操作,为您提供更智能的工作体验和自动化解决方案。

一句话选型结论

按资料字段整理

SQL Server Table Assistant (Hbla Dcom) 属于数据服务类 MCP 服务器,stdio · 本地进程,鉴权方式未标注,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类数据服务 传输方式stdio · 本地进程 鉴权未标注 部署方式本地部署
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

数据服务
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

安装与配置

stdio · 本地进程 未标注
客户端在本机拉起子进程,数据不出本机
pip install -r requirements.txt来安装所有必需的库。

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Python,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
数据库查询

用自然语言查库、取数,不用手写 SQL。

数据同步与清洗

把多来源数据拉到一处做整理。

报表取数

按口径快速拉出统计结果。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在数据服务场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
SQL Server Table Assistant (Hbla Dcom)当前 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Memory 9d25f64e 9 未标注 未标注 无 2026-05-17
Getzep MCP 9 stdio · 本地进程 本地部署 有 2026-05-17
anything-llm 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Prisma MCP Server 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Astr Bot 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

数据服务
字段来自项目仓库与公开索引,中文说明由本站标注
提供方未标注上游标注的维护方 未标注
分类数据服务本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式未标注远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · Python本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

10.7 KB
来自项目仓库与上游目录的原文,未做删改

SQL Server Table Assistant - Modal Context Protocol

This application lets you interact with a specific SQL Server table using natural language, leveraging the Modal Context Protocol as a communication layer between LLMs and your data source.

This project is based on the mcp-sql-server-natural-lang repository by Aman Pachori, with modifications to focus on single table access.

Key Features:

  • Talk to Your Table: Chat with a specific SQL Server table using plain English
  • SQL Query Iteration: Provide feedback to refine SQL queries until they meet your needs
  • Beautiful Tabular Results: View query results in well-formatted tables for better readability
  • Query History Logging: Automatically save queries, iterations, and results for future reference
  • No-Code Table Operations: Query, insert, update, and delete data through natural conversations
  • Secure, Limited Access: Connect to only one table with restricted credentials for enhanced security
  • MCP-Enhanced Accuracy: Achieve precise table interactions through Modal Context Protocol
  • Context-Aware Conversations: Maintain context across multiple queries
  • Natural Language Explanations: Get plain English explanations of query results
  • Token Optimization: Smart caching and context management to minimize API usage

What is MCP?

MCP (Modal Context Protocol) is a methodology that standardizes how context is bound to LLMs, providing a standard way to connect AI models to different data sources and tools.

Single Table Mode

This application runs in "Single Table Mode" which provides several advantages:

  1. Enhanced Security: Access is limited to a single table rather than the entire database
  2. Simpler Permissions: Users need minimal permissions (just for the specific table)
  3. Focused Experience: The assistant is specialized for working with just one table
  4. Reduced Risk: Prevents accidental access to sensitive data in other tables

Token Optimization

This application implements several strategies to minimize token usage and prevent rate limiting:

  1. Smart Schema Summarization: Instead of sending the entire table schema to the model, a concise summary is created
  2. Response Caching: Similar queries and explanations are cached to avoid redundant API calls
  3. Minimal Prompt Design: System prompts and user instructions are optimized for brevity
  4. Conversation Management: Only recent and relevant messages are included in the context
  5. Dedicated System Prompts: Different prompts for different tasks (schema, query generation, explanations)
  6. Selective Result Transmission: Large result sets are trimmed before being sent to the model
  7. Token Parameter Tuning: Request parameters like max_tokens are set conservatively

These optimizations allow the application to function smoothly even with large tables and complex queries, while staying within API rate limits.

Prerequisites

Before you get started, make sure you have the following:

  • Python 3.12+ installed on your machine
  • A valid Azure OpenAI deployment with API access
  • SQL Server with a table that you want to interact with
  • Limited user credentials with access to only that table

Getting Started

Follow these steps to get the project up and running:

1. Clone the Repository```bash

git clone https://github.com/yourusername/sql-server-table-assistant.git
cd sql-server-table-assistant


### 2. Install Dependencies```bash
pip install -r requirements.txt

3. Setup Environment Variables

Create a .env file in the root of the project and add the following:```dotenv

Azure OpenAI Configuration (required)

AZURE_OPENAI_API_KEY=your_azure_openai_api_key
AZURE_OPENAI_ENDPOINT=https://your-resource-name.openai.azure.com
AZURE_OPENAI_API_VERSION=2023-05-15
AZURE_OPENAI_DEPLOYMENT_ID=your-deployment-name

SQL Server Configuration

MSSQL_SERVER=localhost
MSSQL_DATABASE=your_database_name
MSSQL_USERNAME=your_username
MSSQL_PASSWORD=your_password
MSSQL_DRIVER={ODBC Driver 18 for SQL Server}

Table Configuration

MSSQL_TABLE_SCHEMA=dbo
MSSQL_TABLE_NAME=your_table_name


## Running the Table Assistant
Once you've set up your environment and dependencies, you're ready to interact with the Table Assistant.

### Run the Client Script
Execute the following command to start the assistant:```bash
python mcp-ssms-client.py

Once the script starts, it will prompt you with the table name and available commands. You can then type your requests in plain English. For example:```
Table Assistant is ready. You are working with table: dbo.Employees
Type your questions about the table in natural language, and I'll translate them to SQL.
Special commands:
/diagnose - Run diagnostics
/refresh_schema - Refresh table schema
/history - View query history

Enter your Query: Show me all employees with a salary over $50,000


## Interactive Query Workflow

The assistant follows an interactive workflow:

1. You ask a question in natural language
2. The assistant generates a SQL query
3. You can:
   - Execute the query (e)
   - Provide feedback to refine it (f)
   - Cancel (c)
4. If you provide feedback, the assistant generates an improved query
5. Once executed, results are displayed in a formatted table
6. The assistant provides a plain English explanation of the results
7. A complete log of the query, iterations, and results is automatically saved

### Example Conversation```
Enter your Query: Show me the highest paid employee in each department

===== GENERATED SQL QUERY =====
SELECT
    Department,
    EmployeeName,
    Salary
FROM (
    SELECT
        Department,
        EmployeeName,
        Salary,
        ROW_NUMBER() OVER (PARTITION BY Department ORDER BY Salary DESC) as RankBySalary
    FROM dbo.Employees
) RankedEmployees
WHERE RankBySalary = 1
ORDER BY Department
===============================

Do you want to (e)xecute this query, provide (f)eedback to refine it, or (c)ancel? (e/f/c): f
Enter your feedback for improving the SQL query: Include the employee's hire date as well

SQL query generated (iteration 2).

===== GENERATED SQL QUERY =====
SELECT
    Department,
    EmployeeName,
    Salary,
    HireDate
FROM (
    SELECT
        Department,
        EmployeeName,
        Salary,
        HireDate,
        ROW_NUMBER() OVER (PARTITION BY Department ORDER BY Salary DESC) as RankBySalary
    FROM dbo.Employees
) RankedEmployees
WHERE RankBySalary = 1
ORDER BY Department
===============================

Do you want to (e)xecute this query, provide (f)eedback to refine it, or (c)ancel? (e/f/c): e

===== QUERY RESULTS =====
Query executed successfully. 5 rows returned.

+------------+---------------+----------+------------+
| Department | EmployeeName  |   Salary | HireDate   |
+============+===============+==========+============+
| Finance    | Jane Smith    | 95000.00 | 2018-03-15 |
| HR         | Tim Johnson   | 75000.00 | 2020-01-10 |
| IT         | Mary Williams | 98000.00 | 2017-05-22 |
| Marketing  | Bob Miller    | 82000.00 | 2019-07-08 |
| Sales      | John Davis    | 92000.00 | 2016-11-14 |
+------------+---------------+----------+------------+
==========================

Query log saved successfully to logs/queries/query_20230901_152412.json

===== RESULT EXPLANATION =====
The results show the highest paid employee in each department along with their hire date. There are 5 departments in total:

- In Finance, Jane Smith has the highest salary at $95,000 and was hired on March 15, 2018.
- In HR, Tim Johnson earns the most at $75,000 and joined on January 10, 2020.
- In IT, Mary Williams is the top earner with $98,000 and has been with the company since May 22, 2017.
- In Marketing, Bob Miller makes $82,000 and started on July 8, 2019.
- In Sales, John Davis has the highest salary at $92,000 and was hired on November 14, 2016.

Mary Williams from IT has the highest overall salary among all the top-earning employees across departments.
==============================

Diagnostics and Special Commands

The application includes several special commands:

  • /diagnose - Run comprehensive table access diagnostics
  • /refresh_schema - Refresh the table schema
  • /history - View a list of all queries executed in the current session

Query History

The query history feature helps you keep track of all queries executed during the session:```
===== QUERY HISTORY =====
1. [2023-09-01 15:24:12] Show me all employees with a salary over $50,000
SQL: SELECT EmployeeName, Department, Salary FROM dbo.Employees WHERE Salary > 50000 ORDER...
Iterations: 1, Success: True

  1. [2023-09-01 15:32:45] Show me the highest paid employee in each department
    SQL: SELECT Department, EmployeeName, Salary, HireDate FROM (SELECT Department, EmployeeName...
    Iterations: 2, Success: True
    =======================
    ```

Query Logging

All queries and results are automatically saved to logs/queries/ as JSON files for future reference. Each log includes:

  • The original natural language query
  • All SQL iterations and feedback
  • The final SQL query that was executed
  • Query results
  • Timestamps

This allows you to track how queries evolve over time and maintain a record of all database interactions.

Security Considerations

This application implements several security features:

  1. Single table access: Queries are restricted to the configured table
  2. Query validation: All SQL queries are shown for user approval before execution
  3. Transaction safety: INSERT/UPDATE/DELETE tests use transactions with rollback
  4. Error tracing: Detailed error logs help diagnose issues without exposing sensitive information
  5. SQL injection prevention: Structured query generation reduces the risk of SQL injection

Connection Issues

If you encounter connection issues:

  1. Verify your server name or IP address is correct
  2. Ensure the SQL Server is running and accepts remote connections
  3. Check firewall settings to allow SQL Server traffic
  4. Verify that the ODBC driver specified in your .env file is installed
  5. Test connectivity with other tools like SSMS or sqlcmd

Troubleshooting Token Usage

If you encounter rate limit errors with Azure OpenAI:

  1. Wait before retrying: Rate limits are usually time-based, so waiting 60 seconds may resolve the issue
  2. Increase your quota: Visit https://aka.ms/oai/quotaincrease to request a higher rate limit
  3. Upgrade your tier: Free accounts may need to upgrade to Pay-as-you-Go
  4. Use the /refresh_schema command: This regenerates the schema summary which might reduce token usage
  5. Check your prompt length: Very complex questions might trigger more token usage

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • Original MCP SQL Server Natural Language implementation by Aman Pachori
  • Built with Modal Context Protocol (MCP)

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
SQL Server Table Assistant (Hbla Dcom) 怎么安装?

在客户端按下面的安装命令接入:pip install -r requirements.txt来安装所有必需的库。。装完在客户端配置里引用同一个包或端点。

SQL Server Table Assistant (Hbla Dcom) 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

SQL Server Table Assistant (Hbla Dcom) 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

SQL Server Table Assistant (Hbla Dcom) 需要 API Key 吗?

资料没有标注鉴权方式,是否需要密钥取决于服务本身,接入前按官方文档确认。

SQL Server Table Assistant (Hbla Dcom) 能提供哪些能力?

资料显示能力标签包括 自然语言、Python、STDIO。具体工具清单以官方文档为准。

SQL Server Table Assistant (Hbla Dcom) 需要什么运行环境?

运行时为 Python;属于本地进程,需要在本机装好运行环境。

SQL Server Table Assistant (Hbla Dcom) 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。