FM

felipevandevelde/mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

0 stars 0 forks 质量 45 趋势 0

A FastMCP 3.0 server exposing data-processing tools, resources, and prompts over HTTP.

概览

A FastMCP 3.0 server exposing data-processing tools, resources, and prompts over HTTP.

README

Data Processing MCP Server

A FastMCP 3.0 server exposing data-processing tools, resources, and prompts over HTTP.


Quick Start

1. Install dependencies

pip install -r requirements.txt

2. Run the server

# Simple one-liner (stdio→http)
python server.py

# Or via the FastMCP CLI
fastmcp run server.py:mcp --transport http --port 8000

The server starts at http://localhost:8000/mcp


Tools

CSV

Tool Description
parse_csv Parse CSV text → list of dicts
summarise_csv Descriptive statistics for every numeric column
filter_csv_rows Return rows where column == value
csv_to_json Convert CSV → JSON array string

JSON

Tool Description
flatten_json Flatten nested JSON with dot-notation keys
json_to_csv Convert a JSON array of objects → CSV
extract_json_keys List every unique key path in a JSON document

Text

Tool Description
word_frequency Top-N word counts in plain text
text_statistics Characters, words, sentences, paragraphs
find_and_replace Find & replace with an optional case-insensitive mode

Numeric

Tool Description
compute_stats Min, max, mean, median, stdev, variance for a list of numbers

Resources

URI Description
info://server Server metadata and capability map
examples://csv Ready-to-use sample CSV string
examples://json Ready-to-use sample nested JSON

Prompts

Name Description
analyse_dataset Full end-to-end analysis workflow for any dataset
clean_and_convert Data cleaning + format conversion workflow

Endpoints

Path Method Description
/mcp POST/GET MCP protocol (StreamableHTTP)
/health GET Health check (always unauthenticated)

Production (Uvicorn + multiple workers)

# stateless_http=True is required for multi-worker setups
FASTMCP_STATELESS_HTTP=true uvicorn server:mcp.http_app() \
  --host 0.0.0.0 --port 8000 --workers 4

Or create app.py:

from server import mcp
app = mcp.http_app(stateless_http=True)   # for multi-worker deployments

Then:

uvicorn app:app --host 0.0.0.0 --port 8000 --workers 4

Connect from a client

import asyncio
from fastmcp import Client

client = Client("http://localhost:8000/mcp")

async def main():
    async with client:
        result = await client.call_tool("summarise_csv", {
            "csv_text": "name,score\nAlice,88\nBob,72\nCarol,95"
        })
        print(result)

asyncio.run(main())

Install into Claude Desktop

fastmcp install server.py:mcp --name "Data Processing Server"
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →