PD

privetin/dataset-viewer

开发工具

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

31 stars 10 forks 质量 59 趋势 11MIT

Hugging Face数据集查看器的MCP服务器

概览

一个MCP服务器,用于与Hugging Face数据集查看器API交互,提供浏览和分析托管在Hugging Face Hub上的数据集的功能。 - 使用 dataset:// URI 方案访问 Hugging Face 数据集 - 支持数据集配置和拆分 - 提供分页访问数据集内容 - 处理私有数据集的认证 - 支持搜索和过滤数据集内容 - 提供数据集统计和分析 服务器提供以下工具: 1. - 检查数据集是否存在且可访问 - 参数:- 数据集标识符(如“stanfordnlp/imdb”) - auth_token(可选):针对私有数据集 2. - 获取数据集的详细信息 - 参数:- 数据集:数据集标识符 - auth_token(可选):针对私有数据集 3.

概述(AI 翻译)

一个MCP服务器,用于与Hugging Face数据集查看器API交互,提供浏览和分析托管在Hugging Face Hub上的数据集的功能。

特色

资源

  • 使用 dataset:// URI 方案访问 Hugging Face 数据集
  • 支持数据集配置和拆分
  • 提供分页访问数据集内容
  • 处理私有数据集的认证
  • 支持搜索和筛选数据集内容
  • 提供数据集统计和分析

工具

服务器提供以下工具:

  1. 验证
  • 检查数据集是否存在且可访问
  • 参数:
  • dataset:数据集标识符(例如 ‘stanfordnlp/imdb’)
  • auth_token(可选):针对私有数据集
  1. get_info
  • 获取数据集的详细信息
  • 参数:
  • dataset:数据集标识符
  • auth_token(可选):用于私有数据集
  1. get_rows
  • 获取数据集的分页内容
  • 参数:
  • dataset:数据集标识符
  • config:配置名称
  • split:拆分名称
  • page(可选):页码(基于0)
  • auth_token(可选):用于私有数据集
  1. get_first_rows
  • 从数据集拆分中获取首行

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

README

以下为原文 README 节选,完整内容请查看原文。

Dataset Viewer MCP Server

An MCP server for interacting with the Hugging Face Dataset Viewer API, providing capabilities to browse and analyze datasets hosted on the Hugging Face Hub.

Features

Resources

  • Uses dataset:// URI scheme for accessing Hugging Face datasets
  • Supports dataset configurations and splits
  • Provides paginated access to dataset contents
  • Handles authentication for private datasets
  • Supports searching and filtering dataset contents
  • Provides dataset statistics and analysis

Tools

The server provides the following tools:

  1. validate

    • Check if a dataset exists and is accessible
    • Parameters:
      • dataset: Dataset identifier (e.g. ‘stanfordnlp/imdb’)
      • auth_token (optional): For private datasets
  2. get_info

    • Get detailed information about a dataset
    • Parameters:
      • dataset: Dataset identifier
      • auth_token (optional): For private datasets
  3. get_rows

    • Get paginated contents of a dataset
    • Parameters:
      • dataset: Dataset identifier
      • config: Configuration name
      • split: Split name
      • page (optional): Page number (0-based)
      • auth_token (optional): For private datasets
  4. get_first_rows

    • Get first rows from a dataset split
    • Parameters:
      • dataset: Dataset identifier
      • config: Configuration name
      • split: Split name
      • auth_token (optional): For private datasets
  5. get_statistics

    • Get statistics about a dataset split
    • Parameters:
      • dataset: Dataset identifier
      • config: Configuration name
      • split: Split name
      • auth_token (optional): For private datasets
  6. search_dataset

    • Search for text within a dataset
    • Parameters:
      • dataset: Dataset identifier
      • config: Configuration name
      • split: Split name
      • query: Text to search for
      • auth_token (optional): For private datasets
  7. filter

    • Filter rows using SQL-like conditions
    • Parameters:
      • dataset: Dataset identifier
      • config: Configuration name
      • split: Split name
      • where: SQL WHERE clause (e.g. “score > 0.5”)
      • orderby (optional): SQL ORDER BY clause
      • page (optional): Page number (0-based)
      • auth_token (optional): For private datasets
  8. get_parquet

    • Download entire dataset in Parquet format
    • Parameters:
      • dataset: Dataset identifier
      • auth_token (optional): For private datasets

Installation

Prerequisites

  • Python 3.12 or higher
  • uv - Fast Python package installer and resolver

Setup

  1. Clone the repository:
git clone https://github.com/privetin/dataset-viewer.git
cd dataset-viewer
  1. Create a virtual environment and install:
# Create virtual environment
uv venv

# Activate virtual environment
# On Unix:
source .venv/bin/activate
# On Windows:
在 GitHub 查看完整 README

安装

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

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

配置

{ "mcpServers": { "dataset-viewer": { "command": "uv", "args": [ "--directory", "parent_to_repo/dataset-viewer", "run", "dataset-viewer" ] } } }