TextLite MCP Server
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TextLite MCP Server deduplicate these customer reviews and cluster similar ones"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TextLite MCP Server (FastMCP)
A runnable FastMCP server wrapping the public TextLite Python API, plus two helpful embedding-based tools. Use it locally via stdio or deploy it via Streamable HTTP to publish in the official MCP Registry.
Status: Working source distribution with test coverage and a Docker deployment template. You must install the dependencies and download the NLP models to run actual inference. The code has not been published to PyPI or the MCP Registry and no hosted endpoint is provided.
Quick start (Python 3.11+)
Requires Python 3.11+, Git, an internet connection for installation and first model download, and sufficient memory to load PyTorch/Sentence Transformer models.
unzip textlite-mcp.zip
cd textlite-mcp
python3.11 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
python -m pip install --upgrade pip
python -m pip install -e '.[dev]'
python -m pytest -q
python examples/client_example.py # connects in-process and calls toolsThe first real NLP tool call downloads a model from Hugging Face. server_info loads no model. This project explicitly installs TextLite from git+https://github.com/meru-research/textlite.git@main, because the inspected upstream pyproject.toml has no declared runtime dependencies. Our pyproject.toml declares those runtime dependencies separately.
Start as a local MCP server
textlite-mcp --transport stdio
# or
python -m textlite_mcp.server --transport stdioThe process is deliberately silent: the stdio stream is reserved for MCP messages. Add it to an MCP client (see below) instead of typing JSON at the terminal.
Connect from Claude Desktop
Edit Claude Desktop's claude_desktop_config.json (~/Library/Application Support/Claude/claude_desktop_config.json on macOS; %APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"textlite": {
"command": "/ABSOLUTE/PATH/textlite-mcp/.venv/bin/python",
"args": ["-m", "textlite_mcp.server", "--transport", "stdio"]
}
}
}On Windows, substitute C:\\path\\textlite-mcp\\.venv\\Scripts\\python.exe for command. Merge the textlite entry into any existing mcpServers instead of replacing other servers. Restart your MCP client after changing configuration.
Start as an HTTP server
textlite-mcp --transport http --host 127.0.0.1 --port 8000
# MCP endpoint: http://127.0.0.1:8000/mcpIn a second terminal:
python examples/client_example.py http://127.0.0.1:8000/mcpAn MCP endpoint is not a normal REST API: use an MCP client/Inspector, not a plain browser GET request, to test the protocol.
Test a local server (scripts)
examples/textlite_client.py wraps the tools in an async TextLiteClient (one method per tool, plus compress_text / compress_file, which split long text into paragraphs and compress it in batches when it exceeds the server's input limits). server can be inprocess, stdio, http ($TEXTLITE_MCP_URL, default http://127.0.0.1:8000/mcp) or a full MCP URL.
# Every tool once against a running HTTP server (exit code 1 on failure)
python examples/smoke_local_server.py --server http
# Compression examples on examples/test_compression.txt (or --file your.txt)
python examples/compression_example.py --server http --budgets 80 150 300 \
--query "How does battery storage help solar power?"from textlite_client import TextLiteClient, format_compression_report
async with TextLiteClient("http") as tl: # top-level await works in Jupyter
result = await tl.compress_file("examples/test_compression.txt", num_tokens=150)
print(format_compression_report(result))Token counts in the reports use TextLite's approximate count (\w+ words plus punctuation), not an LLM tokenizer.
Related MCP server: MCP Knowledge Base Server
Available tools
MCP tool | Main arguments | Result |
| none | Model names, server version and input limits |
|
|
|
|
| List of clusters: label, members, representative, cohesion |
|
| Representative contexts, approximately token-budgeted |
|
| Query-relevant extracted contexts |
|
| Cosine similarity score between -1 and 1 |
|
| Ranked matches with original cleaned indices and cosine scores |
|
| Extractive summary string |
|
| Extractive summary per paragraph |
|
| Cross-encoder ranked passages (not scores) |
|
| Keyphrases with score and occurrences |
|
| Annotation-style tags |
|
| Topics with labels, keyphrases and scores |
|
| Topics with lexically matched entities |
semantic_similarity and semantic_search are additional wrappers using TextLite's SentenceTransformerEmbedder; the other tools wrap TextLite's public functions. This is extractive summarization: it selects phrases/sentences from input rather than generating new prose.
Sample use from Python (through MCP)
import asyncio
from fastmcp import Client
from textlite_mcp.server import mcp
async def demo():
async with Client(mcp) as client:
result = await client.call_tool("semantic_search", {
"query": "Neural search and embeddings",
"texts": [
"Sentence transformers encode meaning.",
"A recipe for chocolate brownies.",
"Vector databases store embeddings."
],
"top_k": 2
})
print(result.data)
asyncio.run(demo())Docker deployment
docker compose up --build -d
python examples/client_example.py http://127.0.0.1:8000/mcpDocker Compose exposes port 8000 only on localhost by default. The first inference can take longer because the model is downloaded and cached in the persistent model_cache volume. See DEPLOYMENT.md for TLS, authentication, reverse proxy, model caching, resource limits and production considerations.
Publish to the official MCP Registry
The preferred route in this project is a remote-only registry listing. The registry stores metadata and a link to your already deployed HTTPS MCP server; it does not host your Python code. A remote-only listing needs no PyPI release. You need a publicly accessible HTTPS /mcp endpoint you control and ownership of the namespace you publish under.
# 1. Deploy the Docker container behind an HTTPS reverse proxy, e.g.:
# https://mcp.example.com/mcp
# 2. Create registry metadata for a GitHub namespace you own:
python scripts/generate_registry.py \
--github-user YOUR_GITHUB_USERNAME \
--url https://mcp.example.com/mcp \
--version 0.1.0
# 3. Install the official publisher, e.g. on macOS:
brew install mcp-publisher
# 4. Log in, validate and publish:
mcp-publisher login github
mcp-publisher validate server.json
mcp-publisher publish server.jsonFor non-macOS installations use official publisher binaries from modelcontextprotocol/registry releases. Replace both placeholders; the sample metadata is not publishable unchanged. See DEPLOYMENT.md for an end-to-end procedure.
Runtime configuration
Settings can be exported as environment variables; see .env.example:
Variable | Default |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The guards limit inputs but do not provide authentication, rate limiting or runtime isolation. See DEPLOYMENT.md before exposing the service publicly.
Notes / caveats
TextLite's
num_tokensuses its default cheap approximate token count, not the tokenizer of a specific LLM. Some upstream code has a fallback that may select a first item over the budget. Check actual LLM token counts if strict budgets are required.Deduplication and clustering use dense similarity matrices (roughly quadratic in input count), so the input cap matters. Tune it conservatively.
TextLite topic extraction creates topic clusters from English-style keyphrase candidates. Entity-to-topic association is lexical, not semantic.
rerank_passagesreturns ranked text, not calibrated relevance probabilities.The semantic similarity scores are cosine scores, not probabilities. Embedding results depend on the model selected.
Remote deployment needs HTTPS, auth, ingress rate limits, observability, and consideration of whether your submitted text is sensitive. By default inference is local to the server, but first-use model downloads require network access.
The upstream TextLite dependency is installed from the mutable
mainbranch. For reproducible production builds, pin to a reviewed commit SHA inpyproject.tomland redeploy.The project's Git dependency is allowed by
pipfor source installs but cannot be published to PyPI as-is. Either publish an appropriately licensed TextLite version to PyPI under an owned distribution name or change the packaging model before attempting PyPI publication. Remote-only MCP Registry publishing does not require PyPI.
Project layout
src/textlite_mcp/server.py FastMCP server and all tools
src/textlite_mcp/__init__.py Python package version
examples/client_example.py In-memory / HTTP MCP client example
examples/claude_desktop_config.json Example client config
scripts/generate_registry.py Create server.json for MCP Registry
server.json.example Documentation template
Dockerfile / docker-compose.yml Deployment
.circleci/config.yml Optional CI test/build workflow
tests/ Automated tests without downloading models
DEPLOYMENT.md Hosting and registry publication guideSources
TextLite API: https://github.com/meru-research/textlite
Standalone FastMCP: https://gofastmcp.com/docs/deployment/running-server
Registry remote servers: https://github.com/modelcontextprotocol/registry/blob/main/docs/modelcontextprotocol-io/remote-servers.mdx
Publisher CLI: https://github.com/modelcontextprotocol/registry/blob/main/docs/reference/cli/commands.md
CI packaging tutorial: https://circleci.com/blog/building-and-deploying-a-python-mcp-server-with-fastmcp/
TextLite is a separate upstream project with its own Apache-2.0 license. This archive contains an independent integration, not a vendored copy of TextLite.
Available Tools
14 toolsassign_entities_to_topicsAssign Entities To TopicsA
Attach entities by lightweight lexical matching to topics from extract_topics.
topics entries need id, label, score, size, keyphrases. entities entries need name and optionally id, weight, importance_score.
Inputs: topics (required), entities (required), max_entities_per_topic. Returns: result
cluster_entitiesCluster EntitiesC
Cluster related entity names or phrases; output members, label, representative and cohesion.
Inputs: entities (required), dedup_threshold, similarity_threshold. Returns: result
compress_contextsCompress ContextsC
Choose informative, diverse paragraphs under an approximate text-token budget.
Inputs: paragraphs (required), num_tokens, dedup_threshold, similarity_budget_threshold, +2 more. Returns: result
compress_query_contextsCompress Query ContextsC
Extract question-relevant sentences under an approximate text-token budget.
Inputs: query (required), paragraphs (required), num_tokens, min_similarity, +1 more. Returns: result
deduplicate_textsDeduplicate TextsC
Remove normalized-exact and semantically similar duplicates; preserve duplicate groups.
Inputs: texts (required), similarity_threshold. Returns: object
extract_keyphrasesExtract KeyphrasesC
Extract scored, frequency-aware keyphrases with configurable n-gram size.
Inputs: texts (required), top_k, diversity, max_ngram, +2 more. Returns: result
extract_topicsExtract TopicsC
Discover high-level topics by clustering extracted keyphrases.
Inputs: texts (required), max_topics, min_topic_size, top_k_keyphrases, +1 more. Returns: result
keyphrases_to_tagsKeyphrases To TagsC
Convert output from extract_keyphrases into annotation-style tag dictionaries.
Inputs: keyphrases (required), source. Returns: result
rerank_passagesRerank PassagesB
Rerank passages with a cross-encoder; returns passages in relevance order (no raw scores).
Inputs: query (required), passages (required), top_k. Returns: result
semantic_searchSemantic SearchC
Return top-k candidate texts ordered by cosine similarity to a query.
Inputs: query (required), texts (required), top_k. Returns: result
semantic_similaritySemantic SimilarityB
Return the cosine similarity (-1 to 1) between two locally embedded texts.
Inputs: text_a (required), text_b (required). Returns: object
server_infoServer InfoB
Return server version, configured models and input limits (no models loaded).
Inputs: no named parameters. Returns: object
summarize_paragraphsSummarize ParagraphsC
Extractively summarize each paragraph; optionally apply a shared approximate token limit.
Inputs: paragraphs (required), max_tokens, max_sentences_per_paragraph. Returns: result
summarize_textSummarize TextB
Produce an extractive (not generative) summary with selected source sentences.
Inputs: text (required), diversity, max_tokens, max_sentences. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Most tools have clearly distinct purposes, and adjacent tools like semantic_similarity, semantic_search, and rerank_passages are differentiated by their inputs and outputs. There is some potential overlap among clustering/topic tools and among compression/summarization variants, but descriptions generally clarify the boundaries.
Names are consistently snake_case and mostly follow a verb_noun pattern such as extract_keyphrases and deduplicate_texts. A few tools use noun or adjective phrases like semantic_search, server_info, and keyphrases_to_tags, which are minor deviations but still readable.
With 14 tools, the server is well-scoped for a text-processing toolkit. Each tool covers a recognizable operation, and the count is within the typical range for a coherent multi-function server.
The surface covers major text-lite workflows: deduplication, compression, summarization, semantic search/similarity, reranking, keyphrase extraction, topic extraction, and entity assignment. Some utilities such as explicit embedding generation or batch orchestration are absent, but core operations are well represented.
Related MCP Connectors
Sentiment, toxicity, entity extraction, PII, translation, summary, QA, fraud scoring, safety audit.
Sentiment, language detection, readability, keywords, summaries and profanity filtering
A hosted MCP suite providing workflow primitives: web search, content fetching, compression, deduplication, cost/budget management, and agent memory pipelines.
Speech denoise, transcripts (SRT/VTT), embeddings, reranking, entities and translation.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceProvides text analysis tools including TF-IDF document search and text profiling (sentiment, readability, keywords) for analyzing text corpora through structured MCP interfaces.BSD 3-Clause
- FlicenseCqualityDmaintenanceEnables semantic search over knowledge-base articles and listing of sample support tickets using MCP tools.4-
- AlicenseNot gradedqualityCmaintenanceEnables document ingestion, semantic search, and retrieval-augmented generation via MCP tools and REST API, using vector embeddings and intelligent chunking.MIT
- AlicenseNot gradedqualityBmaintenanceEnables clinical workflows including search and summarization of synthetic FHIR patient records, PubMed literature search, and HIPAA Safe Harbor de-identification of text, via any MCP client.MIT