--- license: apache-2.0 title: Text Processing MCP Server sdk: gradio emoji: 📚 colorFrom: green colorTo: green short_description: Text Processo --- # Text Processing MCP Server A Gradio-based MCP (Model Context Protocol) server that provides various text processing tools. ## Features This server provides the following text processing tools: - **Letter Counter**: Count occurrences of a specific letter in text - **Text Length Calculator**: Calculate the number of characters in text - **Text Reverser**: Reverse the input text - **Word Counter**: Count the number of words in text - **Text to Uppercase**: Convert text to uppercase - **Text to Lowercase**: Convert text to lowercase ## Usage ### Web Interface Visit the Gradio interface to use the tools directly in your browser. ### MCP Integration This server can be connected to MCP clients. The MCP endpoint is available at: - **Streamable HTTP URL**: `https://your-space-name.hf.space/gradio_api/mcp/` - **SSE URL (deprecated)**: `https://your-space-name.hf.space/gradio_api/mcp/sse` ### Connecting to MCP Clients #### Cursor IDE Add this configuration to your Cursor MCP settings: ```json { "mcpServers": { "text-processing": { "command": "npx", "args": [ "-y", "mcp-remote", "https://your-space-name.hf.space/gradio_api/mcp/", "--transport", "sse-only" ] } } } ``` #### Claude Desktop Similar configuration can be used for Claude Desktop application. ## Local Development To run locally: 1. Install dependencies: ```bash pip install gradio[mcp] ``` 2. Run the server: ```bash python app.py ``` 3. Access the interface at `http://localhost:7860` 4. MCP endpoint will be available at `http://localhost:7860/gradio_api/mcp/` ## MCP Tools Available The server exposes the following MCP tools: - `letter_counter(word: str, letter: str) -> int` - `word_length_calculator(text: str) -> int` - `text_reverser(text: str) -> str` - `word_counter(text: str) -> int` - `text_to_uppercase(text: str) -> str` - `text_to_lowercase(text: str) -> str` Each tool includes proper type hints and documentation for seamless MCP integration.