Skip to main content
Glama
cegme

Emotion Dataset Analysis MCP Server

by cegme

Assignment 1.5: MCP on HiPerGator

CIS 6930 Data Engineering - Spring 2026

Overview

This repository contains starter code for the in-class MCP activity on HiPerGator. You will build an MCP server that processes the dair-ai/emotion dataset from Hugging Face.

Related MCP server: HF Dataset MCP

Setup on HiPerGator

1. Clone this repository

cd /blue/cis6930/YOUR_GATORLINK
git clone https://github.com/YOUR_USERNAME/cis6930sp26-assignment1.5.git
cd cis6930sp26-assignment1.5

2. Create environment file

cp .env.example .env
# Edit .env with your Hugging Face token

3. Install dependencies

module load mamba
uv sync
source .venv/bin/activate

Running the MCP Inspector

Using HiPerGator Desktop is much easier and avoids SSH tunneling complexity.

  1. Go to https://ondemand.rc.ufl.edu

  2. Navigate to Interactive Apps > HiPerGator Desktop

  3. Request a session (1 hour, 4 GB memory, 2 CPUs)

  4. Once the desktop launches, open a terminal

  5. Run:

    cd /blue/cis6930/YOUR_GATORLINK/cis6930sp26-assignment1.5
    module load mamba
    source .venv/bin/activate
    mcp dev server.py
  6. Open Firefox in the virtual desktop and go to http://localhost:6274

Option 2: SSH Tunneling from Your Laptop

If you prefer to use your local browser, you'll need to set up SSH tunneling.

Step 1: Start the MCP Inspector on a Compute Node

Run this command to start an interactive job with the MCP inspector:

ssh hpg "srun --partition=hpg-turin --account=cis6930 --qos=cis6930 \
    --cpus-per-task=4 --ntasks=1 --mem-per-cpu=4gb --time=1:00:00 \
    bash -c 'cd /blue/cis6930/YOUR_GATORLINK/cis6930sp26-assignment1.5 && \
    module load mamba && source .venv/bin/activate && mcp dev server.py'"

Step 2: Find Your Compute Node Name

In another terminal, find which compute node your job is running on:

squeue -u $USER

Look for the node name in the NODELIST column (e.g., c0702a-s2).

Step 3: Set Up the SSH Tunnel

The MCP Inspector runs on two ports:

  • 6274 - Web interface

  • 6277 - Proxy server

Open a new terminal on your laptop and run:

ssh -L 6274:localhost:6274 -L 6277:localhost:6277 \
    -J YOUR_GATORLINK@hpg.rc.ufl.edu YOUR_GATORLINK@COMPUTE_NODE

Example:

ssh -L 6274:localhost:6274 -L 6277:localhost:6277 \
    -J jsmith@hpg.rc.ufl.edu jsmith@c0702a-s2

The -J flag (ProxyJump) connects through the login node directly to the compute node.

Step 4: Open the Inspector

Open your browser and go to the url that was output by the the dev server. Is should look like http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=e2a71ba1e83a76dd0ea24fed08b1d62413d5837fbea81cbc41a9233ae169f989 : http://localhost:6274?MCP_PROXY_AUTH_TOKEN={CODE}

You should see the MCP Inspector interface:

MCP Inspector Interface

Passwordless SSH Login

To avoid entering your password multiple times, set up SSH keys for HiPerGator: https://docs.rc.ufl.edu/access/ssh_keys/

Troubleshooting

Problem

Solution

"Connection refused"

Ensure you're using -J (ProxyJump) and forwarding both ports (6274 and 6277)

"Address already in use"

Kill processes: `lsof -ti:6274

Host key verification failed

Add -o StrictHostKeyChecking=no to the SSH command

Page won't load

Verify mcp dev is still running on the compute node

Using the MCP Inspector

  1. Click the Tools tab in the left sidebar

  2. Select a tool from the list (e.g., get_sample)

  3. Fill in the parameter values

  4. Click Run Tool

  5. View the JSON response in the output panel

Tools to Test

Tool

Parameters

get_sample

n: 3

count_by_emotion

emotion: "joy"

search_text

query: "happy", limit: 5

analyze_emotion_distribution

(no parameters)

Dataset

The dair-ai/emotion dataset contains English Twitter messages labeled with six emotions:

Label

Emotion

0

sadness

1

joy

2

love

3

anger

4

fear

5

surprise

Submission

After completing the activity, submit to Canvas:

  1. Your outputs.txt file with tool outputs

  2. A brief reflection (2-3 sentences)

Resources

Available Tools

4 tools
analyze_emotion_distributionB

Get the distribution of emotions in the dataset.

Returns: JSON string with counts and percentages for each emotion

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description carries the full burden. It discloses the return format (JSON with counts/percentages), which adds value, but omits safety characteristics (read-only vs. destructive), performance implications for large datasets, or idempotency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two distinct sections (purpose and returns) with no wasted words. Information is front-loaded and appropriately sized for the tool's simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero parameters and the existence of an output schema (per context signals), the description adequately covers the tool's function by specifying the return structure. Minor gap regarding dataset prerequisites prevents a 5.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Zero parameters with 100% schema coverage establishes a baseline of 4. The description appropriately requires no parameter clarification since the tool operates on the implicit current dataset context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear action (Get) and resource (distribution of emotions), but fails to distinguish from sibling tool 'count_by_emotion'. Both tools appear to provide counts; the description doesn't clarify when percentages/distribution analysis is preferable to simple counting.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance provided on when to use this tool versus 'count_by_emotion' or other siblings. No prerequisites are mentioned (e.g., whether a dataset must be loaded first), leaving usage context entirely implicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

count_by_emotionA

Count samples for a specific emotion.

Args: emotion: One of 'sadness', 'joy', 'love', 'anger', 'fear', 'surprise'

Returns: JSON string with count and percentage

ParametersJSON Schema
NameRequiredDescriptionDefault
emotionYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses return format ('JSON string with count and percentage'), which adds value beyond the schema. However, it omits safety traits (read-only status), rate limits, or side effects that would help an agent understand operational risks.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Uses structured Args/Returns format that efficiently organizes information. Front-loaded with the core purpose. Slightly redundant in documenting return values when an output schema exists, but necessary given the parameter documentation burden.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter counting tool, the description is nearly complete. It documents the parameter domain and return structure. Minor gap: doesn't clarify what 'samples' refers to (text samples inferred from siblings) or whether the count is relative to total dataset (implied by 'percentage').

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Critical compensation for 0% schema description coverage: the description provides the complete enum constraint ('One of 'sadness', 'joy', 'love', 'anger', 'fear', 'surprise'') that the schema lacks. Without this, the agent would have no valid values to provide.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States specific action (Count) and resource (samples) with clear scope (for a specific emotion). Implies distinction from sibling 'analyze_emotion_distribution' by focusing on single-emotion queries, though it doesn't explicitly clarify when to choose one over the other.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides no guidance on when to use this tool versus siblings like 'analyze_emotion_distribution' or 'search_text'. No prerequisites, exclusions, or workflow context is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_sampleA

Get n random samples from the emotion dataset.

Args: n: Number of samples to retrieve (default: 5, max: 20)

Returns: JSON string with samples including text and emotion label

ParametersJSON Schema
NameRequiredDescriptionDefault
nNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and successfully discloses constraints ('max: 20') and return format ('JSON string with samples including text and emotion label'). It omits traits like idempotency or caching, but covers the essential behavioral constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Uses a clean docstring format with Args and Returns sections. Every sentence earns its place; no redundancy or fluff. The structure front-loads the core purpose before detailing parameters and returns.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a low-complexity tool with one optional parameter and an existing output schema (reducing the need for extensive return documentation), the description is nearly complete. Minor gap: lacks explicit differentiation from siblings despite having clear siblings available.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, but the description fully compensates by documenting the 'n' parameter with semantics ('Number of samples'), default value, and maximum constraint ('max: 20'), exceeding baseline expectations.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Get'), resource ('samples from the emotion dataset'), and scope ('random'), clearly distinguishing it from sibling tools like search_text (query-based) and count_by_emotion (aggregation).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying 'random samples,' which suggests when to use it (for random inspection), but lacks explicit guidance on when to choose this over search_text or other siblings, and lists no prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_textA

Search for samples containing specific text.

Args: query: Text to search for (case-insensitive) limit: Maximum results to return (default: 10)

Returns: JSON string with matching samples

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes
limitNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses case-insensitivity and that results are returned as a JSON string. However, it omits error handling behavior, what constitutes a 'sample', pagination details, or performance characteristics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Uses an efficient docstring format (Args/Returns) that front-loads the purpose statement and structures metadata clearly. Every line provides necessary information without redundancy; appropriate length for a 2-parameter tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple search tool with 2 parameters, the description adequately covers inputs and outputs. While additional domain context about 'samples' would help, the return format documentation and parameter details provide sufficient information for invocation given the low complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the Args section compensates effectively by documenting both parameters: noting the case-insensitive nature of 'query' and the default value of 'limit'. It adds semantic meaning beyond the raw schema types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb (search), resource (samples), and scope (containing specific text). While it doesn't explicitly differentiate from siblings like 'get_sample', the tool name and description make the text-search purpose distinct from the emotion analysis siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives like 'get_sample' (which likely retrieves by ID). The description provides no when-to-use or when-not-to-use conditions, prerequisites, or workflow guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • First observedanalyze_emotion_distribution
    • First observedcount_by_emotion
    • First observedget_sample
    • First observedsearch_text

TDQS

A3.6/5.0

Scored across 4 tools

Disambiguation4/5

The tools have mostly distinct purposes: analyze_emotion_distribution provides overall distribution, count_by_emotion counts specific emotions, get_sample retrieves random samples, and search_text finds text matches. However, analyze_emotion_distribution and count_by_emotion could potentially overlap in functionality since both provide emotion counts, though the former is comprehensive and the latter is specific.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern using snake_case: analyze_emotion_distribution, count_by_emotion, get_sample, and search_text. The naming is predictable and readable throughout the set.

Tool Count3/5

With 4 tools, the count is borderline for a dataset analysis server. It covers basic operations but feels thin for comprehensive analysis, lacking tools for filtering, updating, or advanced statistical analysis that might be expected in this domain.

Completeness3/5

The toolset covers core read operations (distribution analysis, counting, sampling, and searching) but has notable gaps. There are no tools for creating, updating, or deleting dataset entries, and missing advanced features like emotion trend analysis or dataset summarization limit completeness for the stated purpose.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A comprehensive Model Context Protocol (MCP) server that provides tools for interacting with the SocialData API. This server allows you to fetch Twitter/X data, monitor user activity, and analyze social media engagement programmatically.
    7
    -
  • F
    license
    A
    quality
    D
    maintenance
    An MCP server for the Hugging Face Dataset Viewer API that enables searching, fetching, and filtering datasets on the Hugging Face Hub. It allows users to explore schemas, perform full-text searches, and analyze dataset statistics through natural language.
    10
    -
  • F
    license
    C
    quality
    D
    maintenance
    This MCP server provides emotional support through a rule-based system that analyzes user messages for emotional patterns and returns structured responses with self-care suggestions. It acts as a conversational assistant with ethical limitations, avoiding clinical diagnoses while offering supportive guidance.
    1
    -