The Dataset Viewer MCP Server provides a convenient way to interact with the Hugging Face Dataset Viewer API, allowing you to browse, search, and analyze datasets hosted on the Hugging Face Hub directly through MCP protocol integration.
dataset://
URI scheme for accessing Hugging Face datasetsThe server comes with several useful tools:
Clone the repository:
git clone https://github.com/privetin/dataset-viewer.git
cd dataset-viewer
Create and activate a virtual environment:
# Create virtual environment
uv venv
# Activate on Unix/MacOS
source .venv/bin/activate
# Activate on Windows
.venv\Scripts\activate
Install the package:
uv add -e .
For accessing private datasets, set your Hugging Face API token:
# On Unix/MacOS
export HUGGINGFACE_TOKEN=your_token_here
# On Windows
set HUGGINGFACE_TOKEN=your_token_here
To use the Dataset Viewer MCP Server with Claude Desktop, add the following to your Claude Desktop configuration file:
Windows location: %APPDATA%\Claude\claude_desktop_config.json
MacOS location: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"dataset-viewer": {
"command": "uv",
"args": [
"--directory",
"parent_to_repo/dataset-viewer",
"run",
"dataset-viewer"
]
}
}
}
validate(dataset="stanfordnlp/imdb")
get_info(dataset="stanfordnlp/imdb")
get_rows(dataset="stanfordnlp/imdb", config="plain_text", split="train", page=0)
search_dataset(dataset="stanfordnlp/imdb", config="plain_text", split="train", query="excellent movie")
filter(
dataset="stanfordnlp/imdb",
config="plain_text",
split="train",
where="label > 0",
orderby="label DESC"
)
For private datasets, include the auth_token
parameter in your tool calls:
get_info(dataset="your-org/private-dataset", auth_token="YOUR_HF_TOKEN")
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "dataset-viewer" '{"command":"uv","args":["--directory","parent_to_repo/dataset-viewer","run","dataset-viewer"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"dataset-viewer": {
"command": "uv",
"args": [
"--directory",
"parent_to_repo/dataset-viewer",
"run",
"dataset-viewer"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"dataset-viewer": {
"command": "uv",
"args": [
"--directory",
"parent_to_repo/dataset-viewer",
"run",
"dataset-viewer"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect