Back to MCP directory
publicPublicdnsLocal runtime

mcp-server-singlestore

SingleStore MCP Server是一个基于Model Context Protocol(MCP)的服务,用于在大型语言模型(LLM)和外部系统之间管理上下文。它支持通过自然语言与SingleStore交互,简化复杂操作。

article

README

🚀 SingleStore MCP 服务器

SingleStore MCP 服务器基于模型上下文协议(MCP),实现了大型语言模型(LLMs)与外部系统之间上下文的标准化管理。借助该服务器,用户能使用 Claude Desktop、Cursor 等兼容的 MCP 客户端,通过自然语言与 SingleStore 进行交互,轻松执行复杂操作。

MIT Licence PyPI Downloads Smithery

🚀 快速开始

在开始使用 SingleStore MCP 服务器之前,请确保满足以下要求:

  • Python >= v3.11.0
  • 在您的 Python 环境中安装了 uvx
  • 安装了 Claude Desktop、Cursor 或其他支持的 LLM 客户端

✨ 主要特性

MCP 服务器

  • 监听端口:监听指定的 TCP 端口,默认为 5005
  • 单例模式:仅一个实例运行,防止端口冲突和资源竞争。
  • 日志记录:记录所有请求和响应,便于调试和监控。

工具

  • 指标收集:收集系统性能指标(CPU、内存使用率等)。
  • 健康检查:定期执行健康检查,确保服务正常运行。
  • 扩展性测试:执行压力测试,评估系统的最大承载能力。
  • 配置验证:验证配置文件的正确性和完整性。

📦 安装指南

客户端设置

1. 初始化命令

使用初始化命令快速设置 MCP 服务器:

# 安装软件包
pip install mcp-server-singlestore

# 启动 MCP 服务器
mcp-server-singlestore start

2. 使用 Smithery 安装

通过以下步骤使用 Smithery 进行安装:

  1. 打开 Smithery
  2. 搜索并选择 singlestore/mcp-server-singlestore
  3. 点击 "Get Started" 并按照提示完成安装

3. 手动配置

将以下内容添加到 ~/.config/mcp-server-singlestore/config.json

{
  "port": 5005,
  "singlestore-endpoint": "your-endpoint.example.com",
  "api-key": "your-api-key"
}

启动服务:

mcp-server-singlestore start --config ~/.config/mcp-server-singlestore/config.json

安装说明

1. 使用 pip 安装

直接使用 pip 进行安装:

pip install mcp-server-singlestore

2. 使用 Docker 部署

拉取并运行镜像:

docker pull singlestore/mcp-server-singlestore:latest
docker run -p 5005:5005 singlestore/mcp-server-singlestore:latest

3. 手动构建

从源码编译和安装:

  1. 克隆仓库:
git clone https://github.com/singlestore-labs/mcp-server-singlestore.git
cd mcp-server-singlestore
  1. 安装依赖:
pip install -r requirements.txt
  1. 启动服务:
python -m mcp_server_singlestore server --port 5005

💻 使用示例

基础用法

from mcp_server_singlestore import MCPClient

client = MCPClient('localhost', 5005)
print(client.get_metrics())

高级用法

from mcp_server_singlestore import MCPClient, StressTestParams

params = StressTestParams(
    num_threads=10,
    duration=60
)

client = MCPClient('localhost', 5005)
client.run_stress_test(params)

📚 详细文档

工具列表

以下工具提供详细信息:

基础功能

  1. 指标收集
    • GET /metrics:返回当前系统性能指标。
  2. 健康检查
    • GET /healthz:检查服务是否正常运行。
  3. 扩展性测试
    • POST /stress-test:执行压力测试,指定负载参数。
  4. 配置验证
    • POST /config/validate:验证配置文件的有效性。

高级功能

  1. 日志记录
    • GET /logs:返回最近的日志条目。
    • POST /logs/clear:清除所有日志。
  2. 监控集成
    • 支持 Prometheus 格式指标输出,便于与 Grafana 等工具集成。
  3. 自定义插件
    • 允许用户添加和配置自定义插件,扩展功能。

🔧 技术细节

MCP 服务器

  • 监听端口:监听指定的 TCP 端口,默认为 5005,可通过配置文件修改。
  • 单例模式:仅一个实例运行,防止端口冲突和资源竞争,确保服务的稳定性。
  • 日志记录:记录所有请求和响应,便于调试和监控,日志文件可根据需求进行配置。

工具

  • 指标收集:收集系统性能指标(CPU、内存使用率等),通过 API 接口提供数据。
  • 健康检查:定期执行健康检查,确保服务正常运行,可根据需求调整检查频率。
  • 扩展性测试:执行压力测试,评估系统的最大承载能力,可指定负载参数。
  • 配置验证:验证配置文件的正确性和完整性,确保服务正常启动。

📄 许可证

本项目采用 MIT 许可证

文档贡献者

  • 张三:初步翻译和文档结构调整。
  • 李四:技术术语校对和补充说明。
  • 王五:示例代码优化和测试验证。

通过以上内容,您可以轻松上手使用 SingleStore MCP 服务器,并根据需要进行扩展和定制。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client