Senzing MCP Server

Senzing MCP Server

Enables entity resolution capabilities through the Senzing SDK, allowing AI assistants to search entities, manage records, analyze relationships between entities, and perform bulk data imports with multithreading.

Category
访问服务器

README

Senzing MCP Server

Model Context Protocol (MCP) server for the Senzing SDK, providing entity resolution capabilities to Claude and other MCP clients.

Overview

This MCP server exposes Senzing SDK functionality through the Model Context Protocol, enabling AI assistants like Claude to:

  • Search for entities by attributes
  • Add and manage entity records
  • Analyze relationships and networks
  • Explain entity resolution decisions
  • Perform bulk data imports with multithreading

Features

Entity Search & Retrieval

  • search_entities: Search by name, address, phone, email, etc.
  • get_entity: Retrieve detailed entity information by ID

Record Management

  • add_record: Add single entity records
  • add_records_from_file: Bulk import from JSONL files with multithreading
  • delete_record: Remove records from the repository

Relationship Analysis

  • find_relationship_path: Discover paths between entities
  • find_network: Analyze networks of related entities
  • explain_relationship: Understand why entities are related
  • explain_entity_resolution: See how entities were resolved

Configuration & Diagnostics

  • get_stats: View engine statistics and metrics
  • get_config_info: Check configuration and version info

Installation

Prerequisites

  • Python 3.10 or higher
  • Senzing SDK v4beta installed at /data/etl/senzing/er/v4beta/sdk/python
  • Senzing database configured and accessible

Setup

  1. Clone or navigate to the project directory:
cd /data/etl/senzing/er/v4beta/senzingMCP
  1. Install the package:
pip install -e .
  1. Configure environment variables:
cp .env.example .env
# Edit .env with your Senzing configuration

Required environment variables:

  • SENZING_ENGINE_CONFIGURATION_JSON: JSON string with database and resource paths

Optional environment variables:

  • SENZING_MODULE_NAME: Module identifier (default: "senzing-mcp")
  • SENZING_INSTANCE_NAME: Instance name (default: "senzing-mcp-server")
  • SENZING_LOG_LEVEL: Verbosity level (default: 0)

Usage

Running the Server

Start the MCP server:

senzing-mcp

Or run directly:

python -m senzing_mcp.server

Configuration for AI Assistants

This MCP server can be used with multiple AI assistants:

Claude Desktop Configuration

Add to your Claude Desktop MCP settings file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "senzing": {
      "command": "senzing-mcp",
      "env": {
        "SENZING_ENGINE_CONFIGURATION_JSON": "{\"PIPELINE\": {\"CONFIGPATH\": \"/etc/opt/senzing\", \"RESOURCEPATH\": \"/opt/senzing/g2/resources\", \"SUPPORTPATH\": \"/opt/senzing/data\"}, \"SQL\": {\"CONNECTION\": \"sqlite3://na:na@/var/opt/senzing/sqlite/G2C.db\"}}"
      }
    }
  }
}

Example Queries in Claude

Once configured, you can ask Claude:

Search for entities with the name "John Smith" and phone "555-1234"
Add a customer record with ID "CUST-001" containing name "Jane Doe" and email "jane@example.com"
Find the relationship path between entity 100 and entity 200
Import records from /path/to/customers.jsonl into the CUSTOMERS data source
Explain why entities 100 and 200 are related

File Format for Bulk Import

The add_records_from_file tool expects JSONL format (one JSON object per line):

{"RECORD_ID": "001", "NAME_FULL": "John Smith", "ADDR_FULL": "123 Main St", "PHONE_NUMBER": "555-1234"}
{"RECORD_ID": "002", "NAME_FULL": "Jane Doe", "EMAIL_ADDRESS": "jane@example.com", "DATE_OF_BIRTH": "1990-01-15"}
{"RECORD_ID": "003", "NAME_FULL": "Bob Johnson", "PHONE_NUMBER": "555-5678"}

Architecture

senzingMCP/
├── src/
│   └── senzing_mcp/
│       ├── server.py         # MCP server with tool definitions
│       └── sdk_wrapper.py    # Async wrapper for Senzing SDK
├── pyproject.toml            # Project configuration
├── .env.example              # Environment template
└── README.md                 # This file

Key Components

  • server.py: MCP server implementation using the official mcp package

    • Defines 11 tools for entity resolution operations
    • Handles tool calls and routes to SDK wrapper
    • Uses stdio transport for Claude Desktop integration
  • sdk_wrapper.py: Async wrapper for synchronous Senzing SDK

    • Initializes SDK from environment variables
    • Provides async interface using ThreadPoolExecutor
    • Handles error translation and bulk operations

Development

Running Tests

pytest tests/

Debugging

Set log level for more verbose output:

export SENZING_LOG_LEVEL=1
senzing-mcp

Common Issues

SDK Initialization Failed

  • Check that SENZING_ENGINE_CONFIGURATION_JSON is properly formatted
  • Verify database connection settings
  • Ensure Senzing resources are accessible at specified paths

Import Path Issues

  • Verify Senzing SDK is installed at /data/etl/senzing/er/v4beta/sdk/python
  • Check that the path is accessible and contains the senzing module

Performance Issues with Bulk Import

  • Adjust max_workers parameter (default: 5)
  • Monitor system resources during large imports
  • Consider breaking very large files into smaller batches

License

This MCP server implementation is provided as-is. Senzing SDK usage is subject to Senzing licensing terms.

Support

For issues with:

  • MCP Server: Check server logs and environment configuration
  • Senzing SDK: Consult Senzing documentation
  • Claude Integration: Verify MCP configuration in Claude Desktop settings

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选