home / mcp / text classification mcp server (model2vec)
Provides fast text classification using Model2Vec embeddings with multiple transports, category management, and batch processing.
Configuration
View docs{
"mcpServers": {
"baobab-tech-mcp-text-classifier": {
"url": "http://localhost:8000/sse"
}
}
}You can classify text using a dedicated MCP server that provides fast, context-aware embeddings from Model2Vec. It supports both local stdio and remote HTTP/SSE transports, lets you manage categories (including custom ones), and returns confidence scores to help you interpret results. This guide shows practical ways to run and use the server, configure clients, and perform common classification tasks.
Connect to the Text Classification MCP Server using your MCP client to perform single or batch classifications. You can classify texts locally in your IDE or script, or expose the server over HTTP for remote clients. Use the builtβin resources to inspect available categories and model information, and use the prompt templates to standardize classification prompts.
Prerequisites include Python 3.10 or newer and either uv (the MCP runner) or pip for dependency installation.
# Install dependencies
pip install -r requirements.txt
# Or install and run via uv if you use the MCP workflow
uv syncChoose your transport based on how you want to consume the service. For local integration or development, run via stdio. For remote or multi-client access, run via HTTP with SSE.
# Run with stdio (local) using the default script
python text_classifier_server.py
# Or explicitly request stdio mode
python text_classifier_server.py --stdio# Run with HTTP transport on localhost using default port 8000
python text_classifier_server.py --http
# Run on a custom port
python text_classifier_server.py --http 9000
# Alternatively, use a convenience script if provided
./start_server.sh http 8000If you prefer an explicit HTTP runner, you can start the server with the HTTP transport and then connect your MCP client to the SSE endpoint.
# Example with explicit HTTP runner options
python run_http_server.py --transport http --host 127.0.0.1 --port 8000 --debugConfigure the server for your client environment as needed. The server supports both stdio and HTTP transports, and you can tailor how you start it depending on your workplace tooling.
If you run into issues, check server status, verify ports, and review logs for error details. Common checks include ensuring the chosen port is not in use and that the required Python version is installed.
# Check if a port is in use (example port 8000)
lsof -i :8000
# Start on a different port if needed
python text_classifier_server.py --http 9000The server provides tools to classify text, manage categories, and query model information. You can classify a single string or batches of texts, and you can add or remove custom categories as your classification needs evolve.
Classify a single text into predefined categories with confidence scores.
Classify multiple texts simultaneously for efficient processing.
Add a new custom category for classification.
Add multiple custom categories in a single operation.
List all available categories and their descriptions.
Remove one or multiple categories from the classification system.
Access category list programmatically.
Get information about the loaded Model2Vec model and system status.
Template for text classification tasks with context and instructions.