Logotipo de glin-profanity-mcp

glin-profanity-mcp

Organización
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.

Editorglincker
Repositorioglin-profanity
IdiomaTypeScript
Forks
9
Estrellas
63
Herramientas disponibles
0
Tipo de transportestdio
Categorías
LicenciaMIT
Enlaces
  • Conecta herramientas a flujos de trabajo con IA

    glin-profanity-mcp ofrece funciones MCP que pueden usar los clientes y agentes de IA compatibles.

  • 0 herramientas disponibles

    Explora a continuación las acciones que se pueden invocar, con sus nombres y descripciones cuando el servidor los proporcione.

  • Configuración lista para copiar

    Usa los ejemplos de instalación para configurar este servidor en tu cliente MCP preferido.

  • Indicadores de interés en el código abierto

    63 estrellas y 9 forks en el repositorio enlazado.


📦 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

Usa el MCP de glin-profanity-mcp con varios modelos de IA

TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que, una vez conectado glin-profanity-mcp, puedes usarlo con distintos modelos de IA en TypingMind sin tener que configurarlo por separado para cada modelo. Esta integración MCP se ejecuta localmente en tu dispositivo a través del conector MCP de TypingMind.

Guía de configuración para usar el conector local

Usa esta opción si el servidor MCP necesita acceder a archivos locales, aplicaciones o recursos privados de tu ordenador.

1

Abre los ajustes de MCP

En TypingMind, ve a Ajustes, luego a Ajustes avanzados y a Model Context Protocol, y elige Configurar conector.

  1. Abre TypingMind en tu navegador.
  2. Haz clic en el icono de Ajustes.
  3. Ve a Ajustes avanzados.
  4. Abre la sección Model Context Protocol.
  5. Haz clic en Configurar conector y elige Este dispositivo.
Pantalla de configuración del conector MCP de TypingMind con «Este dispositivo» seleccionado
2

Ejecuta el comando del conector

Elige Este dispositivo, copia el comando de TypingMind y ejecútalo en Terminal. Mantén el proceso en ejecución mientras uses MCP.

  1. Copia el comando de configuración que muestra TypingMind.
  2. Abre Terminal en macOS o Windows Terminal en Windows.
  3. Pega y ejecuta el comando.
  4. Acepta la instalación del paquete si Terminal te pide confirmación para continuar.
  5. Mantén el proceso en ejecución en la ventana de Terminal mientras uses las herramientas MCP.
3

Añade glin-profanity-mcp como servidor

Cuando el estado del conector sea «Listo», haz clic en «Edita servidores» y pega la configuración del servidor MCP.

  1. Espera hasta que el estado del conector indique «Listo».
  2. Haz clic en Edita servidores.
  3. Pega la configuración del servidor MCP de glin-profanity-mcp.
  4. Guarda la lista de servidores.
  5. Actualiza para comprobar que el conector sigue listo.
Ajustes de MCP de TypingMind con un servidor activo y el botón «Edita servidores»
{
  "mcpServers": {
    "glincker-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Úsala con distintos modelos

Guarda la lista de servidores, abre Plugins, activa las herramientas MCP de glin-profanity-mcp y selecciona cualquier modelo de IA compatible en TypingMind para usar las herramientas en el chat o asignárselas a un agente de IA.

  1. Abre la página Plugins en TypingMind.
  2. Activa las herramientas MCP de glin-profanity-mcp.
  3. Inicia un chat y elige el modelo de IA que quieras usar.
  4. Usa las herramientas MCP en el chat o asígnalas a un agente de IA.
  5. Cambia a otro modelo de IA cuando lo necesites sin volver a conectar MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar glin-profanity-mcp para ayudarme con esta tarea?
glin-profanity-mcp
Claro. Lo he leído.
Esto he encontrado usando glin-profanity-mcp.

Preguntas frecuentes

¿Para qué sirve el servidor MCP glin-profanity-mcp?

glin-profanity-mcp es un servidor MCP que permite a los clientes de IA compatibles conectarse a herramientas y contexto externos. En TypingMind, basta con añadir este servidor MCP una vez para que sus herramientas estén disponibles en tu espacio de trabajo de IA.

¿Puedo usar el servidor MCP glin-profanity-mcp con varios modelos de IA en TypingMind?

Sí. TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que puedes usar glin-profanity-mcp con distintos modelos de IA, como Claude, ChatGPT, Gemini u otros que hayas configurado en TypingMind, sin configurar el servidor MCP por separado para cada modelo.

¿Por qué usar el conector MCP de glin-profanity-mcp con TypingMind?

TypingMind es una de las mejores interfaces de chat con LLM porque reúne varios modelos de IA, prompts, plugins, agentes de IA, claves de API y herramientas MCP en un solo espacio de trabajo. Con glin-profanity-mcp conectado, puedes usar sus herramientas MCP con tus modelos preferidos y mantener organizado tu flujo de trabajo de chat en TypingMind.

¿Cómo conecto el servidor MCP glin-profanity-mcp a TypingMind?

glin-profanity-mcp funciona a través del conector MCP local de TypingMind. Es la mejor opción cuando el servidor MCP necesita acceder a archivos locales, aplicaciones de escritorio, herramientas de línea de comandos o recursos privados de tu ordenador.

¿Qué herramientas ofrece el servidor MCP glin-profanity-mcp en TypingMind?

glin-profanity-mcp ofrece funciones MCP que puedes activar desde la página Plugins de TypingMind y usar en el chat o asignar a agentes de IA.

¿Tengo que compartir mis claves de API con TypingMind para usar el servidor MCP glin-profanity-mcp?

No. TypingMind prioriza el funcionamiento local y te permite mantener el control de tus proveedores de modelos, claves de API, prompts y configuración MCP. Si glin-profanity-mcp requiere autenticación, añade las cabeceras, los ajustes de OAuth o la configuración local necesarios para ese servidor MCP al crear la conexión.

Servidores MCP relacionados

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇