confusables-mcp / README.md
kokluch's picture
Update README: new emoji and color scheme for project frontmatter
972c4ff
metadata
title: Confusables MCP Server
emoji: πŸ•΅οΈβ€β™‚οΈ
colorFrom: indigo
colorTo: red
sdk: docker
pinned: false
license: apache-2.0

Confusables MCP Server πŸ’¬

A FastMCP-based server exposing the main features of the confusables library as MCP tools. This project allows LLMs and other clients to detect visually confusable Unicode characters, generate regexes for confusables, and normalize strings, all via a standardized MCP interface.

Features

  • is_confusable: Check if two strings are visually confusable.
  • confusable_characters: List all Unicode characters visually confusable with a given character.
  • confusable_regex: Generate a regex matching all confusable variants of a string.
  • normalize: Return all possible normalized forms of a string (ASCII/Latin-alphabet equivalents).

Installation

Clone the repository and install dependencies:

pip install -r requirements.txt

Usage

Start the FastMCP server:

python app.py

The server will run on 0.0.0.0:7860 by default.

API (MCP Tools)

is_confusable_tool

  • Description: Check if two strings are visually confusable.
  • Arguments:
    • str1 (str): First string
    • str2 (str): Second string
  • Returns: bool

confusable_characters_tool

  • Description: List all Unicode characters visually confusable with a given character.
  • Arguments:
    • char (str): Single character
  • Returns: list[str]

confusable_regex_tool

  • Description: Generate a regex matching all confusable variants of a string.
  • Arguments:
    • string (str): Reference string
    • include_character_padding (bool): Allow extra confusable characters between main ones
  • Returns: str (regex pattern)

normalize_tool

  • Description: Return all possible normalized forms of a string.
  • Arguments:
    • string (str): String to normalize
    • prioritize_alpha (bool): Prioritize conversion to Latin alphabet
  • Returns: list[str]

License

Apache 2.0