redactor-mcp

redactor-mcp

Wraps AWS Comprehend for PII detection and redaction, allowing users to upload files and remove PII via natural language in Claude Desktop.

Category
访问服务器

README

redactor-mcp

MCP server that wraps AWS Comprehend for PII detection and redaction. Upload a plain text file in Claude Desktop, ask it to remove the PII, and get back a redacted version.

This is a demo project, not production software.

Prerequisites

  • Node.js 18+ or Bun 1.0+
  • AWS credentials with comprehend:DetectPiiEntities and comprehend:DetectDominantLanguage permissions

AWS Credentials Setup

Option A: AWS Access Portal (SSO)

aws configure sso
# Profile name: your-profile
# SSO start URL: https://your-org.awsapps.com/start
# SSO region: us-east-1
# Account and role: select from browser

aws sso login --profile your-profile
export AWS_PROFILE=your-profile

Option B: Static Credentials

aws configure
# Enter Access Key ID, Secret Access Key, region (us-east-1)

Required IAM Permissions

{
  "Effect": "Allow",
  "Action": [
    "comprehend:DetectPiiEntities",
    "comprehend:DetectDominantLanguage"
  ],
  "Resource": "*"
}

Installation

bun install

Type Checking

bun run typecheck

Building

Build the project to dist/:

bun run build

Running the Server

For development:

bun run dev

For production (after building):

bun run start

Testing with MCP Inspector

Launch the Inspector UI to test tools interactively:

bun run inspector
  1. Click Connect
  2. Go to Tools tab, click List Tools
  3. Test the tools:

Language Detection

{"text": "Bonjour, je m'appelle Marie."}

Returns detected language(s) with confidence scores:

[
  {
    "language_code": "fr",
    "language_name": "French",
    "score": 0.9876
  }
]

PII Detection

Test detect_pii with: {"text": "My name is Jane Doe and my SSN is 123-45-6789."}

Returns two entities: NAME ("Jane Doe") and SSN ("123-45-6789")

PII Redaction

Test redact_pii with the same text

Returns: "My name is [NAME] and my SSN is [SSN]."

Language Support

  • Language Detection: Supports 100+ languages
  • PII Detection/Redaction: Currently supports English and Spanish only

You can optionally specify the language code:

{"text": "Mi nombre es Juan García", "language_code": "es"}

Or let the system auto-detect:

{"text": "My name is Jane Doe"}

Note: If non-English/non-Spanish text is provided to PII tools, you'll receive a clear error message with the detected language.

Claude Desktop Configuration

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

Option 1: Development Mode (run from source)

{
  "mcpServers": {
    "redactor-mcp": {
      "command": "bun",
      "args": ["run", "/absolute/path/to/redactor-mcp/src/index.ts"],
      "env": {
        "AWS_PROFILE": "your-profile",
        "AWS_REGION": "us-east-1"
      }
    }
  }
}

Option 2: Production Mode (run compiled version)

{
  "mcpServers": {
    "redactor-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/redactor-mcp/dist/index.js"],
      "env": {
        "AWS_PROFILE": "your-profile",
        "AWS_REGION": "us-east-1"
      }
    }
  }
}

Important: Replace:

  • /absolute/path/to/redactor-mcp with the actual path to this project
  • your-profile with your AWS profile name

For production mode, make sure to run bun run build first.

Packaging for Distribution

Create an MCPB package for easy distribution:

bun run pack

This creates a .mcpb file that can be installed directly in Claude Desktop.

Usage

Upload a .txt, .md, or .csv file in Claude Desktop and try prompts like:

  • "What language is this document?"
  • "Detect the language in this file"
  • "Detect the PII in this file"
  • "Remove the PII from this file" (language auto-detected)
  • "Find all the email addresses in this file"
  • "Redact only names and phone numbers"
  • "Redact PII but only high-confidence matches"
  • "Detect PII using Spanish language code"

Sample files are in docs/samples/ for testing:

  • sample-001.md - English text with PII
  • sample-002.csv - English CSV with multiple employee records
  • sample-003-spanish.txt - Spanish text with PII (tests Spanish PII detection)
  • sample-004-french.txt - French text (tests language detection and unsupported language handling)

推荐服务器

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

官方
精选