• CLEAN
  • VALID
  • LOG
  • REVIEW

How to sanitize user comments with your AI

Connect this MCP once to give your agent the ability to scrub dangerous HTML from incoming text. It cleans the code so you can save it safely.

Ask AI about this page

Short answer

How do I sanitize user comments with my AI?

Your AI uses the sanitizeHtml_html tool to strip out script tags and malicious injections from raw HTML strings. This ensures only safe, readable content is passed to your database. You'll see how the cleaning process works below.

The results of clean input.

Where your data lands.

Once the AI processes your text, you get these results.

CLEAN

Safe HTML strings

The AI removes all script injections and dangerous tags. You get back a clean string ready for storage.

VALID

Preserved formatting

Standard tags like bold or italics stay intact. The AI keeps the look of the comment without the risk.

LOG

Audit trail

You can ask your AI to show you exactly what was removed. This helps you track attempted attacks.

REVIEW

Human oversight

If a comment looks suspicious but isn't a script, the AI flags it for you. You decide if it stays or goes.

The workflow

What your AI does when a comment arrives.

The AI acts as a gatekeeper between the user and your database.

  1. Receive raw input

    Your agent pulls the unverified comment string from your application or database.

    sanitizeHtml_html
  2. Scrub malicious code

    The AI runs the string through the sanitizer to strip out any XSS payloads or script tags.

    sanitizeHtml_html
  3. Verify the output

    The agent checks the cleaned string to ensure it matches your expected formatting rules.

    sanitizeHtml_html
  4. Finalize the data

    The AI hands the sanitized text back to you, ready to be written to your permanent storage.

    sanitizeHtml_html

Try it

Copy these to start.

Use these prompts to kick off the sanitization process.

Starting points

These are starting lines. Replace the bracketed text with your actual data or source.

Sanitize HTML Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_wOJVwhEm2CsSI6rmzlbp7pTP6UdMKdT328oW1l5P/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — Sanitize HTML capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "html-xss-sanitizer-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_wOJVwhEm2CsSI6rmzlbp7pTP6UdMKdT328oW1l5P/mcp"
    }
  }
}
Copy into chat04
  • Sanitize this comment for me: [paste HTML here]

  • Check this comment from my WordPress site for any malicious scripts: [paste comment]

  • Clean the HTML in this list of user feedback entries: [paste list]

  • Look at this raw input from my contact form and strip any dangerous tags: [paste input]

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect HTML XSS Sanitizer once, then ask.

Just link the MCP to your client. Your credentials stay encrypted, and you can start cleaning code immediately.

Connect HTML XSS Sanitizer to your AI

FAQ

How this task behaves.

  • 01

    Does the AI delete the original comment?

    No. The AI only processes the text you provide. It does not have permission to delete records from your database.

  • 02

    Will it remove all HTML tags?

    No. It only removes dangerous tags like <script>. It is designed to keep safe formatting tags intact.

  • 03

    Can the AI fix broken HTML?

    No. The tool focuses on removing malicious content, not repairing malformed or broken HTML structures.

  • 04

    Does it work on images too?

    No. This tool is specifically for sanitizing HTML strings to prevent script injections.

  • 05

    Can I see what was stripped out?

    Yes. You can ask your agent to show you the differences between the original and the sanitized version.

  • More questions about HTML XSS Sanitizer? The Connector page answers them. See everything the HTML XSS Sanitizer Connector can do

Connect Sanitize HTML to Claude, Cursor, ChatGPT & more