Provides a sentiment analysis tool based on the Hugging Face MCP Course, offering polarity scoring, subjectivity assessment, and overall sentiment classification (positive, negative, or neutral) for text inputs.
Model Context Protocol (MCP) Test Lab
This project demonstrates the use of Model Context Protocol (MCP) and how it works with langgraph
to build an agent. There are two parts to this project.
The first demonstrates the use of MCP for sentiment analysis and is based on the Hugging Face MCP Course. Instead of using the gradio
library in the HuggingFace course, this project utilizes the fastmcp
library to implement an MCP server and client.
The second part implements an MCP agent that connects to various tools, including mathematical operations and sentiment analysis capabilities, allowing for a more complex AI assistant. This part makes use of the langgraph
library to create an agent that can interact with these tools.
Overview
This project demonstrates different implementations of the Model Context Protocol (MCP) with a focus on sentiment analysis and agent capabilities:
- mcp-sentiment/: Contains the MCP server implementation (app_fastmcp.py) and various client implementations using different transport protocols (stdio, SSE, and streamable-http) for sentiment analysis. See mcp-sentiment/README.md for more details.
- mcp-agent/: Implements agent functionality with specialized tools for mathematical operations and sentiment analysis, along with a client to interact with these agent capabilities. See mcp-agent/README.md for more details.
- tests/: Comprehensive test suite validating all components of the system, including client implementations across different transport protocols, agent functionality, math tools, and sentiment analysis capabilities.
Codebase Directory Structure
Setup Instructions
To set up the project, follow these steps:
- Clone the repository:
- Create a virtual environment:
- Install system dependencies (if needed):
- For macOS, you may need to install Graphviz:
- For Linux, you can install Graphviz using your package manager, e.g.:
- setup environment variables for CFLAGS and LDFLAGS:
- For macOS, you may need to install Graphviz:
- Install the required packages:
Unit Tests
Unit tests are provided to ensure the functionality of the MCP server and client. To run the tests, use the following command:
Sample output:
This server cannot be installed
This server implements the Model Context Protocol to provide sentiment analysis of text, returning polarity, subjectivity, and overall assessment (positive, negative, or neutral).
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides tools for analyzing text documents, including counting words and characters. This server helps LLMs perform text analysis tasks by exposing simple document statistics functionality.Last updated -161610JavaScriptApache 2.0
- AsecurityAlicenseAqualityThis server implements the Model Context Protocol to facilitate meaningful interaction and understanding development between humans and AI through structured tools and progressive interaction patterns.Last updated -1351MIT License
- -securityAlicense-qualityProvides advanced analytical, research, and natural language processing capabilities through a Model Context Protocol server, enabling dataset analysis, decision analysis, and enhanced NLP features like entity recognition and fact extraction.Last updated -2TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables users to query, retrieve details, and manage reviews/ratings for NetMind AI servers through simple endpoints.Last updated -PythonMIT License