mcp-data-service

mcp-data-service

Exposes data query and auto-insights (anomaly detection) as MCP tools. Enables AI agents to query metrics, list columns, and get data insights directly from pandas.

Category
Visit Server

README

MCP Data Service · MCP 数据服务

Expose data query + auto-insights (anomaly detection) as an MCP Server — plug into Claude Desktop, Cursor, or any MCP client in 30 seconds. 把「数据查询 + 自动洞察」包装成 MCP 标准工具,Claude Desktop / Cursor 即插即用——给任意 AI Agent 装上数据能力,30 秒接入。

License: MIT Python 3.10+ CI PRs Welcome


English · 中文

English

What is this?

An MCP (Model Context Protocol) server that turns a data table into callable tools for any AI agent. No LLM API needed — everything is computed locally with pandas, so it is free and fast.

Tools

Tool What it does
query_video_stats(metric, rule, condition) Query by metric: TOP N / BOTTOM N / AVG / SUM / by date / with filter
data_insights() Auto insights: overview + anomaly detection (1.5σ) + recommendations
list_columns() List all column names and types

Quick Start

pip install -r requirements.txt

# Self-test (direct calls + MCP handshake)
python tests/test_server.py

# Run the server (stdio transport; clients below will launch it automatically)
python server.py

Connect from Claude Desktop / Cursor

Add to your MCP config (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "data-service": {
      "command": "python",
      "args": ["/absolute/path/to/mcp-data-service/server.py"]
    }
  }
}

Restart the client, then ask your agent: "What's the video with the highest completion rate?" or "Run auto insights on the data."

Project Layout

server.py          FastMCP server (@mcp.tool registers 3 tools)
data/video_stats.csv   Sample data
tests/test_server.py   Direct-call + MCP-stdio handshake tests
requirements.txt   fastmcp + pandas

Tests

python tests/test_server.py
# [PASS] query_video_stats direct calls
# [PASS] data_insights auto insights
# [PASS] MCP stdio handshake: list_tools + call_tool

Roadmap

  • [ ] Publish to PyPI (pipx install mcp-data-service)
  • [ ] SQLite / PostgreSQL backend
  • [ ] Multiple data sources per server

⬆ Back to top


中文

这是什么?

一个 MCP(Model Context Protocol) Server:把一张数据表变成任何 AI Agent 可调用的工具。完全不依赖 LLM API——全部用 pandas 本地计算,免费且快速。

工具清单

工具 作用
query_video_stats(metric, rule, condition) 按指标查询:TOP N / BOTTOM N / 平均值 / 总和 / 按日期 / 带条件过滤
data_insights() 自动洞察:数据总览 + 异常下探(1.5σ)+ 运营建议
list_columns() 列出全部列名与类型

快速开始

pip install -r requirements.txt

# 自测(直接调用 + MCP 握手)
python tests/test_server.py

# 启动(stdio 传输,客户端按下面配置自动拉起)
python server.py

接入 Claude Desktop / Cursor

在客户端 MCP 配置(如 claude_desktop_config.json)里加:

{
  "mcpServers": {
    "data-service": {
      "command": "python",
      "args": ["/绝对路径/mcp-data-service/server.py"]
    }
  }
}

保存并重启客户端,即可让 Agent 直接调用「完播率最高的视频」「自动洞察数据异常」等能力。

文件结构

server.py          FastMCP Server(@mcp.tool 注册 3 个工具)
data/video_stats.csv   示例数据
tests/test_server.py   直调 + MCP stdio 握手双测试
requirements.txt   fastmcp + pandas

测试

python tests/test_server.py
# [PASS] query_video_stats 直接调用
# [PASS] data_insights 自动洞察
# [PASS] MCP stdio 握手:list_tools + call_tool

开发计划

  • [ ] 发布 PyPI(pipx install mcp-data-service)
  • [ ] SQLite / PostgreSQL 后端
  • [ ] 单个 Server 支持多个数据源

⬆ 返回顶部


License · 许可证

MIT © lengzhanbao

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured