Copilot SQL MCP POC

Copilot SQL MCP POC

Enables answering business questions over local SQL Server WideWorldImporters data through MCP, with support for both STDIO and Streamable HTTP endpoints.

Category
访问服务器

README

Copilot SQL MCP POC

Proof of concept for answering business questions over local SQL Server WideWorldImporters data through MCP.

Current Milestone

Milestone 9: Copilot Studio integration documentation.

Status:

  • [x] Legacy Cursor implementation preserved in legacy/.
  • [x] Shared app package created.
  • [x] STDIO entry point added as server_stdio.py.
  • [x] Existing MCP tool names preserved.
  • [x] Existing Cursor MCP App resource URI preserved.
  • [x] Data dictionary copied from the legacy implementation.
  • [x] Cursor renderer copied from the legacy implementation.
  • [x] Unit tests added for SQL validation and result handling.
  • [x] Shared VisualResponse model added.
  • [x] Cursor visual results now pass through the neutral model.
  • [x] Cursor renderer can normalize visual_response payloads.
  • [x] SQL remains excluded from public visual response payloads.
  • [x] Adaptive Card renderer added for KPI, bar, horizontal bar, line, pie, doughnut, table, and fallback outputs.
  • [x] Copilot-facing output helper added with business result, Adaptive Card, and fallback text.
  • [x] Streamable HTTP entry point added as server_http.py.
  • [x] /health endpoint added.
  • [x] MCP HTTP endpoint defaults to /mcp.
  • [x] Windows and SQL authentication modes configured through environment variables.
  • [x] Query timeout, max rows, encryption, trust certificate, and approved schemas are configurable.
  • [x] Cross-database, system object, unapproved schema, unqualified table, and SELECT INTO queries are rejected.
  • [x] .env.example added without secrets.
  • [x] Dockerfile added for the HTTP MCP server.
  • [x] .dockerignore added.
  • [x] Container build/run guide added.
  • [x] Azure App Service / ACR deployment guide added.
  • [x] Hybrid Connection and SQL Server Express preparation steps documented.
  • [x] Copilot Studio MCP onboarding guide added.
  • [x] Copilot Studio testing and publish steps documented.
  • [ ] Manual Cursor acceptance questions verified against live SQL Server.

Local STDIO Server

Run the refactored Cursor-compatible MCP server with:

python server_stdio.py

Local Streamable HTTP Server

Run the local HTTP MCP server with:

python server_http.py

Defaults:

  • host: 0.0.0.0
  • port: 8000, or PORT if set
  • MCP endpoint: /mcp, or MCP_HTTP_PATH if set
  • health endpoint: /health

Example health URL:

http://localhost:8000/health

The original working implementation remains available at:

legacy/sqlserver_mcp_wwi_cursor_apps_business.py

Configuration

The refactored server keeps the legacy local defaults:

  • SQLSERVER_HOST, default 050027346-3
  • SQLSERVER_PORT, optional
  • SQLSERVER_DB, default WideWorldImporters
  • SQLSERVER_AUTH_MODE, windows or sql
  • SQLSERVER_USER, optional
  • SQLSERVER_PASS, optional legacy password variable
  • SQLSERVER_PASSWORD, optional preferred password variable
  • SQLSERVER_DRIVER, default ODBC Driver 17 for SQL Server
  • SQLSERVER_ENCRYPT, default no
  • SQLSERVER_TRUST_CERT, default yes
  • QUERY_TIMEOUT_SECONDS, default 15
  • MAX_QUERY_ROWS, default 500
  • SQLSERVER_APPROVED_SCHEMAS, default Application,Sales,Purchasing,Warehouse

If no SQL user/password is provided, the connection uses Windows trusted authentication, matching the legacy Cursor setup.

Local state files default to the legacy/ directory for compatibility:

  • mcp_memory.txt
  • mcp_pending_suggestions.txt
  • mcp_queries.log

Override that directory with MCP_STATE_DIR if needed.

Tests

The current tests use the Python standard library and do not require a live SQL Server:

python -m unittest discover -s tests -p "test_*.py" -v

Manual Cursor and SQL Server acceptance checks are listed in docs/acceptance_tests.md.

The shared visual contract is summarized in docs/visual_contract.md. Adaptive Card rendering notes are in docs/adaptive_card_examples.md. Local HTTP setup notes are in docs/local_http.md. Database configuration notes are in docs/database_configuration.md. Containerisation notes are in docs/containerization.md. Azure deployment notes are in AZURE_DEPLOYMENT.md. Copilot Studio integration notes are in COPILOT_STUDIO_INTEGRATION.md.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选