# Regex Toolkit MCP for AI Agents AI Agent Connect

> Regex Toolkit lets your AI agent pull, check, and hide emails, URLs, and phone numbers with 100% accuracy. It stops the AI from guessing or making up data when you are dealing with messy text blocks or need to redact sensitive information.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_iWHGnBSf4hsPpyRONBGuBJdlaAxPgjzlM6EjoAIv/ai-agent-connect
- **Tags:** regex, data-redaction, input-validation, pattern-matching, data-sanitization, security

## Description

The Regex Toolkit MCP gives your AI agent a way to handle messy text without the usual guesswork. AI models often guess where an email ends or invent fake phone numbers when they summarize a block of notes. This Connector fixes that by using strict mathematical patterns to make sure the data is correct every time. When you use this with your AI client, you are not asking the model to guess. You are asking it to run precise operations. You can pull every single valid phone number from a massive support transcript into a clean list or mask sensitive client info before a report goes public. It handles the heavy lifting of data sanitization while keeping everything local. If you need a reliable way to handle PII without the risk of mistakes, this is a core part of the Vinkius catalog that gets the job done. It turns your agent into a precision tool for data handling rather than just a creative writer. You no longer have to worry about your agent making up fake contact details or leaving sensitive information out of a redacted document. Instead, you get a deterministic result that follows the rules of the regex engine. It is perfect for anyone who needs to move data between different systems where accuracy is the only thing that matters. You can clean up a database, scrub logs, or prepare a public report with confidence. This Connector provides the guardrails your AI needs to act as a reliable data worker.

## Tools

### validate_pattern
Checks if a specific string perfectly matches a standard email, URL, or phone format.

### mask_sensitive_data
Replaces emails, phones, and URLs in a text block with [REDACTED] tags to keep data private.

### extract_pattern
Finds every unique instance of a specific data type within a large body of text.

## Prompt Examples

**Prompt:** 
```
Find all the phone numbers in this transcript and give them to me as a list.
```

**Response:** 
```
I scanned the transcript and found the following unique phone numbers:

| Phone Number |
| :--- |
| (555) 012-3456 |
| (555) 987-6543 |
| (555) 123-4567 |
```

**Prompt:** 
```
Mask all the emails in this paragraph so I can share it on Slack.
```

**Response:** 
```
Here is the sanitized text:

"Please contact our support team at [EMAIL_REDACTED] or reach out to the account manager at [EMAIL_REDACTED] for further assistance. We have already logged your request."
```

**Prompt:** 
```
Is this a valid URL: https://example.com/path?query=1?
```

**Response:** 
```
Yes, that is a perfectly valid URL structure.
```

## Capabilities

### Pull unique emails from text blocks
Extract every valid email address from a large body of text into a clean list.

### Check if a string is a valid URL
Verify if a specific link follows the correct structural format.

### Mask sensitive PII with redaction tags
Replace emails, phones, and URLs with [REDACTED] tags to protect privacy.

### Validate phone number formats instantly
Confirm that a phone number string matches a standard valid pattern.

### Sanitize large datasets for public export
Cleanse entire documents of sensitive contact info before sharing them.

## Use Cases

### Cleaning support tickets
An agent pulls all emails from a 50-page transcript to create a clean mailing list for the sales team.

### Redacting public reports
A privacy officer asks the agent to hide all phone numbers in a company memo before it goes out to the press.

### Validating sign-ups
A developer uses the tool to check if a user's URL is real before saving it to a customer database.

### Data scraping
A researcher pulls all unique URLs from a messy block of scraped web content to build a target list.

## Benefits

- Stop AI hallucinations by using math-based patterns for data extraction instead of guessing.
- Protect user privacy by redacting PII before it hits any external logs or public reports.
- Get clean JSON arrays of contact info instead of messy, unformatted text blocks.
- Verify user input instantly to prevent malformed data from breaking your database or CRM.
- Keep all data processing local so sensitive info never leaves your infrastructure or environment.

## How It Works

The bottom line is you get guaranteed data accuracy instead of AI guesswork.

1. Provide the AI with a block of text and the type of data you need to find.
2. The agent calls the Connector to run the regex patterns against that text.
3. You get back a clean, validated list or a redacted version of the original text.

## Frequently Asked Questions

**Can Regex Toolkit find emails in huge files?**
Yes, it pulls every unique email address from a large body of text and provides them in a clean list.

**Does Regex Toolkit keep my data private?**
Yes, the tool runs locally on your infrastructure, so your sensitive data never leaves your machine.

**Can I use Regex Toolkit to hide phone numbers?**
Yes, it can replace all phone numbers in a text block with [REDACTED] tags to ensure privacy.

**Will Regex Toolkit hallucinate data?**
No, it uses strict mathematical patterns to ensure 100% accuracy for extraction and validation.

**Is Regex Toolkit good for cleaning CSVs?**
Yes, it is perfect for sanitizing and validating data points like URLs and emails within large datasets.

**Why use this instead of asking the AI to find the emails?**
Because LLMs predict text probabilistically. They might miss emails embedded in weird characters (like `contact@company.com.` with a trailing dot) or hallucinate non-existent addresses. Regex provides mathematical certainty.

**Does the PII masking send data to the cloud?**
Never. The `mask_sensitive_data` tool runs exclusively on your local Javascript engine (V8). It acts as a local firewall, ensuring sensitive strings are redacted before any external processing happens.

**What format of phone numbers are supported?**
The regex captures international formats with country codes (e.g., +1, +55), optional parentheses for area codes, and spacing/hyphens commonly used globally.