--platform ` | Create a new `app`. |
| `redeem-coupon ` | Credit a coupon's `scan` quota to the workspace. |
| `config` / `login` | Manage `token` / `API URL` / `workspace`. |
Global options on every command: `--token`, `--api-url`, `--workspace`, `--json`, `--no-color`, `-v/--verbose`.
## `scan` — add a version and start a scan
```bash
oversecured scan path/to/app.apk 93c92471-fa34-478f-99b4-6def7ff7fea9
```
Obtains an `uploadUrl`, uploads the `binary`, creates the `version` parsed from the file, and starts the `scan`. By default it prints the `scanId` and exits `0`. Add `--wait` to block until the `scan` finishes, and `--fail-on` to gate a build:
```bash
oversecured scan app.apk "$APP_ID" --wait --fail-on high
```
Run static analysis only and skip dynamic analysis (DAST) for this scan:
```bash
oversecured scan app.apk "$APP_ID" --skip-dast
```
Assign report tags while starting a scan. Surrounding whitespace is trimmed and
repeated spaces are collapsed. Letter case, spaces, and hyphens are otherwise preserved:
```bash
oversecured scan app.apk "$APP_ID" --tag release --tag "Mobile Team"
```
| Flag | Default | Meaning |
| --------------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------- |
| `--wait` | off | Block until the `scan` reaches a terminal state. |
| `--fail-on ` | — | Exit non-zero if a `finding` at/above this severity is reported (implies `--wait`). |
| `--skip-dast` | off | Run static analysis only — skip `DAST` for this `scan`. Without it, the app-level `DAST` setting applies. |
| `--mock` | off | Synthetic `scan`, no real upload. |
| `--tag ` | — | Assign a report tag. Repeat the flag to assign multiple tags. |
| `--platform ` | inferred from extension | Force the `platform`. |
| `--timeout ` | `1800` | Max wait when `--wait`. |
| `--poll-interval ` | `5` | Status poll cadence when `--wait`. |
## `status` — get scan status
```bash
oversecured status --app
```
Returns the current scan state. Add `--json` when polling from scripts or MCP clients.
## `report` — download the report
```bash
oversecured report --app --format [--output report.pdf]
```
Without `--output`, text formats print to `stdout` (`--output -` forces `stdout`). `pdf`/`csv` are binary, so give an `--output` path. `--pretty` indents `json` output.
## Report tags
```bash
oversecured scans "$APP_ID" --tag release --tag mobile
oversecured scan-tags "$SCAN_ID" --app "$APP_ID"
oversecured set-scan-tags "$SCAN_ID" --app "$APP_ID" --tag release --tag mobile
oversecured workspace-tags
```
Multiple `--tag` filters on `scans` match reports containing any supplied tag.
Repeat `--tag` to assign or filter by multiple tags. `set-scan-tags` replaces the
complete tag list; omit `--tag` to clear all tags from the report. A report can
have up to 20 tags, with up to 100 characters per tag.
## `findings` — list findings with filters
```bash
oversecured findings \
--app \
[--severity high,medium] \
[--category ] \
[--folder ] \
[--page ] \
[--page-size ] \
[--json]
```
Filters mirror the API: `--severity` (CSV), `--category` (CSV of category UUIDs), `--folder` (folder id). Paginate with `--page` (default `1`) and `--page-size` (default `20`, max `100`). Add `--json` for the machine envelope (`.data.items` / `.data.total`).
## `finding` — get or export one finding
```bash
oversecured finding --scan --app [--json]
oversecured finding --scan --app --format md --output finding.md
```
Without `--format`, returns the full vulnerability (category, evidence, AI description, attachments). With `--format ` it exports a formatted document; `--output ` (or `-` for stdout) sets the destination, and `--pretty` indents JSON.
## `apps` — list apps
```bash
oversecured apps [--json]
```
Lists the workspace's apps so you can look up an `appId`.
## `create-app` — create a new app
```bash
oversecured create-app "Acme Banking" --platform android [--package-name com.acme.banking] [--description "…"]
```
The token needs the **Applications → Create** permission.
## `redeem-coupon` — add scan quota
```bash
oversecured redeem-coupon
```
Redeems a coupon by code, crediting its scan quota to your workspace.
## `config` / `login` — manage credentials
```bash
oversecured login # interactive token entry (local machines)
oversecured config set token osp_xxxx # persist to ~/.oversecured/config.json
oversecured config set api-url http://localhost:3000
```
See [CI/CD](/cli-ci-cd) for pipeline recipes and exit-code handling.
---
# CLI — CI/CD reference (/docs/cli-ci-cd)
CLI exit codes and gating flags.
Exit codes and flags for running `oversecured scan` in a pipeline. For copy-paste GitHub Actions / GitLab configs and the how-to, see the [CI/CD integration guide](/guide-ci-cd).
## Gating flags
`oversecured scan … --wait --fail-on ` blocks until the scan finishes, then sets the exit code from the outcome.
| Flag | Default | Meaning |
|---|---|---|
| `--wait` | off | Block until the scan reaches a terminal state. |
| `--fail-on ` | — | Exit non-zero if a finding at/above this severity (`high`/`medium`/`low`) is reported. Implies `--wait`. |
| `--timeout ` | `1800` (30 min) | Max wait when `--wait`. Raise for long Android scans (e.g. `14400` = 4h). |
| `--poll-interval ` | `5` | Status poll cadence when `--wait`. |
| `--json` | off | Emit the stable result envelope on stdout (progress goes to stderr). |
## Exit codes
| Code | Meaning |
|---|---|
| `0` | Success — no finding met the `--fail-on` threshold. |
| `2` | Usage / validation error. |
| `3` | Authentication error (token invalid / revoked / expired). |
| `4` | Forbidden / not found. |
| `5` | Scan ended in a non-`completed` state, **or** the `--fail-on` threshold was met. |
| `6` | Network / timeout. |
| `7` | Insufficient scan balance (`HTTP 402`) — top up before scanning. |
| `1` | Other error. |
Most pipelines fail on `--fail-on high`. `--fail-on` is severity-only — it counts every finding at/above the level, including ones triaged as false positives. To count only runtime-confirmed (DAST) findings or exclude false positives, build the check yourself — see the [CI/CD integration guide](/guide-ci-cd#custom-conditions-optional).
---
# Connect an AI assistant (/docs/mcp-overview)
Use Oversecured from Codex, Claude, Cursor, and other MCP-compatible AI assistants.
The Oversecured MCP server lets an AI assistant list your apps, start scans,
check their status, and retrieve reports and findings.
You do not need to install the Oversecured CLI or host the MCP server. Your AI
client starts the published package locally through `npx`.
## Before you start
You need:
- Node.js 20 or newer;
- an MCP client with local stdio server support;
- a workspace API token created under **Workspace settings → API tokens**.
Keep the token in the MCP server environment. Do not paste it into prompts,
commit it to a repository, or include it in screenshots.
## Install
Choose your AI client and add the Oversecured MCP server.
1. Open **Settings → MCP servers**.
2. Select **Add server** and choose a local stdio server.
3. Set **Command to launch** to `npx`.
4. Add two separate arguments: `-y` and `@oversecured/mcp@latest`.
5. Add `OVERSECURED_API_TOKEN` under **Environment variables**.
6. Leave **Working directory** empty, or select a directory that exists.
7. Save the server, enable it, and open a new task.
Do not put the entire `npx -y @oversecured/mcp@latest` string into the command
field. `npx` is the command; the other two values are arguments.
Open **Settings → Developer → Edit Config** and add:
```json
{
"mcpServers": {
"oversecured": {
"command": "npx",
"args": ["-y", "@oversecured/mcp@latest"],
"env": {
"OVERSECURED_API_TOKEN": "osp_xxxxxxxx"
}
}
}
}
```
Save the file and restart Claude Desktop completely.
Open **Cursor Settings → MCP**, add a new global MCP server, and use:
```json
{
"mcpServers": {
"oversecured": {
"command": "npx",
"args": ["-y", "@oversecured/mcp@latest"],
"env": {
"OVERSECURED_API_TOKEN": "osp_xxxxxxxx"
}
}
}
}
```
Save the configuration, enable the server, and open a new chat.
Use the client's local stdio server configuration:
```json
{
"mcpServers": {
"oversecured": {
"command": "npx",
"args": ["-y", "@oversecured/mcp@latest"],
"env": {
"OVERSECURED_API_TOKEN": "osp_xxxxxxxx"
}
}
}
}
```
If the client uses separate form fields, enter `npx` as the command and add
`-y` and `@oversecured/mcp@latest` as separate arguments. On Windows, the
command may be `npx.cmd`.
For an on-prem installation, add the platform API origin to the same environment
block:
```json
{
"env": {
"OVERSECURED_API_TOKEN": "osp_xxxxxxxx",
"OVERSECURED_API_URL": "https://platform.example.internal/api"
}
}
```
The package contains the matching Oversecured CLI binary, so no separate CLI
installation or configuration is required.
## Verify the connection
Restart the client, open a new chat or task, and ask:
> Show my Oversecured applications.
The assistant should call `list_apps` and return applications from
the workspace associated with the token. If it runs shell commands or sends
JSON-RPC manually instead, the MCP server is not connected correctly.
You can then try a complete flow:
> Start a SAST-only scan of `/absolute/path/app.apk`, wait for it to finish, and
> show me the findings.
Use an absolute file path visible to the machine running the MCP client.
## Available tools
| Tool | Description |
| --------------------- | ---------------------------------------------------------------------- |
| `list_apps` | List apps in the token's workspace. |
| `create_app` | Create an Android or iOS app. |
| `start_scan` | Upload a binary and start a scan. |
| `list_scans` | List scans, optionally filtered by report tags. |
| `get_scan_status` | Read the current scan state and progress. |
| `get_scan_tags` | List tags assigned to a scan report. |
| `set_scan_tags` | Replace all tags assigned to a scan report. |
| `list_workspace_tags` | List report tags used in the token's workspace. |
| `get_report` | Download a report to a local file. |
| `list_findings` | List findings with severity, category, folder, and pagination filters. |
| `get_finding` | Read or export one finding. |
| `redeem_coupon` | Redeem scan quota. |
Report tags preserve letter case, spaces, and hyphens. The platform only trims
surrounding whitespace and collapses repeated spaces. `set_scan_tags` replaces
the complete tag list; pass an empty list to clear it.
`start_scan` returns as soon as the scan is queued unless `wait` is
`true`. For a long-running scan, the assistant can check
`get_scan_status` until the scan finishes, then retrieve its report
or findings.
Downloaded reports are written to a unique directory under the operating
system's temporary directory. The tool returns the absolute path, and the
temporary output is removed automatically after one hour.
## Authentication
The MCP server reads credentials only from its process environment and ignores
the local CLI configuration file:
| Variable | Purpose |
| -------------------------- | -------------------------------------------------------------- |
| `OVERSECURED_API_TOKEN` | Workspace API token. |
| `OVERSECURED_API_URL` | Optional API override for on-prem or local development. |
| `OVERSECURED_WORKSPACE_ID` | Optional workspace override; normally resolved from the token. |
Tokens are not accepted as tool arguments and are not returned in tool results.
Create a dedicated workspace API token and grant only the permissions required
for the operations you plan to use.
## Troubleshooting
### The server is enabled, but Oversecured tools are missing
- Open a new chat or task after enabling the server. Existing conversations may keep the tool list they started with.
- Confirm that the working directory is empty or points to a directory that exists.
- Confirm that `npx -y @oversecured/mcp@latest` starts in a terminal.
### The client cannot find `npx`
GUI applications may not inherit the shell environment when Node.js was
installed through `nvm`. On macOS or Linux, configure the server to start
through the shell instead:
```json
{
"command": "/bin/zsh",
"args": [
"-lc",
"source \"$HOME/.nvm/nvm.sh\" && nvm use --silent 20 && exec npx -y @oversecured/mcp@latest"
]
}
```
Replace `20` with another installed Node.js version if needed.
### Authentication or API errors
- **`NO_TOKEN`:** add `OVERSECURED_API_TOKEN` to the MCP server environment and restart the client.
- **Authentication error:** verify that the token is active and belongs to the expected workspace.
- **App forbidden or not found:** list apps first and use an app ID available to the token.
- **On-prem connection failure:** set `OVERSECURED_API_URL` to the platform API origin.
If a token was exposed in a prompt, terminal output, or screenshot, revoke it
and create a new one.