MCP ExplorerExplorer

Mcp Sentiment

@japharion 5 days ago
2 MIT
FreeCommunity
AI Systems
MCP Sentiment is a sentiment analysis tool using Gradio and TextBlob, deployable on Hugging Face Spaces.

Overview

What is Mcp Sentiment

MCP Sentiment Analysis is a tool that leverages the Model Context Protocol (MCP) to perform sentiment analysis using the TextBlob library. It provides a web interface and an MCP server for applications requiring sentiment evaluation of text input.

Use cases

This sentiment analysis tool can be used in various applications, such as sentiment classification for customer feedback, social media monitoring, and natural language processing projects where understanding the emotional tone of text is essential.

How to use

To use the MCP Sentiment Analysis tool, set up a Python environment, install dependencies from requirements.txt, and run the app locally. You can interact with the system via a web interface or use client examples provided for Python and JavaScript to integrate the sentiment analysis functionality into your applications.

Key features

Key features include simple integration with TextBlob for sentiment analysis, an exposed MCP server via Gradio for easy interaction, client examples in both Python and JavaScript, and readiness for deployment on Hugging Face Spaces.

Where to use

MCP Sentiment Analysis can be utilized in settings such as web applications, data analysis projects, and conversational agents, particularly where analyzing the sentiment of user-generated content or communications is beneficial.

Content


title: Mcp Sentiment
emoji: 📚
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: 5.31.0
app_file: app.py
pinned: false

MCP Sentiment Analysis

Screenshot

This project demonstrates an end-to-end Model Context Protocol (MCP) sentiment analysis tool using Gradio and TextBlob, deployable to Hugging Face Spaces.

Features

  • Sentiment analysis using TextBlob
  • Exposed as an MCP server (Gradio)
  • Python and JavaScript client examples
  • Ready for Hugging Face Spaces deployment

Quickstart

1. Setup

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

2. Run Locally

python app.py

3. Example Client Usage

Python

from smolagents import ToolCollection, CodeAgent
from mcp.client.sse import SSEServerParameters

server_params = SSEServerParameters(url="http://localhost:7860/gradio_api/mcp/sse")
with ToolCollection.from_mcp(server_params, trust_remote_code=True) as tools:
    agent = CodeAgent(tools=[*tools.tools])
    agent.run("What is the sentiment of 'I love working with MCP!'?")

JavaScript

const response = await mcpClient.call("sentiment_analysis", {
  text: "MCP is amazing!",
});
console.log(response);

Deployment

See mcp.md for full instructions, including Hugging Face Spaces deployment and advanced configuration.


Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

Tools

No tools

Comments