Data X-Ray MCP Server

Data X-Ray MCP Server

Enables Claude to search, retrieve, and analyze indexed files with sensitivity classifications and automatic redaction of sensitive information.

Category
访问服务器

README

Data X-Ray MCP Server

A Model Context Protocol (MCP) server that provides Claude with access to the Data X-Ray API. This enables Claude to search, retrieve, and analyze indexed files with sensitivity classifications and redaction capabilities.

Overview

Data X-Ray is an enterprise data discovery and classification platform that indexes documents and identifies sensitive information like PII, PHI, financial data, and more. This MCP server exposes Data X-Ray's capabilities to Claude, enabling:

  • Intelligent file search with KQL (Kibana Query Language) queries
  • Sensitivity-aware document retrieval with classification metadata
  • Automatic redaction of sensitive information
  • Classification catalog access to understand what types of sensitive data DXR can detect
  • Context-aware responses based on document metadata and classifications

Why This Matters

Enterprise organizations have vast amounts of unstructured data scattered across multiple systems. Data X-Ray indexes this data and identifies sensitive content, but making this metadata actionable requires integration with AI systems. This MCP server bridges that gap, allowing Claude to:

  1. Find relevant documents based on content, classifications, or metadata
  2. Understand data sensitivity before processing or sharing information
  3. Safely access sensitive documents through automatic redaction
  4. Provide context-aware answers using document metadata and classifications

Installation

Prerequisites

  • Access to a Data X-Ray instance
  • Data X-Ray API credentials (Bearer token)

Claude Desktop (Recommended)

Install the pre-built extension bundle (.mcpb file):

  1. Download or build the .mcpb file (see Building the Extension)
  2. Double-click the .mcpb file to open the Claude Desktop install dialog
  3. Enter your Data X-Ray configuration when prompted:
    • Data X-Ray URL - Base URL of your DXR instance (e.g., https://dxr.yourcompany.com)
    • API Token - Bearer token for API authentication (stored securely in your OS keychain)
    • Skip SSL Verification - Enable only for development environments with self-signed certificates

The extension will appear in your Claude Desktop connectors panel with the Data X-Ray icon.

Claude Code CLI

Add a .mcp.json file to your project directory:

{
  "mcpServers": {
    "dxr": {
      "command": "node",
      "args": ["/path/to/dxr-mcp-server/dist/index.js"],
      "env": {
        "DXR_API_URL": "https://dxr.yourcompany.com",
        "DXR_API_TOKEN": "your-api-token-here"
      }
    }
  }
}

Note: .mcp.json is gitignored by default since it contains credentials.

Available Tools

The MCP server provides eight tools that Claude can use:

1. list_file_metadata

Search and list file metadata from Data X-Ray with KQL filtering. Returns lightweight summaries with aggregate statistics to minimize context usage.

Parameters:

  • q (optional): KQL query string to filter results
  • limit (optional): Number of files to return (default 50, max 500)
  • offset (optional): Number of files to skip for pagination

Example queries:

  • fileName:"*.pdf" AND size > 1000000 - PDFs larger than 1MB
  • annotators.name:"Credit card" - Files with credit card data detected
  • datasource.name:"Finance*" AND lastModifiedAt > now-30d - Recent finance files
  • entitlements.whoCanAccess: { accountType:"GROUP" AND name:"Everyone" } - Publicly accessible files

Returns: Aggregate statistics (count, size, file types, sensitive data counts) plus lightweight file summaries with pagination info.

2. get_file_metadata_details

Get complete metadata for a specific file by ID.

Parameters:

  • id (required): File identifier from list_file_metadata

Returns: Full metadata including datasource info, entitlements, labels, DLP labels, annotators with matched phrases, owner/creator/modifier accounts, extracted metadata, and GPS coordinates if available.

3. get_file_content

Get the original content of a file in its native format.

Parameters:

  • id (required): File identifier from list_file_metadata

Returns: Text files are decoded and returned as readable text. Images are returned as viewable images. PDFs have text extracted automatically. Other binary files are saved to /tmp/dxr-files/ for further processing.

Use case: Default tool for viewing file contents. Prefer this over get_file_text when you need the original file, images, or higher-fidelity parsing.

4. get_file_text

Get the plain text extracted by Data X-Ray from a file. Simpler and faster than get_file_content when you only need text.

Parameters:

  • id (required): File identifier from list_file_metadata

Returns: Plain text content as extracted by Data X-Ray.

Note: This is a beta endpoint. Returns empty text if DXR has not extracted text for the file (e.g. discovery-only scan, unsupported format, scanned image PDF).

5. get_file_redacted_text

Get plain text content of a file with sensitive information replaced by [REDACTED].

Parameters:

  • id (required): File identifier
  • redactor_id (required): Redactor ID from get_redactors

Returns: Plain text with [REDACTED] placeholders replacing sensitive information.

Use case: Use only when explicitly requested or when there is a specific privacy requirement. For normal file viewing, use get_file_content.

6. get_classifications

Get the catalog of all available classifications in Data X-Ray.

Returns: Array of annotators, labels, and extractors with IDs, names, types, subtypes, descriptions, and links to the DXR UI.

Use case: Call this first before searching for files with sensitive data — you need the exact annotator names to use in KQL queries.

7. get_redactors

Get the catalog of all available redactors.

Returns: Array of redactor objects with IDs, names, and timestamps.

Use case: Get a redactor_id to pass to get_file_redacted_text.

8. render_pdf_pages

Render specific pages of a PDF as high-resolution images for visual analysis.

Parameters:

  • id (required): File identifier (must be a PDF)
  • pages (required): Array of 1-indexed page numbers to render
  • scale (optional): Render scale factor (default 2)

Returns: One image content block per rendered page.

Use case: When text extraction misses structure — tables, charts, scanned pages, forms, handwritten content.

Note: Requires @napi-rs/canvas. Works in Claude Code; may not be available in Claude Desktop MCPB sandbox.

Usage Examples

Here are some example conversations you can have with Claude once the MCP server is configured:

Example 1: Finding Sensitive Documents

User: "Show me all documents that contain credit card information"

Claude uses:
1. get_classifications() to get the catalog and find the exact annotator name
2. list_file_metadata(q: 'annotators.name:"Credit card"') to find matching files
3. Returns a summary of documents with credit card data

Example 2: Safely Viewing a Sensitive Document

User: "I need to review document ID abc123, but make sure any PII is redacted"

Claude uses:
1. get_redactors() to find available redactors
2. get_file_redacted_text(id: "abc123", redactor_id: 1) to get redacted content
3. Displays the document with [REDACTED] placeholders

Example 3: Data Discovery

User: "What types of sensitive information does our DXR instance detect?"

Claude uses:
1. get_classifications() to retrieve the full catalog
2. Summarizes classification types: annotators, labels, extractors
3. Explains what each classification detects

Example 4: Finding Large PDFs

User: "Find all PDF files larger than 10MB"

Claude uses:
1. list_file_metadata(q: 'mimeType:"application/pdf" AND size > 10485760')
2. Returns a list of large PDF files with metadata

Example 5: Reading a Document

User: "What's in the file with ID xyz789?"

Claude uses:
1. get_file_text(id: "xyz789") for a quick text read (beta, simpler)
   OR get_file_content(id: "xyz789") for the original file (handles images, PDFs)
2. Returns the document content

API Endpoint Mapping

The MCP server wraps these Data X-Ray API v1 endpoints:

MCP Tool DXR API Endpoint Method
list_file_metadata /api/v1/files GET (JSONL stream)
get_file_metadata_details /api/v1/files?q=fileId:"..." GET (JSONL stream)
get_file_content /api/v1/files/{id}/content GET (binary)
get_file_text /api/v1/files/{id}/text GET (JSON, beta)
get_file_redacted_text /api/v1/files/{id}/redacted-text GET
get_classifications /api/v1/classifications GET
get_redactors /api/v1/redactors GET

All API calls use Bearer token authentication. The /api/v1/files endpoint returns newline-delimited JSON (JSONL); all other endpoints return JSON or binary.

Development

Prerequisites

  • Node.js 18.0.0 or higher
  • npm

Setup

npm install
npm run build

Build and Watch

npm run watch  # Rebuild on file changes

Testing Locally

You can test the server using the MCP Inspector:

export DXR_API_URL="https://dxr.yourcompany.com"
export DXR_API_TOKEN="your-api-token"
npx @modelcontextprotocol/inspector node dist/index.js

Building the Extension

To build the .mcpb extension bundle for Claude Desktop:

  1. Build the project and prune dev dependencies:

    npm run build
    npm prune --production
    
  2. Pack the extension:

    npx @anthropic-ai/mcpb pack .
    
  3. Restore dev dependencies:

    npm install
    

This produces a dxr-mcp-server-<version>.mcpb file that can be distributed and installed by double-clicking.

The .mcpbignore file controls which files are excluded from the bundle (similar to .gitignore).

Troubleshooting

Server Not Starting

  • Verify DXR_API_URL and DXR_API_TOKEN are set correctly
  • Check that the Data X-Ray instance is accessible
  • Ensure Node.js version is 18.0.0 or higher

Authentication Errors

  • Verify your API token is valid and not expired
  • Ensure the token has appropriate permissions for the API endpoints
  • Check that the Bearer token format is correct

Connection Issues

  • Verify the Data X-Ray instance URL is correct
  • Check network connectivity and firewall rules
  • Ensure the Data X-Ray API is accessible from your machine

Contributing

When making changes:

  1. Update TypeScript types in src/types.ts if API changes
  2. Add new tools following the existing pattern in src/index.ts
  3. Update this README and manifest.json tools array with new tools
  4. Run npm run build to ensure TypeScript compiles
  5. Test with MCP Inspector before deploying
  6. Rebuild the .mcpb extension (see Building the Extension)

License

Proprietary - Ohalo

Support

For issues or questions:

  • Data X-Ray API: support@ohalo.co
  • MCP Server: File an issue in the repository

Related Resources

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选