Sunglasses is a filter that sits ahead of your Cline agent. Always ON. Every file read, tool output, or web page your Cline agent touches — the filter scans first. This page walks through the Cline MCP wiring.

Who this page is for

Cline users running autonomous coding agents in VS Code. Cline reads files, executes commands, and calls tools — each is an attack surface. The filter sits between every untrusted input and the agent's action decision.

The command

# In your Cline MCP settings (~/.cline/mcp-settings.json): { "mcpServers": { "sunglasses": { "command": "python", "args": ["-m", "sunglasses.mcp"] } } }

Register Sunglasses in Cline's MCP config. Cline reads MCP server configs from its settings file. Add the sunglasses entry, restart VS Code, and Cline's agent has the scan tool available for every file read, tool call, and web fetch.

Benefit: Cline is open source and you run it locally. Sunglasses fits the same model — local filter, local agent, no cloud round-trip.

Install Sunglasses first

If you haven't installed Sunglasses on your machine yet, do this first in a fresh terminal:

python3 -m venv sunglasses-env
source sunglasses-env/bin/activate
pip install --upgrade sunglasses

On modern macOS and many Linux systems, your system Python may block direct installs. A small virtual environment keeps the install clean. Windows: replace source sunglasses-env/bin/activate with sunglasses-env\Scripts\activate.

Full walkthrough in progress. The core command and identity are ready. Detailed step-by-step screenshots, real-world attack examples, and troubleshooting are being added.

FAQ

How do I protect my Cline VS Code agent from prompt injection?

Add Sunglasses to Cline's MCP settings file with command 'python' and args ['-m', 'sunglasses.mcp']. Cline's agent gets a scan tool it can call before acting on untrusted file content or tool output.

Does Sunglasses slow down Cline's code actions?

Average scan time is 0.26ms. Even on long sessions with many tool calls, the filter overhead is negligible.

Can I force Cline to scan every file before reading?

Add a rule in your Cline system prompt telling the agent to call sunglasses.scan_text before acting on any file content or tool response. That makes scanning mandatory.

Does this work with Cline's auto-approve mode?

Yes — and it's especially valuable in auto-approve mode. The filter catches hidden attacks in file content, so the agent doesn't silently execute instructions planted by an attacker.

Is the filter local?

Yes. Sunglasses runs entirely on your machine. No cloud, no API key, no telemetry.

Where this wiring fits

Sunglasses is one filter with many wiring options. This page covers Cline. Other wiring paths:

Same filter underneath. Different wiring based on your stack.