Token导航 LogoToken导航TokenDH.com
MCP Infra Scaffold logo
AI代理stdio官方级别未说明来源级核验

MCP Infra Scaffold

MCP Server

一个基于Python的MCP服务器,提供多种文件格式(CSV、Parquet、JSON、YAML、Bicep)的结构分析工具,支持AI模型交互。

工具数

6

提示词数

0

GitHub Stars

0

资源数

0
PythonClaudeAI辅助Claude DesktopClaudeVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

neilpeterson

提供方

neilpeterson

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

模板服务器-一个简单的MCP服务器

这是一个简单的模型上下文协议(MCP)服务器实现,它提供了用于处理各种文件格式的工具,包括CSV、Parquet、JSON、YAML和二头肌。该项目基于 用Python构建基本MCP服务器 辅导的。

概述

此MCP服务器提供的工具允许像Claude这样的AI模型与各种文件格式进行交互,检索其结构的摘要。服务器是使用Python和FastMCP服务器实现构建的。它使AI助手能够分析:

  • CSV和Parquet文件(行和列计数)
  • JSON结构(对象的键,数组的计数)
  • YAML配置(映射键、序列计数)
  • Azure的二头肌模板(资源、参数、变量、输出)

项目结构

/
├── main.py              # Entry point for running the server
├── server.py            # FastMCP server configuration 
├── requirements.txt     # Project dependencies
├── mcp.bicep            # Bicep template for Azure resources
├── data/                # Directory for data files
│   ├── sample.csv       # Sample CSV file for testing
│   ├── sample.parquet   # Sample Parquet file for testing
│   ├── json/            # JSON files directory
│   │   └── sample.json  # Sample JSON file for testing
│   ├── yaml/            # YAML files directory
│   │   └── sample.yaml  # Sample YAML file for testing
│   └── bicep/           # Bicep files directory
│       └── main.bicep   # Sample Bicep file for testing
├── tools/               # MCP tools implementation
│   ├── csv_tools.py     # Tools for working with CSV files
│   ├── parquet_tools.py # Tools for working with Parquet files
│   ├── json_tools.py    # Tools for working with JSON files
│   ├── yaml_tools.py    # Tools for working with YAML files
│   ├── bicep_tools.py   # Tools for working with Bicep files
│   └── file_tools.py    # Tools for reading file contents
└── utils/               # Utility functions
    └── file_reader.py   # Utilities for reading files

依赖项

此项目需要以下依赖关系:

  • Python 3.11或更高版本
  • 支持CLI的MCP库
  • Pandas用于数据操作
  • PyArrow用于Parquet文件支持
  • PyYAML支持YAML文件

所有依赖项都列在 requirements.txt 文件。

安装

  1. 克隆此存储库
  2. 导航到项目目录
  3. 使用pip安装依赖项:
pip install -r requirements.txt

虚拟环境管理

您可以使用虚拟环境来隔离项目依赖关系:

# Create a new environment
python -m venv .venv

# Activate the environment (PowerShell)
.venv/bin/Activate.ps1

# Install dependencies from requirements.txt
pip install -r requirements.txt

运行服务器

要运行MCP服务器,请执行以下操作:

python main.py

对于PowerShell用户:

python ./main.py

VS代码设置

要配置VS Code以用于此项目的开发,请执行以下操作:

  1. 为VS Code安装Python扩展
  2. 创建一个 .vscode 项目根目录下的文件夹
  3. 创建一个 settings.json 具有以下配置的文件:
{
    "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
    "python.linting.enabled": true,
    "python.linting.pylintEnabled": true,
    "python.formatting.provider": "black",
    "editor.formatOnSave": true,
    "python.analysis.extraPaths": [
        "${workspaceFolder}"
    ]
}
  1. 创建一个 launch.json 用于调试的文件:
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: MCP Server",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/main.py",
            "console": "integratedTerminal",
            "justMyCode": false,
            "env": {
                "PYTHONPATH": "${workspaceFolder}"
            }
        }
    ]
}

此设置允许您使用集成终端和调试器直接从VS Code运行和调试MCP服务器。

可用工具

CSV工具

  • summarize_csv_file:接受文件名参数并返回CSV文件结构的摘要(行数和列数)。

拼花工具

  • summarize_parquet_file:接受filename参数并返回Parquet文件结构的摘要(行数和列数)。

JSON工具

  • summarize_json_file:接受filename参数并返回JSON文件结构的摘要(对象的键,数组的计数)。

YAML工具

  • summarize_yaml_file:接受filename参数并返回YAML文件结构的摘要(映射键、序列计数)。

二头肌工具

  • summarize_bicep_file:获取文件名参数并返回二头肌文件内容的摘要(资源、参数、变量和输出的计数)。

文件读取工具

  • read_file_contents:接受filename参数并返回数据目录中任何文件的完整内容。路径可以包含子目录,例如“json/config.json”、“dimp/main.dimp”。

使用Claude Desktop进行配置

要将此MCP服务器与Claude Desktop一起使用,请将以下配置添加到您的Claude Desktop配置文件中(位于 ~/Library/Application Support/Claude/claude_desktop_config.json 在 macOS 上:

{
  "mcpServers": {
    "template_server": {
      "command": "python",
      "args": [
        "/Users/neilpeterson/Documents/code/personal-projects-and-ramp/mcp-infra-scaffold/main.py"
      ]
    }
  }
}

或者,如果您正在使用虚拟环境:

{
  "mcpServers": {
    "template_server": {
      "command": "pwsh",
      "args": [
        "-Command",
        "& {cd '/Users/neilpeterson/Documents/code/personal-projects-and-ramp/mcp-infra-scaffold'; python ./main.py}"
      ]
    }
  }
}

示例用法

一旦连接到像Claude这样的人工智能助手,您就可以使用这些工具来分析数据文件:

Please summarize the sample CSV file in the data directory.

AI将调用 summarize_csv_file 工具提供有关文件的信息。

您还可以使用其他文件类型:

Can you analyze the structure of sample.json?

AI将使用 summarize_json_file 工具提供有关JSON结构的详细信息。

What resources are defined in the Bicep template?

AI将使用 summarize_bicep_file 该工具提供有关二头肌文件(例如main.digm)中的资源、参数、变量和输出的信息。

Show me the contents of the sample.yaml file.

AI将使用 read_file_contents 显示YAML文件完整内容的工具。

扩展服务器

要添加新工具,请在 tools 目录并将其导入 main.py.使用 @mcp.tool() 装饰器将新函数注册为工具。

目录标签

目录标签

PythonClaudeAI辅助文件分析本地部署MCP协议Python工具数据格式

支持客户端

Claude DesktopClaudeVS Code

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

6

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP