MCP server exposing SQLite database querying over SSE for natural-language SQL

MCP server exposing SQLite database querying over SSE for natural-language SQL

mcp_host_client_server_sse•byhanshan006

A client-server system built on the MCP protocol where an MCP server queries a SQLite database and communicates with a host over Server-Sent Events, with OpenAI translating natural language into SQL.

License: MIT•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Implements an MCP server-client architecture with an MCP server, client, and host program integrating OpenAI.
  • •Uses Server-Sent Events (SSE) for real-time communication between the MCP host and server.
  • •Integrates a SQLite database with users and orders tables.
  • •Converts natural language questions into SQL queries using an LLM such as OpenAI.

BEST FOR

  • •Answering natural-language questions against a SQLite database of users and orders.
  • •Aggregating and filtering data such as total spending per user or large orders.

ABOUT MCP_HOST_CLIENT_SERVER_SSE

MCP server exposing SQLite database querying over SSE for natural-language SQL is cataloged as an MCP server attributed to hanshan006. A client-server system built on the MCP protocol where an MCP server queries a SQLite database and communicates with a host over Server-Sent Events, with OpenAI translating natural language into SQL. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP server exposing SQLite database querying over SSE for natural-language SQL are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How does a natural-language question become a database answer?

The user's question is sent to the MCP Host, which calls OpenAI to produce a SQL query, forwards it as an MCP request to the MCP Server, which queries the SQLite database and returns results over SSE for natural-language explanation.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 7aca45c88547 · 采集于 2026-11-13 10:38:26 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

MCP Host Client Server SSE

基于MCP(Model Context Protocol)协议实现的自然语言SQL数据库查询系统,支持通过大语言模型将自然语言转换为SQL查询。本项目展示了如何使用MCP协议构建服务器-客户端架构,并集成OpenAI实现智能查询功能。

功能特点

  • 🚀 基于MCP协议的服务器-客户端架构
  • 📝 支持自然语言转SQL查询
  • 🔄 使用SSE(Server-Sent Events)实现实时通信
  • 📊 SQLite数据库集成
  • 🤖 OpenAI/DeepSeek接口集成
  • 📝 完整的日志记录系统
  • ⚡ 异步操作支持

系统架构

graph TD
    A[用户] -->|自然语言问题| B[MCP Host]
    B -->|API调用| C[OpenAI]
    C -->|SQL查询| B
    B -->|MCP请求| D[MCP Server]
    D -->|查询| E[SQLite DB]
    E -->|结果| D
    D -->|SSE响应| B
    B -->|自然语言解释| A

快速开始

前置要求

  • Python 3.8+
  • pip包管理器
  • OpenAI API密钥

安装步骤

  1. 克隆仓库:
git clone https://github.com/HanShan006/MCP_Host_Client_Server_SSE.git
cd MCP_Host_Client_Server_SSE
  1. 安装依赖:
pip install openai mcp-framework starlette uvicorn
  1. 配置API密钥: 创建config.ini文件并添加以下内容:
[secrets]
API_KEY=your_api_key_here
  1. 创建示例数据库:
python create_database.py

运行服务

  1. 启动MCP服务器:
python mcp_server.py
  1. 运行客户端应用:
python mcp_host.py

数据库结构

users表

字段类型说明
idINTEGER用户ID(主键)
nameTEXT用户名
ageINTEGER年龄
emailTEXT邮箱地址

orders表

字段类型说明
idINTEGER订单ID(主键)
user_idINTEGER用户ID(外键)
product_nameTEXT商品名称
priceREAL价格
order_dateTEXT订单日期

示例查询

系统支持多种自然语言查询,例如:

  1. "查询所有用户的信息"
  2. "显示张三的所有订单"
  3. "统计每个用户的消费总额"
  4. "查询订单金额超过5000元的用户信息"

项目结构

MCP_Host_Client_Server_SSE/
├── mcp_server.py      # MCP服务器实现
├── mcp_client.py      # MCP客户端实现
├── mcp_host.py        # 主机程序(集成OpenAI)
├── create_database.py # 数据库初始化脚本
├── database.db        # SQLite数据库文件
├── config.ini         # 配置文件
└── README.md          # 项目文档

技术栈

  • Python 3.8+
  • MCP Framework
  • SQLite
  • OpenAI API
  • Starlette
  • Server-Sent Events (SSE)
  • Async/Await

版本历史

v1.0.0 (2025-05-07)

  • ✨ 初始版本发布
  • 🎉 实现基础MCP服务器功能
  • 🎉 完成客户端通信模块
  • 🎉 集成OpenAI自然语言处理
  • 🎉 添加SQLite数据库支持
  • 📝 完善项目文档

贡献者

开源协议

本项目采用 MIT 协议开源,详情请参见 LICENSE 文件。

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP server exposing SQLite database querying over SSE for natural-language SQL from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp_host_client_server_sse)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage