A newer version of the Gradio SDK is available:
5.42.0
metadata
title: Text Analysis MCP Server
emoji: π
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit
Text Analysis MCP Server
A simple text analysis tool that can also function as a Model Context Protocol (MCP) server.
Features
- Letter Counter: Count how many times a specific letter appears in text
- Text Statistics: Get comprehensive statistics about text (word count, character count, etc.)
- MCP Server: Provides these functions via MCP protocol for use with AI agents
Usage
Web Interface
Simply use the interface above to analyze text.
As MCP Server
This app also runs as an MCP server that can be used with MCP-compatible clients.
MCP Endpoint: https://your-username-your-space-name.hf.space/gradio_api/mcp/sse
Available Functions:
letter_counter(word: str, letter: str) -> int
word_stats(text: str) -> dict
Example MCP Client Configuration:
{
"model": "your-model",
"provider": "your-provider",
"servers": [
{
"type": "sse",
"config": {
"url": "https://your-username-your-space-name.hf.space/gradio_api/mcp/sse"
}
}
]
}
Local Development
pip install -r requirements.txt
python app.py
License
MIT License