Skip to main content
Glama

textforge

Tidy text, count words, find keywords and pull out summaries. Pure stdlib, no downloads.

English and Spanish stopwords included — handy as the prep work before any real NLP.

Install

pip install git+https://github.com/Alfredo-ctrl/textforge.git

Related MCP server: text-analysis-api

Use it from the terminal

# tidy a string
textforge clean --text "  Hello,   WORLD!  "
textforge clean --input notes.txt --output notes_clean.txt

# tokens, sentences, frequencies
textforge tokens --text "The quick brown fox"
textforge sentences --input article.txt
textforge freq --input article.txt -n 10 --stopwords
textforge ngrams --input article.txt -n 2

# keywords and stats
textforge keywords --input article.txt -n 10
textforge stats --input article.txt
textforge describe --input article.txt

# extractive summary: the 3 most informative sentences
textforge summary --input article.txt -n 3

# slugify a title
textforge slug --text "Análisis y Minería de Datos"

Text comes from --text, --input (a file) or stdin, in that order. Every command prints JSON.

Use it from Python

from textforge import clean_text, tokenize, word_freq, keywords, stats, summarize

clean_text("  Hello,   WORLD!  ")  # 'hello, world!'
tokenize("The quick brown fox")  # ['The', 'quick', 'brown', 'fox']
word_freq("dog dog cat", n=2)  # [('dog', 2), ('cat', 1)]
keywords("El gato persiguió al ratón...", n=5)
stats("Some text here. And more.")  # words, sentences, reading time...
summarize("Long article text. More sentences. Even more.", n=2)

MCP server

Any MCP client can use textforge as tools:

textforge mcp

It speaks MCP over stdio and exposes clean_text, tokenize, sentences, word_freq, ngrams, keywords, stats, summarize, describe, slugify. Example client config:

{
  "mcpServers": {
    "textforge": {"command": "textforge", "args": ["mcp"]}
  }
}

License

See LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Provides 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
    • A
      license
      Not graded
      quality
      D
      maintenance
      A local stdio shim for the hosted Textify MCP server that converts audio, video, images, documents, and webpages into text or Markdown. Includes tools for YouTube transcripts, audio transcription, OCR, file-to-Markdown, and webpage-to-Markdown extraction.
      12 npm
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Provides MCP-compatible AI clients with offline text analysis and rewriting tools, including statistics, extractive summaries, keywords, readability scores, case conversion, entity extraction, and diffing, all running locally without API keys or network calls.
      7
      MIT