MCP Hub
Back to servers

glin-profanity-mcp

Content moderation and profanity detection MCP server with 19 tools, 24 language support, leetspeak/Unicode obfuscation detection, context-aware analysis, batch processing, and user tracking for AI-powered content safety.

Stars
34
Forks
6
Updated
Jan 31, 2026
Validated
Feb 2, 2026

GLIN PROFANITY

ML-Powered Profanity Detection for the Modern Web

npm version PyPI version npm downloads PyPI downloads

CI Status Bundle Size License TypeScript

GitHub Stars GitHub Forks GitHub Issues Contributors

Glin Profanity - ML-Powered Profanity Detection

Live Demo


📦 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?

Most profanity filters are trivially bypassed. Users type f*ck, sh1t, or fսck (with Cyrillic characters) and walk right through. Glin Profanity doesn't just check against a word list—it understands evasion tactics.

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

Performance Benchmarks

Tested on Node.js 20, M1 MacBook Pro, single-threaded:

OperationGlin Profanitybad-wordsleo-profanityobscenity
Simple check21M ops/sec890K ops/sec1.2M ops/sec650K ops/sec
With leetspeak8.5M ops/secN/AN/AN/A
Multi-language (3)18M ops/secN/A400K ops/secN/A
Unicode normalization15M ops/secN/AN/AN/A

Feature Comparison

FeatureGlin Profanitybad-wordsleo-profanityobscenity
Leetspeak detection (f4ck, sh1t)YesNoNoPartial
Unicode homoglyph detectionYesNoNoNo
ML toxicity detectionYes (TensorFlow.js)NoNoNo
Multi-language support23 languagesEnglish only14 languagesEnglish only
Result caching (LRU)YesNoNoNo
Severity levelsYesNoNoNo
React hookYesNoNoNo
Python packageYesNoNoNo
TypeScript typesFullPartialPartialFull
Bundle size (minified)12KB + dictionaries8KB15KB6KB
Active maintenanceYesLimitedLimitedLimited

Installation

JavaScript/TypeScript

npm install glin-profanity

Python

pip install glin-profanity

Quick Start

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

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

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

flowchart LR
    subgraph Input
        A[Raw Text]
    end

    subgraph Processing
        B[Unicode Normalizer]
        C[Leetspeak Decoder]
        D[Word Tokenizer]
    end

    subgraph Detection
        E[Dictionary Matcher]
        F[Fuzzy Matcher]
        G[ML Toxicity Model]
    end

    subgraph Output
        H[Result Object]
    end

    A --> B --> C --> D
    D --> E --> H
    D --> F --> H
    D -.->|Optional| G -.-> H

Detection Capabilities

Leetspeak Detection

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

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

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

23 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:

# 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):

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

Cursor (.cursor/mcp.json):

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

Available Tools (19)

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

Plus 4 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.


Roadmap

See our ROADMAP.md for planned features including:

  • Streaming support for real-time chat
  • OpenAI function calling integration
  • Image OCR for profanity in images
  • Edge deployment (Cloudflare Workers, Vercel Edge)
  • More framework integrations

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

Star History Chart

Live Demo · NPM · PyPI · GitHub


Star on GitHub



Built by GLINCKER · Part of the GLINR ecosystem

Reviews

No reviews yet

Sign in to write a review