Ghostchars
Find and strip zero-width, bidi and tag characters hidden in text, offline
- Pricing
- Open source
- Platforms
- CLI, macOS, Windows
- Runs
- Locally
- Version
- 1.0.2
- Listing updated
- 1 day ago
About Ghostchars
Ghostchars is an open-source MCP server for security. It runs locally on your machine and is started by your AI client.
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.
Install
Run in a terminal
claude mcp add ghostchars -- npx -y ghostcharsAdd to claude_desktop_config.json
{
"mcpServers": {
"ghostchars": {
"command": "npx",
"args": [
"-y",
"ghostchars"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"ghostchars": {
"command": "npx",
"args": [
"-y",
"ghostchars"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"ghostchars": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"ghostchars"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"ghostchars": {
"command": "npx",
"args": [
"-y",
"ghostchars"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"ghostchars": {
"command": "npx",
"args": [
"-y",
"ghostchars"
]
}
}
}Tools this server provides (5)
Taken from the project documentation; the running server may differ.
- 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
What it does
- 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
Pricing
Open source
MIT licence; separate Mac app Pro licence is a one-time $24
Prices change. Check ghostchars.com before you buy.
Ghostchars 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 to Ghostchars

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

GitHub
MCP serverOfficial MCP server connecting AI assistants to GitHub repos, issues and workflows
Not checked yet- Remote
- Open source
- 34.5K GitHub stars
- Developer tools

Serena MCP: the IDE for your agent
MCP serverMCP toolkit giving coding agents symbol-level code retrieval and editing
Runs locally- Open source
- 31.5K GitHub stars
- Developer tools

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Ouroboros
MCP serverSpec-first layer that pins requirements and verifies results of AI coding agent work
Runs locally- Open source
- 6.4K GitHub stars
- Developer tools