# Ghostchars

> Ghostchars is an open-source MCP server for security. Find and strip zero-width, bidi and tag characters hidden in text, offline. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Windows, Linux
- **Website:** https://ghostchars.com/en/cli/
- **Repository:** https://github.com/ghostchars/ghostchars/tree/HEAD/cli
- **MCP Registry name:** io.github.ghostchars/ghostchars
- **Categories:** security, developer tools
- **Listing updated:** 2026-11-16

## About

Hidden Unicode can carry tag-character smuggling, bidirectional tricks or look-alike letters, and this tool inspects text for them without touching the network. Ghostchars ships as one npm package with a CLI, a CI gate and an MCP server, needing Node 22 or newer and no runtime dependencies. The README says nothing leaves the machine and there is no telemetry.

Four commands share one engine. clean rewrites text or files atomically, and clean and inspect also open .docx, .odt and .html. inspect lists each odd character with line, column, codepoint, Unicode name and the switch that would act on it. report scores machine-writing habits such as sentence uniformity, stock transitions, dash density and hedging, and is explicitly not a detector. check holds a tree to a named bar for CI and can output SARIF for GitHub code scanning. Thirteen switches cover things like confusables, normalisation and punctuation.

Over MCP it exposes four read-only tools, clean_text, inspect_text, style_report and check_paths, plus clean_files for disk writes only under --allow-write. Skill files, a Claude Code PostToolUse hook and a pre-commit hook ship alongside. The package is free under the MIT licence; a separate Mac app has a one-time $24 Pro tier.

## Features

- **Invisible character cleanup:** Strips zero-width, bidi, tag and format characters.
- **Inspect mode:** Lists each suspicious character with its position and name.
- **CI gate:** check exits 1 on findings and emits SARIF for code scanning.
- **Document support:** Cleans .docx, .odt and .html structurally.
- **Prose habits report:** Measures machine-writing tells without claiming detection.
- **Agent hooks:** Skill files, Claude Code and pre-commit hooks included.

## Good for

- Block hidden prompt-injection characters in a repository
- Clean pasted text before publishing
- Audit a draft for look-alike letters
- Run a gate in CI with inline pull request annotations

## Install

### Claude Code (Terminal)

```sh
claude mcp add ghostchars -- npx -y ghostchars
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "ghostchars": {
      "command": "npx",
      "args": [
        "-y",
        "ghostchars"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "ghostchars": {
      "command": "npx",
      "args": [
        "-y",
        "ghostchars"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "ghostchars": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "ghostchars"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "ghostchars": {
      "command": "npx",
      "args": [
        "-y",
        "ghostchars"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "ghostchars": {
      "command": "npx",
      "args": [
        "-y",
        "ghostchars"
      ]
    }
  }
}
```

## Tools

- `clean_text`: Remove invisible Unicode characters from text
- `inspect_text`: List suspicious characters with line, column, codepoint and name
- `style_report`: Measure habits that make a draft read as machine written
- `check_paths`: Check files or a tree against a cleaning bar
- `clean_files`: Rewrite files on disk, available only with --allow-write

## FAQ

### Does it send my text anywhere?

No. The README says it runs offline with no network calls or telemetry.

### What does it need?

Node 22 or newer, run with npx -y ghostchars.

### Can the MCP server write files?

Only if started with --allow-write; the other four tools are read-only.

### Is it free?

The package is MIT licensed and free; the Mac app has a separate $24 Pro licence.

### Is Ghostchars free?

Yes. Ghostchars is open source, so you can use and self-host it for free.

### How do I add Ghostchars to Claude Code?

Run this command in your terminal: claude mcp add ghostchars -- npx -y ghostchars

### What are the best alternatives to Ghostchars?

The closest alternatives to Ghostchars are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/ghostchars
