Guardian CLI tool
Setup Details
Create your account, add your first MCP server, run your first scan and test, and find your results on the dashboard.
Guardian Samurai checks your MCP servers for security problems and tests that their tools behave correctly. This guide takes you from a new account to your first results in the web app. To start with the CLI instead, see Quick Start.
Create your account
- Go to Sign up. New accounts start on the Free plan, and no credit card is needed.
- Enter your work email and select Continue, or sign up with Google.
- Open the confirmation link we email you, then enter your name, your company name and a password.
Your company name becomes your organization in Guardian Samurai, and you're its Admin. You can invite teammates later from the Team page.
Add your first MCP server
Save the servers you work with once, and everyone in your organization can use them.
- Select Samurai Quality in the header to open MCP Servers.
- Select Add new.
- Give the server a Label, such as
GitHub production. This is the name it goes by in your lists. - Paste the server's URL, such as
https://example.com/mcp, or its JSON configuration. If your server needs an authentication token, include it in the JSON headers. If the JSON already names the server, that name fills in the label. - Choose the options below, then select Save server.
Secrets you save, such as tokens in the URL or headers, are stored encrypted. When you edit a server later, you see the secrets you typed yourself. Teammates see •••••••• in their place and can keep or replace them.
Production server
Check Production server if the server is deployed and reachable from the internet. Only production servers can be scanned from the Guardian Samurai web app, and they're the ones listed on the MCP Scan page. Leave it unchecked for a server still in development that isn't reachable from outside. You can test those from your own machine with the CLI. It's unchecked by default, and you can change it whenever you edit the server.
Set as CLI default
Make a saved server your CLI default, then test it with a plain guardian test.
- Open MCP Servers under Assets in the menu on the left.
- Add a server, or edit one you already saved.
- Check Set as CLI default.
- Select Save server.
The server's row now shows the CLI default badge. Once your CLI has used it, the row also shows "Last used by your CLI: …". To clear the default, edit the server, uncheck the box and save.
- Each person has their own CLI default, and you can have at most one. Choosing a new one replaces the old one.
- You don't need a default. With none set, give the CLI a server each time you run it.
- It works for URL (http) servers whose secrets you typed yourself. If someone else entered the secrets, enter them yourself to use the server as your default.
- Admins, Managers and Engineers can set a CLI default.
Run the test. You need the CLI installed and signed in (see Quick Start). For a server on your own machine (localhost, 127.0.0.1 or [::1]), run:
guardian test
For any other host, name it with --allow-target. The flag is needed on every run, and the CLI never adds it for you:
guardian test --allow-target mcp.example.com
What you'll see. First the CLI shows the server: server: <name> (Guardian CLI default), its origin, the date it was last edited and the names of its headers (never their values). Then it asks:
connect to this server from your Guardian CLI default? [y/N]
After you confirm, Guardian plans the test from the server's tools, and the usual preview and prompt follow. The test runs on your machine and the results upload to Test history by default. Add --no-upload to keep them local.
Limits.
- It needs a terminal, because you confirm the server first.
--yes, CI or a pipe exits with code 3. In CI, name the server instead:
guardian test X --config mcp.json --yes
--header,--header-env,--pass-env,--clientand--configare refused. The headers come only from the saved server.- The server's URL and header values are fetched on every run. They are never stored or printed.
If something goes wrong.
no CLI default set: set one on the MCP Servers page, or give a server name, --stdio, --target-url or --plan: set one on MCP Servers as above.your CLI default changed since you set it: set it again on MCP Servers: open MCP Servers and set it again.- Exit code 4: the host isn't allowed. Add
--allow-target HOSTwith the server's host.
See Run tests locally for how to install and sign in to the CLI.
Run your first scan
A scan checks a server's security posture and gives it a score and a security level.
- Go to MCP Scan in the Samurai Quality menu on the left.
- Find your server in the Production servers table. If it isn't there, edit it on MCP Servers and check Production server.
- Select Scan. The results fill in on the same page, and the run is saved to your scan history.
See Run your first scan for the full walkthrough and how to read the results.
A scan only sends a few read-only requests. It lists the server's tools, checks how the server handles authentication and which security headers it returns, and runs a browser-style CORS check. It never runs the server's tools or sends attack payloads. Only scan servers you own or have permission to scan.
Run your first test
A test goes further than a scan and calls the server's tools for real. Go to MCP Test in the Samurai Quality menu, choose your test categories and select Test. See Run your first test for the full walkthrough and what each category checks.
Check your dashboard
The Dashboard brings your results together. It shows your total scans and tests, your open findings and compliance score, and your most recent scans and tests. Every run you make from your account is saved there.
Try it without an account
The free scan and test pages work without signing in. They don't save your results, and the free test page runs functional tests only.