Skip to main content
Glama

blackmount-nlp-mcp

PyPI version License: MIT Python 3.10+

面向 MCP 的 NLP 工具 — 零繁重依赖。 由 Blackmount 构建。

作为 FastMCP 服务器提供 45 种文本分析工具。无需 NLTK,无需 spaCy,无需 transformers。仅有一个依赖项 (mcp[cli]),NLP 代码量不到 50 KB,秒级就绪。需要 Python 3.10+。


为什么选择它

blackmount-nlp-mcp

NLTK

spaCy

transformers

Wheel 大小

42 KB

1.5 MB

6 MB+ (+ 模型)

10 MB+ (+ 模型)

直接依赖

1

多

多

多

分词

✅

✅

✅

✅

情感分析

✅

✅

❌

✅

可读性评分

✅

❌

❌

❌

关键词提取

✅

✅

❌

❌

文本相似度

✅

✅

✅

✅

语言检测

✅ (18 种语言)

❌

❌

❌

所有功能均使用纯 Python 从零实现 — 包括 Porter 词干提取、TF-IDF、RAKE、Levenshtein 距离、VADER 风格情感分析、Flesch / Gunning Fog / Coleman-Liau / ARI / SMOG 可读性评分、抽取式摘要、语言检测 — 此外还内置了 2000+ 词的情感词典和 500+ 停用词列表,全部打包在内。


Related MCP server: LODA MCP Server

快速开始

pip install blackmount-nlp-mcp

Claude Desktop

添加到你的配置文件中:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "nlp": {
      "command": "blackmount-nlp-mcp"
    }
  }
}

Cursor

添加到项目根目录的 .cursor/mcp.json 中:

{
  "mcpServers": {
    "nlp": {
      "command": "blackmount-nlp-mcp"
    }
  }
}

任意 MCP 客户端

服务器通过 stdio 运行。将你的客户端指向 blackmount-nlp-mcp 命令:

blackmount-nlp-mcp

重启编辑器。现在所有 45 种 NLP 工具均已可用 — 只需用自然语言提问即可。


工具目录

分词 (4 种工具)

工具

描述

尝试提问

word_tokenize

将文本拆分为单词,处理缩写和标点符号

"Tokenize this paragraph into words"

sentence_tokenize

拆分为句子,处理常见缩写

"Break this text into individual sentences"

generate_ngrams

从词元列表中生成词级 n-grams

"Generate bigrams from these tokens"

generate_char_ngrams

生成字符级 n-grams

"Get character trigrams for this word"

可读性 (8 种工具)

所有可读性函数在输入为空或仅包含空格时返回 0.0。

工具

描述

尝试提问

flesch_reading_ease

0–100 易读性得分(越高越容易)

"Calculate the Flesch Reading Ease score"

flesch_kincaid_grade

美国年级水平估算

"What grade level is this written at?"

gunning_fog_index

基于复杂词比例的 Fog 指数

"Calculate the Fog index for this text"

coleman_liau_index

Coleman-Liau 年级水平指数

"Get the Coleman-Liau score"

automated_readability_index

ARI 年级水平指数

"What's the ARI for this document?"

smog_grade_index

SMOG 年级(推荐用于医疗文本)

"Calculate the SMOG grade for this document"

count_syllables

任意单词的音节计数估算

"How many syllables in 'extraordinary'?"

get_reading_level

一次调用获取所有可读性评分及纯英文标签

"Give me a full readability report for this text"

情感分析 (4 种工具)

工具

描述

尝试提问

get_sentiment_score

-1.0 到 +1.0 的复合情感得分

"What's the sentiment of this customer review?"

get_sentiment_label

返回 positive(正面)、negative(负面)或 neutral(中性)

"Is this feedback positive or negative?"

get_sentence_sentiments

逐句情感分析

"Show me the sentiment of each sentence"

get_aspect_sentiment

针对特定主题的情感分析

"What's the sentiment around 'pricing' in these reviews?"

关键词提取 (4 种工具)

工具

描述

尝试提问

extract_tfidf_keywords

语料库中的 TF-IDF 关键词排名

"What are the key terms across these docs?"

extract_rake_keywords

RAKE 算法 — 短语级关键词提取

"Extract the key phrases from this article"

get_word_frequency

按频率排序的最高频词(排除停用词)

"What are the most common words in this text?"

get_phrase_frequency

按频率排序的最高频 n-gram 短语

"What two-word phrases appear most often?"

文本相似度 (5 种工具)

工具

描述

尝试提问

get_jaccard_similarity

词集重叠度,0–1

"How similar are these two paragraphs?"

get_cosine_similarity

词袋余弦相似度,0–1

"Calculate cosine similarity between these texts"

get_edit_distance

Levenshtein 编辑距离

"How many edits to turn 'kitten' into 'sitting'?"

get_normalized_edit_distance

归一化到 0–1 的编辑距离

"How different are these two strings?"

get_longest_common_subsequence

两个字符串之间的 LCS 长度

"What's the LCS length of these two strings?"

文本清洗 (10 种工具)

工具

描述

尝试提问

clean_remove_stopwords

去除 500+ 个英语停用词

"Remove stopwords from this text"

clean_remove_punctuation

去除所有标点符号

"Strip the punctuation"

clean_remove_numbers

去除数字词元

"Remove all numbers from this"

clean_remove_urls

去除 URL

"Clean out the URLs"

clean_remove_emails

去除电子邮件地址

"Remove email addresses from this text"

clean_remove_html

去除 HTML 标签

"Strip the HTML from this content"

clean_normalize_whitespace

合并并修剪空白字符

"Normalize the whitespace"

clean_lowercase

将文本转换为小写

"Convert this to lowercase"

porter_stem

Porter 词干提取器(纯 Python,无 NLTK)

"Stem the word 'running'"

clean_text_pipeline

可配置的多步清洗流水线

"Clean this text: remove HTML, URLs, and stopwords"

检测 (8 种工具)

工具

描述

尝试提问

detect_text_language

识别 18 种支持的语言

"What language is this text written in?"

detect_text_encoding_type

检测脚本类型:ASCII, Latin, Cyrillic, CJK, Arabic

"What script does this text use?"

check_is_english

英语置信度得分,0–1

"Is this text in English?"

count_words

单词计数

"How many words are in this?"

count_sentences

句子计数

"Count the sentences"

count_paragraphs

段落计数

"How many paragraphs?"

get_avg_word_length

平均单词长度(字符数)

"What's the average word length?"

get_avg_sentence_length

平均句子长度(单词数)

"How long are the sentences on average?"

摘要 (2 种工具)

工具

描述

尝试提问

get_extractive_summary

从文档中选择 N 个得分最高的句子

"Summarize this article in 3 sentences"

get_text_statistics

完整的文档统计:单词数、可读性、语言、阅读时间

"Give me a statistical profile of this text"


作为库使用

子模块可直接导入 — 无需 MCP 服务器:

from blackmount_nlp_mcp.sentiment import sentiment_score, sentiment_label
from blackmount_nlp_mcp.readability import reading_level
from blackmount_nlp_mcp.keywords import rake_keywords

text = "This product is absolutely amazing! The quality is excellent."

print(sentiment_score(text))
# 0.9285

print(sentiment_label(text))
# 'positive'

print(reading_level(text))
# {'grade_level': 12.39, 'label': 'college',
#  'flesch_reading_ease': 14.27, 'flesch_kincaid_grade': 12.39,
#  'gunning_fog': 19.58, 'coleman_liau': 10.94,
#  'automated_readability': 7.51, 'smog_grade': 11.21}

print(rake_keywords(text))
# [{'phrase': 'absolutely amazing', 'score': 4.0},
#  {'phrase': 'product', 'score': 1.0},
#  {'phrase': 'quality', 'score': 1.0},
#  {'phrase': 'excellent', 'score': 1.0}]

开发

git clone https://github.com/BlackMount-ai/blackmount-nlp-mcp
cd blackmount-nlp-mcp
pip install -e .
pytest tests/ -v

Blackmount 生态系统

blackmount-nlp-mcp 由 Blackmount 构建 — 为 AI 从业者打造的工具。

blackmount-mcp — 作为 MCP 服务器提供浏览器记忆、AI 聊天搜索和会话分析功能。将其与 blackmount-nlp-mcp 搭配使用,可以分析你保存的对话:从聊天记录中提取关键词、评估 AI 回复的可读性、检测跨会话的情感趋势。

app.blackmount.ai — 完整的 Blackmount 平台。搜索、整理并分析你的 AI 工具产生的一切内容。


许可证

MIT

Available Tools

45 tools
automated_readability_indexC

Automated Readability Index (ARI). Grade level from character and word counts.

Inputs: text (required). Returns: result

check_is_englishC

Confidence that text is English (0-1 scale).

Inputs: text (required). Returns: result

clean_lowercaseC

Convert text to lowercase.

Inputs: text (required). Returns: result

clean_normalize_whitespaceB

Collapse multiple whitespace into single spaces.

Inputs: text (required). Returns: result

clean_remove_emailsC

Remove email addresses from text.

Inputs: text (required). Returns: result

clean_remove_htmlA

Remove HTML tags from text.

Inputs: text (required). Returns: result

clean_remove_numbersC

Remove all numbers from text.

Inputs: text (required). Returns: result

clean_remove_punctuationA

Remove all punctuation from text.

Inputs: text (required). Returns: result

clean_remove_stopwordsC

Remove English stopwords (500+ built-in) from text.

Inputs: text (required). Returns: result

clean_remove_urlsB

Remove URLs from text.

Inputs: text (required). Returns: result

clean_text_pipelineA

Configurable cleaning pipeline. Steps: html, urls, emails, numbers, punctuation, stopwords, whitespace, lowercase.

Inputs: text (required), steps. Returns: result

coleman_liau_indexC

Coleman-Liau Index. Grade level based on characters per word and sentences per word.

Inputs: text (required). Returns: result

count_paragraphsA

Count paragraphs in text (separated by blank lines).

Inputs: text (required). Returns: result

count_sentencesC

Count sentences in text.

Inputs: text (required). Returns: result

count_syllablesA

Estimate syllable count for a single word using heuristics.

Inputs: word (required). Returns: result

count_wordsC

Count words in text.

Inputs: text (required). Returns: result

detect_text_encoding_typeC

Detect character encoding type: ASCII, Latin, Cyrillic, CJK, Arabic, etc.

Inputs: text (required). Returns: result

detect_text_languageA

Detect language from text. Returns top 5 matches with confidence scores. Supports 18 languages.

Inputs: text (required). Returns: result

extract_rake_keywordsC

RAKE keyword extraction (Rapid Automatic Keyword Extraction). Finds multi-word key phrases.

Inputs: text (required), top_n. Returns: result

extract_tfidf_keywordsA

Extract keywords using TF-IDF computed from scratch. Pass multiple docs for best results.

Inputs: documents (required), top_n. Returns: result

flesch_kincaid_gradeC

Flesch-Kincaid Grade Level. Returns US school grade level needed to understand text.

Inputs: text (required). Returns: result

flesch_reading_easeC

Flesch Reading Ease score. 90-100=very easy, 60-69=standard, 0-29=very confusing.

Inputs: text (required). Returns: result

generate_char_ngramsB

Generate character-level n-grams from text.

Inputs: text (required), n. Returns: result

generate_ngramsA

Generate n-grams from a list of tokens. Returns list of n-gram lists.

Inputs: tokens (required), n. Returns: result

get_aspect_sentimentA

Sentiment around specific topics/aspects. Finds sentences mentioning each aspect and averages their sentiment.

Inputs: text (required), aspects (required).

get_avg_sentence_lengthC

Average sentence length in words.

Inputs: text (required). Returns: result

get_avg_word_lengthC

Average word length in characters.

Inputs: text (required). Returns: result

get_cosine_similarityC

Cosine similarity using bag-of-words vectors. 0=orthogonal, 1=identical.

Inputs: text1 (required), text2 (required). Returns: result

get_edit_distanceA

Levenshtein edit distance. Minimum single-character edits to transform s1 into s2.

Inputs: s1 (required), s2 (required). Returns: result

get_extractive_summaryA

Extract the best N sentences as a summary. Scores by position, keyword frequency, length, and title overlap.

Inputs: text (required), n_sentences, title. Returns: result

get_jaccard_similarityB

Jaccard similarity (word-level set overlap). 0=no overlap, 1=identical word sets.

Inputs: text1 (required), text2 (required). Returns: result

get_longest_common_subsequenceB

Length of longest common subsequence (LCS) between two strings.

Inputs: s1 (required), s2 (required). Returns: result

get_normalized_edit_distanceA

Normalized edit distance on 0-1 scale. 0=identical, 1=completely different.

Inputs: s1 (required), s2 (required). Returns: result

get_phrase_frequencyC

Most frequent n-grams (phrases). Default bigrams. Returns [{phrase, count}].

Inputs: text (required), n, top_n. Returns: result

get_reading_levelA

Comprehensive reading level: grade level, label (elementary/middle/high school/college/graduate), and all readability scores.

Inputs: text (required).

get_sentence_sentimentsA

Per-sentence sentiment breakdown. Returns list of {sentence, score, label}.

Inputs: text (required). Returns: result

get_sentiment_labelC

Classify text as 'positive', 'negative', or 'neutral'.

Inputs: text (required). Returns: result

get_sentiment_scoreA

Compound sentiment score from -1 (negative) to 1 (positive). VADER-style with built-in 2000+ word lexicon.

Inputs: text (required). Returns: result

get_text_statisticsA

Comprehensive text stats: words, sentences, paragraphs, reading time, readability scores, language.

Inputs: text (required).

get_word_frequencyA

Most frequent words excluding stopwords. Returns [{word, count}].

Inputs: text (required), top_n. Returns: result

gunning_fog_indexA

Gunning Fog Index. Estimates years of formal education needed to understand text.

Inputs: text (required). Returns: result

porter_stemA

Porter stemmer from scratch. Reduce word to its stem (e.g., 'running' -> 'run').

Inputs: word (required). Returns: result

sentence_tokenizeA

Split text into sentences. Handles abbreviations (Mr., Dr., etc.) and tricky boundaries.

Inputs: text (required). Returns: result

smog_grade_indexA

SMOG Grade. Best for healthcare/medical texts. Counts polysyllabic words.

Inputs: text (required). Returns: result

word_tokenizeA

Split text into word tokens. Handles contractions, hyphenated words, numbers, and punctuation.

Inputs: text (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 45 tools

    Disambiguation3/5

    Many tools have clear purposes, but multiple readability indices (ARI, Coleman-Liau, Flesch, etc.) and multiple sentiment tools (aspect, sentence, overall) overlap in function, creating confusion for agents.

    Naming Consistency4/5

    Most tools follow a verb_noun pattern (e.g., clean_lowercase, get_cosine_similarity), but some use different verbs like 'detect_text_encoding_type' vs 'check_is_english', with minor inconsistency.

    Tool Count3/5

    45 tools is on the high side for an NLP toolkit; many functionalities could be consolidated (e.g., several readability formulas into one tool). Still, each individual tool is specific.

    Completeness4/5

    The server covers a wide range of text analysis: cleaning, tokenization, readability, similarity, sentiment, keyword extraction, language detection. Missing lemmatization, but comprehensive overall.

    Maintenance

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides token-efficient document search and retrieval for LLMs by returning relevant document sections within specified token budgets. It utilizes section-aware parsing and Bloom filter elimination to offer high-speed, zero-dependency access to large documents.
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      Web content extraction for AI agents. 10 tools: scrape, crawl, map, batch, extract, summarize, diff, brand, search, research. Uses TLS fingerprinting to bypass anti-bot without a headless browser. Outputs LLM-optimized markdown with 67% fewer tokens than raw HTML.
      10
      2,465
      AGPL 3.0