Cleaner Code logo

Cleaner Code

by goldmembrane

Locally scans AI-generated code, rules files, and dependencies for hidden threats through six MCP tools.

Install Cleaner Code

Pick your client, then add it in one click or paste the config.

No confirmed install command yet

We only publish a config when the install details come from the project itself — its README, its docs, or a verified owner. We haven’t found those for goldmembrane/cleaner-code, and we’d rather show nothing than a guess you’d paste into your client.

Open setup steps on GitHub

Overview

The goldmembrane/cleaner-code MCP server scans code and AI configuration files for hidden security threats before execution. It combines deterministic static scanners with local CodeBERT analysis and exposes six tools through stdio. Use it when reviewing AI-generated code, project rules, or package dependencies for Unicode attacks, backdoors, obfuscation, and related risks. Node.js 18 or later and an MCP-compatible client are required.

Use cases

  • Scan AI-generated source files for hidden Unicode and obfuscation
  • Inspect project directories before running generated code
  • Check AI rules files for prompt injection and backdoors
  • Review package.json for typosquatting and suspicious scripts
  • Explain detected threat categories and remediation steps

Key features

  • Detects invisible Unicode and Trojan Source patterns
  • Finds homoglyphs and Unicode steganography
  • Scans AI rules files for backdoors
  • Checks package.json dependency risks
  • Runs local CodeBERT analysis
  • Exposes six MCP tools over stdio

Tools6

What Cleaner Code lets your agent do. Expand a tool for its parameters.

Self-reported~140 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

7/7 checks healthy over the last 42d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
Last commit6mo agoMost recent push to the default branch.
Tools exposed6Callable tools this server registers over MCP.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Cleaner Code works

What goldmembrane/cleaner-code MCP server does

The goldmembrane/cleaner-code MCP server provides local security checks for source code, AI assistant rules, and JavaScript package metadata. Its scanners look for hidden or misleading content that ordinary linters may not identify, including invisible Unicode characters, bidirectional control characters, homoglyphs, Unicode steganography, rules-file backdoors, dependency typosquatting, suspicious install scripts, and obfuscation patterns.

The server exposes six MCP tools:

  • scan_file checks one file for hidden malicious-code patterns.
  • scan_directory walks a directory and scans its source files.
  • scan_rules_file checks AI configuration and rules files for prompt injection and rules-file backdoors.
  • check_dependencies inspects package.json for dependency risks, typosquatting, and suspicious install scripts.
  • ai_analyze uses the trained CodeBERT model to classify code chunks as malicious or benign with confidence scores.
  • explain_finding describes a threat category, possible attack scenarios, and remediation steps.

How it works

The goldmembrane/cleaner-code MCP server runs as a local stdio process. An MCP client starts the compiled Node.js entry point and calls the tools during code review or generation. Findings can include severity, line numbers, and remediation guidance.

Detection uses two approaches. Eight deterministic scanners cover known patterns such as Trojan Source bidirectional controls, confusable characters, hidden Unicode, whitespace-based payloads, obfuscation, rules-file attacks, and dependency issues. The CodeBERT analyzer examines code chunks locally and provides a malicious-or-benign classification with a confidence value.

Setup and configuration

Install Node.js 18 or newer, clone the repository, install its packages, and build it:

bash
git clone https://github.com/goldmembrane/cleaner-code.git
cd cleaner-code
npm install
npm run build

Configure the MCP client to launch dist/index.js with Node. The README provides configurations for Claude Code and Cursor using either a user or project MCP configuration file. Replace the example path with the absolute path to the cloned repository, restart the client, and select the available tools.

The repository also documents an optional HTTP API server in its project structure, but the provided MCP setup uses stdio. No environment variables are specified for the MCP server.

Tools and capabilities

Use scan_file for a focused review of one source file and scan_directory for a recursive project-level scan. Use scan_rules_file when reviewing files such as .cursorrules, CLAUDE.md, or other AI configuration files. check_dependencies is specific to package.json and checks package naming and installation behavior.

For cases where static rules may not be enough, ai_analyze applies the CodeBERT model to code chunks. explain_finding is intended for understanding a reported category and its remediation options. Static tools and explanations have no stated usage limit.

Limitations and notes

The goldmembrane/cleaner-code MCP server is designed to detect the categories and patterns implemented by its static scanners and model; it should not be treated as a complete security review. The dependency checker is described for package.json, not arbitrary package-manager manifests.

The project is licensed under ISC. The README names Claude Code, Cursor, VS Code with Copilot, and Cline as compatible clients. The server requires a local Node.js runtime and a built project entry point.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Cleaner Code

goldmembrane/cleaner-code is an MCP server that connects AI clients to local code-security scanners. Its main tools scan files, directories, AI rules files, and package.json files, run CodeBERT analysis, and explain findings involving hidden Unicode, backdoors, dependency risks, and obfuscation.

Install Node.js 18 or later, clone the repository, run npm install, and run npm run build. Configure your MCP client to start the resulting dist/index.js file with Node using its absolute path.

Yes, goldmembrane/cleaner-code works with Cursor. Add a server entry to .cursor/mcp.json that launches dist/index.js with Node, then restart Cursor so the six MCP tools become available.

Yes, its check_dependencies tool examines package.json for typosquatting, suspicious install scripts, and other dependency risks.

The ai_analyze tool includes 10 free runs per session. Static scanning and explanation tools have no stated limits, while higher quotas for AI analysis are available through paid plans described by the project.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCleaner Code AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/goldmembrane-cleaner-code?style=directory)](https://allmcps.com/mcp/goldmembrane-cleaner-code)
HTML Embed
<a href="https://allmcps.com/mcp/goldmembrane-cleaner-code"><img src="https://allmcps.com/api/badge/goldmembrane-cleaner-code?style=directory" alt="Cleaner Code on AllMCPs" /></a>