fuzzy-match-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@fuzzy-match-mcpFind best matches for 'Samsung Galaxy S24' from my product list"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Fuzzy Match MCP
A Python-based Model Context Protocol (MCP) server for deterministic fuzzy text matching.
It can normalize text, compare strings, rank possible matches, group duplicate values, and explain why two values match or differ. The server uses RapidFuzz for similarity scoring and can be used from MCP clients such as Cursor.
Features
Normalize text before comparison
Compare two strings using multiple similarity algorithms
Rank the best matches from a list
Detect and group probable duplicates
Explain matching results using token overlap
Use specialized matching profiles for companies, products, and addresses
Select different scoring strategies
Run locally through MCP over
stdioTestable with
pytest
Related MCP server: EntityIdentification
Available MCP tools
normalize_text
Normalizes a text value before fuzzy matching.
Example input:
{
"value": " Müller & Söhne GmbH! ",
"profile": "general"
}Example result:
{
"original": " Müller & Söhne GmbH! ",
"profile": "general",
"normalized": "muller and sohne gmbh"
}compare_strings
Compares two strings and returns detailed similarity scores.
Example input:
{
"first": "Deutsche Bank AG",
"second": "Deutsche Bank Aktiengesellschaft",
"threshold": 90,
"profile": "company",
"strategy": "strict"
}The response includes:
Normalized values
Individual similarity scores
Selected strategy
Final selected score
Match decision
find_best_matches
Ranks candidate strings according to their similarity with a query.
Example input:
{
"query": "Samsung Galaxy S24",
"choices": [
"Apple iPhone 15",
"Samsung Galaxy S24 128GB",
"Galaxy S24 Smartphone",
"Google Pixel 9"
],
"limit": 3,
"threshold": 40,
"profile": "product",
"strategy": "weighted"
}find_duplicate_groups
Groups values that probably represent the same entity.
Example input:
{
"values": [
"Deutsche Bank AG",
"Deutsche-Bank Aktiengesellschaft",
"Deutsche Bank",
"Commerzbank AG",
"Commerz Bank",
"Amazon Germany GmbH"
],
"threshold": 80,
"profile": "company",
"strategy": "strict"
}This is useful for:
Customer-data cleanup
Product-catalog deduplication
Company-name matching
Imported CSV cleanup
Contact-list deduplication
explain_match
Compares two values and explains the result using normalized tokens and score information.
Example input:
{
"first": "Samsung Galaxy S24 128GB Black",
"second": "Galaxy S24 Black 128 GB",
"threshold": 75,
"profile": "product",
"strategy": "strict"
}The response includes:
Common tokens
Tokens found only in the first value
Tokens found only in the second value
Token-overlap percentage
A deterministic explanation
Final match decision
Matching profiles
The server supports the following normalization profiles.
Profile | Description |
| Lowercases text, removes accents and punctuation, and collapses whitespace |
| Applies general normalization and removes common legal company suffixes |
| Standardizes product units and joins model names such as |
| Standardizes common address terms such as |
Company-profile example
Deutsche Bank AG
Deutsche Bank AktiengesellschaftBoth normalize approximately to:
deutsche bankProduct-profile example
Samsung Galaxy S 24 128 GBNormalizes to:
samsung galaxy s24 128gbMatching strategies
Strategy | Description |
| Standard character similarity |
| Finds the best matching substring |
| Sorts tokens before comparison |
| Compares unique token sets |
| Uses RapidFuzz's weighted ratio |
| Uses a composite score designed to reduce permissive partial matches |
The strict strategy excludes partial_ratio from the final composite score because partial matching can be misleading when a short string appears inside a much longer string.
Thresholds
Similarity scores range from 0 to 100.
90–100: very strict80–89: useful default for names and product titles70–79: more permissiveBelow
70: may create more false-positive matches
A result is considered a match when:
selected_score >= thresholdThe ideal threshold depends on the dataset and the acceptable false-positive rate.
Project structure
fuzzy-match-mcp/
├── .cursor/
│ └── mcp.json
├── fuzzy_match_mcp/
│ ├── __init__.py
│ ├── grouping.py
│ ├── matching.py
│ ├── server.py
│ ├── tools.py
│ └── validators.py
├── tests/
│ ├── __init__.py
│ └── test_matching.py
├── main.py
├── pyproject.toml
├── README.md
└── uv.lockRequirements
Python 3.10 or newer
uvMCP Python SDK
RapidFuzz
pytest for development
Installation
Clone the repository:
git clone <your-repository-url>
cd fuzzy-match-mcpInstall the dependencies:
uv syncIf you are creating the project from scratch:
uv add "mcp[cli]" rapidfuzz
uv add --dev pytestRunning the tests
uv run pytestRunning with MCP Inspector
Use MCP Inspector during development:
uv run mcp dev main.pyThis opens an MCP development interface where the registered tools can be inspected and called.
Running as a local stdio server
uv run python main.pyThe process waits for MCP JSON-RPC messages through standard input.
Do not type into the terminal while the server is running over stdio. A blank terminal input is not a valid MCP JSON-RPC message.
Do not use ordinary print() statements in the server because standard output is reserved for MCP communication. Use logging through standard error instead.
Cursor configuration
Create:
.cursor/mcp.jsonUse the following configuration on Windows:
{
"mcpServers": {
"fuzzy-match": {
"type": "stdio",
"command": "${workspaceFolder}/.venv/Scripts/python.exe",
"args": [
"${workspaceFolder}/main.py"
]
}
}
}Then:
Open the repository root in Cursor.
Open Customize → MCPs.
Enable
fuzzy-match.Click Reload after changing the registered tools.
Use Cursor Agent to call the MCP tools.
Cursor starts the Python process automatically. Do not manually run main.py at the same time.
Example Cursor Agent prompts
Normalize text
Use the fuzzy-match normalize_text tool to normalize:
" Müller & Söhne GmbH! "
Use the general profile.Compare company names
Use the fuzzy-match compare_strings tool.
Compare:
- Deutsche Bank AG
- Deutsche Bank Aktiengesellschaft
Use:
- profile: company
- strategy: strict
- threshold: 90Rank product matches
Use the fuzzy-match find_best_matches tool.
Query:
Samsung Galaxy S24
Choices:
- Apple iPhone 15
- Samsung Galaxy S24 128GB
- Galaxy S24 Smartphone
- Google Pixel 9
Use the product profile and return the best three matches.Group duplicates
Use the fuzzy-match find_duplicate_groups tool with:
- Deutsche Bank AG
- Deutsche-Bank Aktiengesellschaft
- Deutsche Bank
- Commerzbank AG
- Commerz Bank
- Amazon Germany GmbH
Use:
- profile: company
- strategy: strict
- threshold: 80Explain a match
Use the fuzzy-match explain_match tool to compare:
- Samsung Galaxy S24 128GB Black
- Galaxy S24 Black 128 GB
Use:
- profile: product
- strategy: strict
- threshold: 75How it works
The request flow is:
MCP client
↓
MCP tool in tools.py
↓
Input validation in validators.py
↓
Matching or grouping logic
↓
RapidFuzz
↓
Structured JSON resultNormalization happens before similarity scoring. It can include:
Unicode case folding
Accent removal
Punctuation replacement
Whitespace cleanup
Profile-specific transformations
Performance notes
find_best_matches compares one query against each candidate.
find_duplicate_groups performs pairwise comparisons. Its approximate comparison count is:
n × (n - 1) / 2For this reason, duplicate grouping is intentionally limited to 500 values in the current version.
The grouping implementation uses union-find. If A matches B and B matches C, all three values can be placed in the same group even when A and C do not directly exceed the threshold.
Current limitations
Duplicate grouping is pairwise and is not intended for very large datasets.
Company suffixes and address aliases are rule-based and may not cover every country.
Product normalization supports only a small set of common units.
Fuzzy matching does not prove that two real-world entities are identical.
Thresholds should be evaluated against domain-specific examples before automatic merging.
Planned improvements
Structured record matching
Batch matching
Threshold evaluation
Custom normalization options
Additional international company suffixes
CSV import and export
Better canonical-value selection
More matching profiles
MCP resources and reusable prompts
Contributing
Contributions are welcome.
Suggested workflow:
git checkout -b feature/my-change
uv sync
uv run pytestBefore submitting a change:
Add tests for new behavior
Keep MCP tools focused
Avoid writing to standard output
Preserve structured JSON responses
Document new profiles and strategies
License
Add your chosen license before publishing the project.
A common choice for an open-source MCP server is the MIT License.
Maintenance
Related MCP Servers
- Flicense-qualityDmaintenanceA production-ready MCP server built with FastAPI, providing an enhanced tool registry for creating, managing, and documenting AI tools for Large Language Models (LLMs).Last updated34
- Alicense-qualityDmaintenanceA MCP server that helps determine if two sets of data belong to the same entity by comparing both exact and semantic equality through text normalization and language model integration.Last updated1MIT
- AlicenseBqualityDmaintenanceA complete MCP server for Retrieval-Augmented Generation with file management and vector memory for agents. Supports multiple document formats (PDF, DOCX, TXT, MD, CSV, JSON) with semantic search using Hugging Face embeddings and ChromaDB for efficient vector storage.Last updated1171MIT
- Alicense-qualityDmaintenanceA comprehensive Python MCP server with built-in knowledge base (SQLite + FTS5), web management interface, and flexible tool grouping system. Supports multiple transport protocols (stdio, SSE, HTTP Stream) with zero external dependencies.Last updatedMIT
Related MCP Connectors
Primarily to be used as a template repository for developing MCP servers with FastMCP in Python, P…
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Remote ChromaDB vector database MCP server with streamable HTTP transport
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/faiaz000/fuzzy_match_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server