Entity Resolution MCP server

Compares entities using syntactic and semantic methods to determine if differently formatted records refer to the same real-world entity, ideal for data deduplication and customer record matching.
Back to servers
Provider
gh-u3588064
Release date
Apr 25, 2025
Language
TypeScript
Stats
1 star

EntityIdentification is a Model Context Protocol (MCP) server that helps determine whether two sets of data come from the same entity. It uses text normalization techniques and language models to evaluate both exact and semantic equality between data values.

Installation

To use the EntityIdentification tool, install the required dependency using pip:

pip install genai

Usage

The tool provides several functions to compare data and identify whether they belong to the same entity.

Key Functions

Text Normalization

The system normalizes text by converting it to lowercase, removing punctuation, and standardizing whitespace.

Value Comparison

The tool compares values both directly and semantically:

  • Direct comparison checks for exact matches
  • Semantic comparison accounts for minor differences and, for lists, ignores the order of elements

JSON Object Comparison

The system traverses JSON objects key by key, comparing corresponding values and leveraging a language model to assess semantic similarity.

Example Usage

Here's a practical example of how to use the EntityIdentification tool:

import json
import genai
import re

# Define your JSON objects to compare
json1 = {
    "name": "John Doe",
    "address": "123 Main St, Anytown, USA",
    "hobbies": ["reading", "hiking", "coding"]
}

json2 = {
    "name": "john doe",
    "address": "123 Main Street, Anytown, USA",
    "hobbies": ["coding", "hiking", "reading"]
}

# Compare the JSON objects
comparison_results = compare_json(json1, json2)

# Generate final matching result using the language model
model1 = genai.GenerativeModel("gemini-2.0-flash-thinking-exp")
result_matching = model1.generate_content("综合这些信息,你认为可以判断两个数据来自同一主体吗?"+json.dumps(comparison_results, ensure_ascii=False, indent=4))

# Print the result
print(result_matching.text)

The output will indicate whether the two data sets are likely from the same entity, based on both direct comparison and semantic analysis.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later