All tutorials

Cordon for AI agents: the MCP server

Cordon 0.7.03 sections · 2 diagramsView this tutorial on GitHub

Coding agents install packages, load skills and add MCP servers on their own. cordon-scanner mcp lets them ask Cordon first, over the Model Context Protocol, and get the same verdict the CLI, CI and the editor give.

Cordon for AI agents: the MCP server, figure 1
   agent: "npm install [email protected] reqeusts"
     │
     ├─► check_install_command ──► Cordon reads, never runs ──► block: 'reqeusts' is a typosquat
     │                                                           of 'requests'
     └─► tells the user, does not run the command

cordon-scanner mcp config --client <agent> prints the exact configuration for that agent, with the full path of your cordon-scanner:

agentwhere it goes
claude-codeclaude mcp add --scope project cordon -- cordon-scanner mcp, or .mcp.json
claude-desktopclaude_desktop_config.json
cursor.cursor/mcp.json, or ~/.cursor/mcp.json for every project
vscode.vscode/mcp.json -- or nothing: the Cordon extension registers it (tutorial 20)
windsurf~/.config/devin/mcp_config.json
geminigemini mcp add, or .gemini/settings.json
codexcodex mcp add, or ~/.codex/config.toml
zedcontext_servers in Zed's settings
clinecline_mcp_settings.json
continue.continue/mcpServers/cordon.yaml
jetbrainsAI Assistant > Model Context Protocol (the Cordon plugin copies it for you)

The server speaks both protocol eras: the current one (2026-07-28, no handshake) and the initialize handshake of 2025-11-25 back to 2024-11-05, so it works with every agent in use.

before the agent...toolwhat it answers
installs a packagecheck_package, check_packagesmalicious and vulnerable releases (and the fix version), typosquats, names AI assistants invent; online, the published code scanned
runs an install commandcheck_install_commandevery package it names, a second index or custom registry, curl \| sh
picks a versionget_package_advisoriesevery advisory, which affect a version, which versions fix them
loads a skillcheck_skillmalicious instructions, droppers, fake prerequisites, credential theft
follows an instruction filecheck_agent_fileprompt injection, hidden characters, fetch-and-run, approval switched off
adds an MCP servercheck_mcp_server, check_mcp_toolsits launch command and package, secrets in its config, poisoned tool descriptions
installs an extensioncheck_ide_extensiona .vsix, or an id fetched from Open VSX (digest-checked) or the Marketplace
writes a filescan_file_contenta Dockerfile, workflow or manifest checked before it exists
reviews a projectscan_path, find_secrets, list_dependencies, describe_repository, generate_sbom, review_dependency_changes, compare_releases, compare_with_baseline, list_suppressionsthe full scanner, on the workspace
looks widerscan_container_image, scan_machine, list_local_agentsimages, this machine's packages, its agents and MCP servers
explainsexplain_rule, search_rules, intel_status, server_statusrules, intel freshness, what this server may do

Every result carries a verdict: block (the scanner's own failure policy fails it -- do not proceed), warn, pass, or incomplete (something could not be read: never a pass).

Cordon for AI agents: the MCP server, figure 2
┌──────────────────────────────────────────────────────────────────────────────────────┐
│  never     installs, runs what it reads, writes into your project, or changes any    │
│            configuration -- every tool is read-only                                  │
│  reads     only the directories it was started with (--root; default the current     │
│            directory); a symlink out of them, `..`, ~ or /etc is refused             │
│  network   off by default. --allow-online lets tools ask registries; even then a     │
│            name an agent passes in may lead only to the public internet, never to    │
│            10.x, localhost or a cloud metadata address (--allow-private-network     │
│            lifts that for an intranet registry or MCP server)                        │
│  machine   reading this computer's packages and agent configs needs --allow-machine  │
│  quoted    text from scanned files is stripped of invisible characters and marked    │
│            as data, so a poisoned file cannot pass instructions through Cordon       │
│  bounded   a deadline per scan (--timeout), calls per minute (--rate), scans at once │
│            (--max-concurrent); a cancelled call ends its scan's processes            │
│  audit     --audit-log PATH: one line per call -- tool, verdict, duration, never the │
│            arguments                                                                 │
└──────────────────────────────────────────────────────────────────────────────────────┘

A tool that needs a flag the server was not started with is not listed at all, so the agent never sees an option it cannot use.

Next: 31 · Rule files.