Логотип glin-profanity-mcp

glin-profanity-mcp

Организация
glincker

Open-source ML-powered profanity filter with TensorFlow.js toxicity detection, leetspeak & Unicode obfuscation resistance. 21M+ ops/sec, 23 languages, React hooks, LRU caching. npm & PyPI.

Издательglincker
Репозиторийglin-profanity
ЯзыкTypeScript
Форки
9
Звёзды
63
Доступные инструменты
0
Тип транспортаstdio
Категории
ЛицензияMIT
Ссылки
  • Подключайте инструменты к рабочим процессам с ИИ

    glin-profanity-mcp предоставляет возможности MCP, доступные совместимым ИИ-клиентам и агентам.

  • Доступные инструменты: 0

    Ниже представлены доступные для вызова действия с названиями и описаниями, если сервер их предоставляет.

  • Готовая конфигурация для копирования

    Используйте примеры конфигурации, чтобы настроить этот сервер в предпочитаемом MCP-клиенте.

  • Показатели интереса к открытому проекту

    Звёзды: 63, форки: 9 — в связанном репозитории.


📦 Packages

This monorepo maintains the following packages:

PackageVersionDescription
glin-profanitynpmCore profanity filter for JavaScript/TypeScript
glin-profanityPyPICore profanity filter for Python
glin-profanity-mcpnpmMCP server for AI assistants (Claude, Cursor, etc.)
openclaw-profanitynpmPlugin for OpenClaw/Moltbot AI agents

Why Glin Profanity?

Modern AI applications need more than a word list. Users evade filters with f4ck, sh1t, and fսck (Cyrillic ս → u). LLM pipelines leak PII and secrets into logs. Prompt injection slips through unguarded inboxes. Today's moderation problem is a guardrail problem — and most solutions leave you choosing between a Python-only library, a Llama-licensed model, or a paid cloud API.

Glin Profanity is the MIT-licensed, Node-native, MCP-first answer. It runs entirely offline, ships a 12 KB core bundle with no mandatory cloud calls, integrates with Claude/Cursor/Windsurf via 24 MCP tools out of the box, and covers 24 languages with leetspeak and Unicode homoglyph evasion detection built in. Prompt-injection, PII, and secrets scanning are all shipped today.

vs. Meta PurpleLlama — Python + Llama Community License, requires downloading weights, no Node support, no MCP server. vs. ProtectAI llm-guard — Python-only, heavy transformer dependencies, no edge/browser runtime. vs. Azure Content Safety — paid cloud API, data leaves your infra, rate-limited.

┌─────────────────────────────────────────────────────────────────────────────┐
│                           GLIN PROFANITY v3                                 │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│   Input Text ──►  Unicode       ──►  Leetspeak    ──►  Dictionary  ──► ML  │
│                   Normalization      Detection         Matching        Check│
│                   (homoglyphs)       (f4ck→fuck)       (24 langs)     (opt) │
│                                                                             │
│   "fսck"     ──►  "fuck"        ──►  "fuck"       ──►  MATCH       ──► ✓   │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

Performance Benchmarks

From the CI shootout gate (benchmarks/shootout/results.md), Node.js v22, 20-input torture-set batches:

Libraryops/secF1 (accuracy)False-Positive Rate
glin-profanity99080.6%0.0%
obscenity5,11279.5%5.9%
bad-words24154.2%0.0%
leo-profanity338,40734.6%0.0%
@2toad/profanity839,79656.7%0.0%

glin-profanity trades raw throughput for zero false positives and the highest F1 in the field. See benchmarks/shootout/results.md for the full per-category breakdown.


Feature Comparison

Featureglin-profanityobscenityDetoxifyPurpleLlamallm-guard
MIT licenseYesYesApache-2.0Llama CommunityApache-2.0
Node-nativeYesYesNoNoNo
Python packageYesNoYesYesYes
MCP server (24 tools)YesNoNoNoNo
Runs fully offlineYesYesYesYes (needs weights)Yes
Leetspeak detectionYesPartialNoNoNo
Unicode homoglyph detectionYesNoNoNoNo
Multi-language support24 languagesEnglish only6 languagesEnglish onlyEnglish only
ML toxicity detectionYes (TensorFlow.js, opt-in)NoYes (PyTorch)Yes (Llama)Yes (transformers)
Edge / browser runtimeYesYesNoNoNo
Bundle size (core, minified)12 KB6 KBN/AN/AN/A
Prompt-injection detectionYes (shipped)NoNoYesYes
PII / secrets scanningYes (shipped)NoNoNoYes

Installation

JavaScript/TypeScript

bash
npm install glin-profanity

Python

bash
pip install glin-profanity

Quick Start

JavaScript

javascript
import { checkProfanity, Filter } from 'glin-profanity';

// Simple check
const result = checkProfanity("This is f4ck1ng bad", {
  detectLeetspeak: true,
  languages: ['english']
});

result.containsProfanity  // true
result.profaneWords       // ['fucking']

// With replacement
const filter = new Filter({
  replaceWith: '***',
  detectLeetspeak: true
});
filter.checkProfanity("sh1t happens").processedText  // "*** happens"

Python

python
from glin_profanity import Filter

filter = Filter({"languages": ["english"], "replace_with": "***"})

filter.is_profane("damn this")           # True
filter.check_profanity("damn this")      # Full result object

React

tsx
import { useProfanityChecker } from 'glin-profanity';

function ChatInput() {
  const { result, checkText } = useProfanityChecker({
    detectLeetspeak: true
  });

  return (
    <input onChange={(e) => checkText(e.target.value)} />
    {result?.containsProfanity && <span>Clean up your language</span>}
  );
}

Architecture


Detection Capabilities

Leetspeak Detection

javascript
const filter = new Filter({
  detectLeetspeak: true,
  leetspeakLevel: 'aggressive'  // basic | moderate | aggressive
});

filter.isProfane('f4ck');     // true
filter.isProfane('5h1t');     // true
filter.isProfane('@$$');      // true
filter.isProfane('ph.u" "ck'); // true (aggressive mode)

Unicode Homoglyph Detection

javascript
const filter = new Filter({ normalizeUnicode: true });

filter.isProfane('fսck');   // true (Armenian 'ս' → 'u')
filter.isProfane('shіt');   // true (Cyrillic 'і' → 'i')
filter.isProfane('ƒuck');   // true (Latin 'ƒ' → 'f')

ML-Powered Detection

javascript
import { loadToxicityModel, checkToxicity } from 'glin-profanity/ml';

await loadToxicityModel({ threshold: 0.9 });

const result = await checkToxicity("You're the worst player ever");
// { toxic: true, categories: { toxicity: 0.92, insult: 0.87, ... } }

Supported Languages

24 languages with curated dictionaries:

ArabicChineseCzechDanish
DutchEnglishEsperantoFinnish
FrenchGermanHindiHungarian
ItalianJapaneseKoreanNorwegian
PersianPolishPortugueseRussian
SpanishSwedishThaiTurkish

Documentation

DocumentDescription
Getting StartedInstallation and basic usage
API ReferenceComplete API documentation
Framework ExamplesReact, Vue, Angular, Express, Next.js
Advanced FeaturesLeetspeak, Unicode, ML, caching
ML GuideTensorFlow.js integration
ChangelogVersion history

Local Testing Interface

Run the interactive playground locally to test profanity detection:

bash
# Clone the repo
git clone https://github.com/GLINCKER/glin-profanity.git
cd glin-profanity/packages/js

# Install dependencies
npm install

# Start the local testing server
npm run dev:playground

Open http://localhost:4000 to access the testing interface with:

  • Real-time profanity detection
  • Toggle leetspeak, Unicode normalization, ML detection
  • Multi-language selection
  • Visual results with severity indicators

Use Cases

ApplicationHow Glin Profanity Helps
Chat platformsReal-time message filtering with React hook
GamingDetect obfuscated profanity in player names/chat
Social mediaScale moderation with ML-powered detection
EducationMaintain safe learning environments
EnterpriseFilter internal communications
AI/ML pipelinesClean training data before model ingestion

MCP Server for AI Assistants

Glin Profanity includes an MCP (Model Context Protocol) server that enables AI assistants like Claude Desktop, Cursor, Windsurf, and other MCP-compatible tools to use profanity detection as a native tool.

Quick Setup

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

json
{
  "mcpServers": {
    "glin-profanity": {
      "command": "npx",
      "args": ["-y", "glin-profanity-mcp"]
    }
  }
}

Cursor (.cursor/mcp.json):

json
{
  "mcpServers": {
    "glin-profanity": {
      "command": "npx",
      "args": ["-y", "glin-profanity-mcp"]
    }
  }
}

Available Tools (24)

ToolDescription
check_profanityCheck text for profanity with detailed results
censor_textCensor profanity with configurable replacement
analyze_contextContext-aware analysis with domain whitelists
batch_checkCheck multiple texts in one operation
validate_contentContent validation with safety scoring (0-100)
detect_obfuscationDetect leetspeak and Unicode tricks
get_supported_languagesList all 24 supported languages
explain_matchExplain why text was flagged with reasoning
suggest_alternativesSuggest clean alternatives for profane content
analyze_corpusAnalyze up to 500 texts for moderation stats
compare_strictnessCompare results across strictness levels
create_regex_patternGenerate regex patterns for custom detection
track_user_messageTrack user messages for repeat offender detection
get_user_profileGet moderation profile for a specific user
get_high_risk_usersList users with high violation rates
reset_user_profileReset a user's moderation history
stream_checkReal-time streaming profanity check
stream_batchStream multiple texts with live results
get_stream_statsGet streaming session statistics
check_prompt_injectionScan text for prompt injection attacks (rule-based, 50 patterns)
scan_secretsDetect leaked API keys, tokens, and credentials (110 patterns + entropy)
scan_piiDetect PII: email, phone, SSN, credit card, IBAN, passport, and more
redact_piiRedact PII into reversible vault-backed placeholders
restore_piiRestore PII placeholders to original values via vault session

Plus 5 workflow prompts and 5 reference resources for guided AI interactions.

Example Prompts for AI Assistants

"Check this user comment for profanity using glin-profanity"
"Validate this blog post content with high strictness"
"Batch check these 50 messages for any inappropriate content"
"Analyze this medical text with the medical domain context"

See the full MCP documentation for setup instructions and examples.


Shipped AI Guardrails

The scanner layer is live. Import from glin-profanity/scanners:

js
import { PromptInjectionScanner, SecretsScanner, PiiScanner, Vault, scanAll } from 'glin-profanity/scanners';
ScannerCoverage
PromptInjectionScanner50 patterns across 6 attack categories
SecretsScanner110 patterns (AWS, GCP, Azure, GitHub, Stripe, OpenAI, Anthropic, …) + Shannon entropy
PiiScanner27 patterns with Luhn + IBAN mod-97 validation
VaultPlaceholder-based redact/restore with 4 strategies
scanAllComposite scanner — runs all of the above in one call

Coming in 2026

The following capabilities are on the active roadmap.

FeatureETANotes
glincker/glin-guard-small on HF HubQ3 2026Our own distilled toxicity model, MIT weights, designed for edge inference
AI-slop detectionQ3 2026Pattern-based detector for generic AI-generated prose
Bluesky Ozone labeler adapterQ4 2026Drop-in labeler for AT Protocol moderation pipelines
Compliance presetsQ4 2026Pre-tuned configs for UK OSA, EU DSA, and COPPA requirements

See ROADMAP.md for the full issue backlog and contribution opportunities.


License

MIT License - free for personal and commercial use.

Enterprise licensing with SLA and support available from GLINCKER.


Contributing

See CONTRIBUTING.md for guidelines. We welcome:

  • Bug reports and fixes
  • New language dictionaries
  • Performance improvements
  • Documentation updates

Star History


Live Demo · NPM · PyPI · GitHub

Built by GLINCKER · Part of the GLINR ecosystem

Используйте MCP glin-profanity-mcp с разными ИИ-моделями

TypingMind подключает инструменты MCP на уровне рабочего пространства, поэтому после подключения glin-profanity-mcp вы можете использовать их с разными моделями ИИ в TypingMind, не настраивая подключение отдельно для каждой модели. Эта интеграция MCP работает локально на вашем устройстве через коннектор MCP TypingMind.

Руководство по настройке локального коннектора

Выберите этот способ, если серверу MCP нужен доступ к локальным файлам, приложениям или закрытым ресурсам на вашем компьютере.

1

Откройте настройки MCP

В TypingMind откройте «Настройки», затем «Расширенные настройки», перейдите в раздел «Протокол контекста модели» и выберите «Настроить коннектор».

  1. Откройте TypingMind в браузере.
  2. Нажмите значок настроек.
  3. Перейдите в «Расширенные настройки».
  4. Откройте раздел «Протокол контекста модели».
  5. Нажмите «Настроить коннектор» и выберите «Это устройство».
Экран настройки коннектора MCP в TypingMind с выбранным вариантом «Это устройство»
2

Выполните команду коннектора

Выберите «Это устройство», скопируйте команду из TypingMind и выполните её в терминале. Не останавливайте процесс, пока используете MCP.

  1. Скопируйте команду настройки, показанную в TypingMind.
  2. Откройте «Терминал» в macOS или Windows Terminal в Windows.
  3. Вставьте и выполните команду.
  4. Подтвердите установку пакета, если терминал запросит разрешение продолжить.
  5. Не закрывайте окно терминала и не останавливайте процесс, пока используете инструменты MCP.
3

Добавьте glin-profanity-mcp как сервер

Когда статус коннектора сменится на «Готов», нажмите «Изменить серверы» и вставьте конфигурацию сервера MCP.

  1. Дождитесь, пока статус коннектора сменится на «Готов».
  2. Нажмите «Изменить серверы».
  3. Вставьте конфигурацию сервера MCP для glin-profanity-mcp.
  4. Сохраните список серверов.
  5. Обновите статус, если хотите убедиться, что коннектор по-прежнему готов к работе.
Настройки MCP в TypingMind с активным сервером и кнопкой «Изменить серверы»
{
  "mcpServers": {
    "glincker-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Используйте подключение с разными моделями

Сохраните список серверов, откройте раздел «Плагины», включите инструменты MCP для glin-profanity-mcp, затем выберите любую поддерживаемую модель ИИ в TypingMind и используйте инструменты в чате или назначьте их ИИ-агенту.

  1. Откройте страницу «Плагины» в TypingMind.
  2. Включите инструменты MCP для glin-profanity-mcp.
  3. Начните чат и выберите модель ИИ, которую хотите использовать.
  4. Используйте инструменты MCP в чате или назначьте их ИИ-агенту.
  5. При необходимости переключайтесь на другую модель ИИ без повторного подключения MCP.
Чат TypingMind с включёнными инструментами MCP и выбранной ИИ-моделью
Можете помочь мне с этой задачей с помощью glin-profanity-mcp?
glin-profanity-mcp
Конечно. Я всё прочитал.
Вот что я нашёл с помощью glin-profanity-mcp.

Часто задаваемые вопросы

Для чего используется сервер MCP glin-profanity-mcp?

glin-profanity-mcp — это сервер MCP, который позволяет совместимым ИИ-клиентам подключаться к внешним инструментам и получать контекст. В TypingMind достаточно один раз добавить этот сервер MCP, чтобы его инструменты стали доступны в вашем рабочем пространстве с ИИ.

Можно ли использовать сервер MCP glin-profanity-mcp с несколькими ИИ-моделями в TypingMind?

Да. TypingMind подключает инструменты MCP на уровне рабочего пространства, поэтому вы можете использовать glin-profanity-mcp с разными ИИ-моделями, например Claude, ChatGPT, Gemini или другими моделями, настроенными в TypingMind, без отдельной настройки сервера MCP для каждой модели.

Зачем использовать MCP glin-profanity-mcp с TypingMind?

TypingMind — один из лучших интерфейсов для чата с LLM: он объединяет разные ИИ-модели, промпты, плагины, ИИ-агентов, ключи API и инструменты MCP в одном рабочем пространстве. Подключив glin-profanity-mcp, вы сможете использовать его инструменты MCP с предпочитаемыми моделями, сохраняя удобную организацию работы с чатами в TypingMind.

Как подключить сервер MCP glin-profanity-mcp к TypingMind?

glin-profanity-mcp работает через локальный коннектор MCP TypingMind. Этот вариант лучше всего подходит, когда серверу MCP нужен доступ к локальным файлам, настольным приложениям, инструментам командной строки или закрытым ресурсам на вашем компьютере.

Какие инструменты предоставляет сервер MCP glin-profanity-mcp в TypingMind?

glin-profanity-mcp предоставляет возможности MCP, которые можно включить на странице «Плагины» в TypingMind и использовать в чате или назначить ИИ-агентам.

Нужно ли передавать TypingMind свои ключи API для использования сервера MCP glin-profanity-mcp?

Нет. TypingMind ориентирован прежде всего на локальную работу и позволяет вам контролировать выбор провайдеров моделей, ключи API, промпты и конфигурацию MCP. Если glin-profanity-mcp требует аутентификации, при создании подключения добавьте необходимые заголовки, настройки OAuth или локальную конфигурацию для этого сервера MCP.

Похожие серверы MCP

Все

Создайте свою рабочую ИИ-среду сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇