# Netskope MCP Server (UAP POC) — instructions for AI agents

> **Netskope internal use only — not for customers.** Feedback and problems: Slack **#netskope-hosted-mcp-server-interest-group**.
> Human-readable guide: https://mcp-poc.netskope.tech/ · This file: https://mcp-poc.netskope.tech/agents.md · Generated 2026-11-25.

You are an AI agent helping a Netskope employee connect to and use the Netskope MCP server (Unified API Platform proof of concept). Part 1 is how to add the server to the user's tools — check for an existing Tech Preview first, then ask only for what's missing, configure, and test. Part 2 is how to use it well. Follow both.

---

## Part 1 — Add the server

### 1.1 Check for an existing Netskope MCP Tech Preview

Before asking the user anything, look for an MCP server already configured against **`mcp-preview.goskope.com`** (the Netskope MCP Tech Preview). Check every place your client keeps MCP servers, for example:

| Client | Where to look |
|---|---|
| Claude Code | `claude mcp list` (then `claude mcp get <name>`); `~/.claude.json`; `.mcp.json` in the project |
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` · `%APPDATA%\Claude\claude_desktop_config.json` |
| Cursor | `~/.cursor/mcp.json`, `.cursor/mcp.json` |
| VS Code | `.vscode/mcp.json`, user settings (`mcp`) |
| Gemini CLI | `~/.gemini/settings.json` |

**If you find one**, its URL has the form `https://mcp-preview.goskope.com/{tenant}/{access_code}/mcp`:
1. Take `{tenant}` and `{access_code}` from that URL, and note how it supplies the token (an environment variable such as `${NETSKOPE_API_TOKEN}`, an input prompt, or a header value).
2. Tell the user what you found (the tenant and the server name — never the token) and **ask whether they want to add the UAP POC as well**. Explain that it uses the same tenant, access code and token, and runs alongside the Tech Preview without changing it.
3. If they agree, add a **new** server named `netskope-poc` (keep the existing preview entry as it is) with the URL `https://mcp-poc.netskope.tech/{tenant}/{access_code}/mcp` and **the same token reference** the preview uses — configure it as in 1.4, in the same client, then test it as in 1.5. If they decline, stop.

**If you find none**, go to 1.2.

### 1.2 Ask the user for what you need

| Input | Example | Notes |
|---|---|---|
| Tenant hostname | `mytenant.goskope.com` | The Netskope tenant to work on. |
| Access code | `a1b2c3` | 6 hex characters, tied to the tenant. It is the **same code as for the MCP Tech Preview** (`mcp-preview.goskope.com`). If they don't have one, they ask in **#netskope-hosted-mcp-server-interest-group** — you cannot work it out yourself. It is a temporary preview gate, not a secret or a security control — the token is what grants access. |
| REST API v2 token | — | Created in the tenant under Settings → Tools → REST API v2. A read-only token is the safest start. Prefer that the user sets it as the environment variable `NETSKOPE_API_TOKEN` (or enters it in the client's secret prompt) rather than pasting it into chat. If they do paste it, use it only in the client configuration, never repeat it back, and never write it to a file that could be committed or shared. |

### 1.3 Build the URL

```
https://mcp-poc.netskope.tech/{tenant}/{access_code}/mcp
```

`{tenant}` = the hostname with `.goskope.com` removed, then every remaining `.` replaced by `_`. Hostnames outside `goskope.com` keep their full domain.

| Hostname | {tenant} |
|---|---|
| `mytenant.goskope.com` | `mytenant` |
| `eurocorp.eu.goskope.com` | `eurocorp_eu` |
| `aitest01-qa01.qa.boomskope.com` | `aitest01-qa01_qa_boomskope_com` |

Only `*.goskope.com` and `*.boomskope.com` tenants are accepted. One server entry per tenant — a token from another tenant is rejected.

### 1.4 Configure the client

Transport: MCP **Streamable HTTP**. Auth: header `Authorization: Bearer <token>`. Name the server `netskope` (or `netskope-<tenant>` when the user has several).

**Claude Code**
```bash
claude mcp add --transport http --scope user netskope \
  https://mcp-poc.netskope.tech/{tenant}/{access_code}/mcp \
  --header "Authorization: Bearer ${NETSKOPE_API_TOKEN}"
```

**Claude Desktop** — `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows); needs Node.js:
```json
{ "mcpServers": { "netskope": {
  "command": "npx",
  "args": ["mcp-remote", "https://mcp-poc.netskope.tech/{tenant}/{access_code}/mcp", "--header", "Authorization: Bearer ${NETSKOPE_API_TOKEN}"],
  "env": { "NETSKOPE_API_TOKEN": "<set by the user>" } } } }
```

**Cursor** — `~/.cursor/mcp.json`:
```json
{ "mcpServers": { "netskope": {
  "url": "https://mcp-poc.netskope.tech/{tenant}/{access_code}/mcp",
  "headers": { "Authorization": "Bearer ${env:NETSKOPE_API_TOKEN}" } } } }
```

**VS Code** — `.vscode/mcp.json`:
```json
{ "inputs": [{ "type": "promptString", "id": "netskope-token", "description": "Netskope REST API v2 token", "password": true }],
  "servers": { "netskope": { "type": "http",
    "url": "https://mcp-poc.netskope.tech/{tenant}/{access_code}/mcp",
    "headers": { "Authorization": "Bearer ${input:netskope-token}" } } } }
```

**Gemini CLI** — `~/.gemini/settings.json` (keep existing settings): `"mcpServers": { "netskope": { "httpUrl": "<url>", "headers": { "Authorization": "Bearer <token>" } } }`.

Rules: never write a literal token into a file that could be committed or shared; prefer environment variables or the client's secret input. Restart the client if it needs it.

### 1.5 Test it

1. **Access code and tenant** (if you have a shell) — an MCP `initialize` must return **200**; **403** means the access code doesn't match the tenant in the URL:
   ```bash
   curl -s -o /dev/null -w "%{http_code}\n" -X POST "https://mcp-poc.netskope.tech/{tenant}/{access_code}/mcp" \
     -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" \
     -H "Authorization: Bearer ${NETSKOPE_API_TOKEN}" \
     -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"setup-check","version":"1"}}}'
   ```
2. **Connected** — the client lists the server as connected (Claude Code: `claude mcp list`), with exactly three tools: `query`, `execute_read`, `execute_change`. Some clients need a restart first.
3. **Token accepted** — call `query()`. It resolves the token's identity on the tenant and lists the workflows available. If it says the tenant "rejected this token", the token is wrong, expired, or from another tenant.
4. **A real read** — e.g. `execute_read({prompt: "iap:list_policy_groups"})` or ask "list my Internet Access policy groups". If calls fail with 403 although `query()` worked, the token may restrict source IPs: allowlist the server's egress IP `3.17.22.131/32`.
5. Tell the user it's ready and suggest a first question, e.g. *"What can I do on my Netskope tenant?"*

---

## Part 2 — Use the server

### 2.1 The three tools

| Tool | Use it to | Approval |
|---|---|---|
| `query` | Discover: `query()` workflows · `query({search})` find workflows/recipes by keyword · `query({intent})` a workflow's guidance and recipes · `query({prompts})` list recipes · `query({capabilities})` raw API signatures per domain · `query({schema})` event-search fields · `query({debug})` explain a run | read-only |
| `execute_read` | Run a recipe (`prompt` + `args`) or free-form TypeScript (`code`) that only **reads**. Any call that would change the tenant is refused before it is sent. | read-only |
| `execute_change` | The **only** way to change the tenant. Requires `summary` (one plain-language line, shown in the user's approval prompt and kept in the audit log). `preview: true` shows the first change's exact request without sending it. | always ask |

### 2.2 How to work

1. **Discover before you act.** Never guess recipe names or API fields — use `query({search: "<topic>"})` or `query({intent: "<id>"})`. Recipes marked **[change]** run with `execute_change`; everything else with `execute_read`.
2. **Use recipes — don't write code.** Recipes are reviewed, validate input, look objects up by exact name across all pages, and refuse duplicates. On this POC tokens get `recipes_only` by default: every recipe and discovery query, **no free-form code**. For event data (alerts, app activity, DLP incidents, web, network, client status, endpoint DLP) use **`events:search`** with arguments — `type`, `query` (JQL), `fields`, `groupbys`, `orderbys`, `hours`/`days`, `limit` — after checking fields with `query({schema: "<type>"})`; aggregate with `groupbys` instead of listing raw events. If code is refused (`Not permitted (policy_violation)`), don't retry or work around it: use recipes. Code access exists only for recipe authors (ADEM metrics currently need it — say so if asked).
3. **Reading in code (recipe authors only):** get signatures from `query({capabilities: "<domain>"})`, do the joining and aggregating **inside the code**, and `console.log` only the compact result. Filter on the server (name filters, time ranges, `groupbys`) instead of fetching everything.
4. **Changing the tenant:**
   - Confirm with the user before any change you were not explicitly asked to make.
   - Use `preview: true` first for deletes, bulk changes, or anything unconfirmed, and show the user the planned request.
   - Write a specific `summary`, e.g. `"Delete custom category 'Test_01'"`.
   - Changes **apply immediately** by default. Pass `args.interactive: true` only when the user wants to stage changes for review; staged changes are **not enforced** until deployed.
   - To deploy staged work: `profiles:deploy` first (policy objects), then `iap:deploy` (rules), because rules reference the objects. On shared tenants pass the `names` (or `ids`) you staged — an unscoped `profiles:deploy` deploys **everyone's** pending objects.
   - Changing or deleting an object that is still pending needs `interactive: true`, or deploy it first.
   - Before creating an Internet Access rule, check support with `iap:rule_schema` or `iap:create_rule` with `validate_only: true`.
5. **Report results plainly:** what changed (ids, names), what was staged, and what was not done and why.

### 2.3 When something goes wrong

1. Call `query({debug: "last"})` (or pass the `execution_id` shown under the result) **before retrying**. It reports what was expected, each API call and its status, where it stopped, what changed, and what to check.
2. Act on it: fix the arguments, ask the user, or explain the limit. Do not loop on the same failing call.
3. If it is not explained, tell the user to post the `execution_id` in #netskope-hosted-mcp-server-interest-group. Never include the API token in a report.

| You see | It means | Do |
|---|---|---|
| `API rate limit exceeded (HTTP 429)` | The tenant's gateway limited the endpoint; the server already retried. | Wait about a minute; use name filters to make fewer calls. Don't retry in a loop. |
| `licensed feature` / `forbidden` (403) on one capability | The catalog includes it, but the tenant isn't licensed or the token's role can't use it. | Tell the user; don't work around it. |
| `non-interactive operation on pending … (409)` | The object has staged changes. | Re-run with `interactive: true`, or deploy first. |
| `Not sent — needs execute_change` | A read run tried to change something. | Re-run with `execute_change` and a `summary`. |
| `Not permitted (…)` | The token's access policy refused it. | Follow the route the message names (usually a recipe); don't try to bypass it. |
| `wrong_tool` | A read-only recipe was sent to `execute_change`. | Use `execute_read`. |

### 2.4 Platform limits (say so; don't guess)

- **Recurring schedules** (time-of-week): the API takes one absolute window, `schedule {start_time, end_time}` as `YYYY-MM-DDTHH:MM`. Apply the window if there is one and report the recurring part as not supported.
- **Isolate (Remote Browser Isolation):** not an access action — a separate rule goal, `rbi`, that needs the RBI license. Check with `iap:rule_schema` and `goal: "rbi"`.
- **URL lists:** use destination profiles instead; they replace URL lists, including inside custom categories.
- **API catalog snapshot:** the server's catalog reflects the published REST API v2 OpenAPI specs as of **October 23, 2026**. It may include endpoints the tenant isn't licensed for or the token can't use (HTTP 403); endpoints published later aren't available yet.
- **Sandbox limits per run:** 30 s, 50 API calls, 5 MB of API data, 100 KB of output, 10,000 credits.

### 2.5 Access policies

The token's own RBAC role on the tenant decides what can be read or changed — the MCP does not. A read-only service account cannot change anything; a change it attempts is refused by the tenant, and you should tell the user that. The MCP's own mode only decides whether free-form code may run.

| Mode | Discovery | Read recipes (incl. `events:search`) | Change recipes | Free-form code |
|---|---|---|---|---|
| `recipes_only` (**everyone**) | ✓ | ✓ | ✓ (if the token's role allows) | — |
| `codemode_read` (recipe authors) | ✓ | ✓ | ✓ | reads only |
| `codemode_full` (recipe authors, dev/test tenants) | ✓ | ✓ | ✓ | reads and changes, `confirm: true` |

Refused code is logged (redacted) as demand for new recipes. If a request is refused, explain the mode to the user rather than trying another route around it.

### 2.6 The command line (`skope`) instead of the MCP

*Written to ISO 24495-1:2023 (plain language).*

**In short:** `skope` is a command-line client for the same server. It uses the same tenant, access code and token, and every call is checked against the token's RBAC, recorded and metered. If you work in a shell and `skope` is installed, run `skope agents` and follow its instructions. **Netskope internal use only — not for customers.**

**When to use which**

- **Use the CLI** when you work in a shell (Claude Code in a terminal, a script) and you need one exact API call (`skope call <capability_id>`), a published recipe with `--json` output and stable exit codes (`skope run <recipe_id>`), or you want to find an operation by name (`skope ops "<words>"`).
- **Use the MCP** when the user's client has it configured and they ask in plain language. The MCP stays recipes-only by default; the CLI does not change that.

**How to work with it**

1. Run `skope agents` for the full instructions (discover → preview → act, `--json`, exit codes, when to stop and ask) and follow them.
2. If a command exits 3, the user is not signed in. Ask them to run `skope auth login` in their own terminal.

   > **Warning — the token.** Never ask for, print or pass the API token. `skope` reads it from the OS keychain or `NETSKOPE_API_TOKEN`, and there is no `--token` flag.

3. Before any change, preview it (`skope call … --dry-run`, `skope run … --preview`) and show the user the planned request.

   > **Warning — changes.** Pass `--yes` only after the user agrees to that change. Without a terminal and without `--yes`, a change exits 7 and nothing is sent.

**If `skope` is not installed,** tell the user how to install it. Don't install it for them without asking. They need the GitHub CLI `gh`, signed in with access to the netSkope org, because the repo is internal:

- macOS: `gh api -H "Accept: application/vnd.github.raw" repos/netSkope/netskope-cli/contents/install.sh | bash` → `~/.local/bin/skope`
- Windows (PowerShell): `gh api -H "Accept: application/vnd.github.raw" repos/netSkope/netskope-cli/contents/install.ps1 > "$env:TEMP\skope-install.ps1"; powershell -NoProfile -ExecutionPolicy Bypass -File "$env:TEMP\skope-install.ps1"` → `%LOCALAPPDATA%\skope\bin\skope.exe`
- Or download by hand from https://github.com/netSkope/netskope-cli/releases and check the `.sha256`. Details: https://github.com/netSkope/netskope-cli/blob/main/docs/install.md

**Updates** come from GitHub Releases for now: the user runs the install script again. `skope update` refuses in 0.1.0 (exit 5 `update_test_key` on macOS, `update_unsupported_platform` on Windows); don't retry it.

**Already settled**

- **Why `gh`?** The CLI repo is internal, so every download needs a GitHub sign-in with netSkope org access. The netSkope docshare CLI installs the same way.
- **Why is the Windows binary unsigned?** It is an owner decision for v0.1.0. Signing comes with hosting on `mcp-poc.netskope.tech`.
- **Why not `skope update` yet?** Version 0.1.0 carries a test-only update key, so it refuses to update itself. Self-update needs both the real signing key and the hosted signed manifest (TASKS X7). Until then, the user runs the install script again.

---

## Recipes by function (84 total)

You don't need these names to help the user — discover them with `query`. This is a map of what exists.

- **Internet Access policy** — Web (SWG) rules and policy groups: list, create, change, delete, validate against the tenant's live schema, and deploy.
  - Workflows: Manage Internet Access Policy (`manage.internet.access.policy`)
  - Recipes: `iap:list_org_units`, `iap:list_categories`, `iap:list_users`, `iap:get_rule`, `iap:list_rules`, `iap:list_policy_groups`, `iap:list_user_groups`, `iap:rule_schema`, `iap:create_policy_group`, `iap:create_rule`, `iap:delete_policy_group`, `iap:delete_rule`, `iap:deploy`, `iap:update_policy_group`, `iap:update_rule`
  - Base recipes: `policy:manage` → internetaccess/defaultaction, internetaccess/groups, internetaccess/rules
- **Policy objects** — Network, destination, service and DNS profiles and custom categories that rules reference — including staged changes and ordered deploys.
  - Workflows: Manage Policy Objects (`manage.policy.objects`)
  - Recipes: `profiles:find_apps`, `profiles:get`, `profiles:list`, `profiles:create_custom_category`, `profiles:create_destination_profile`, `profiles:create_dns_profile`, `profiles:create_network_profile`, `profiles:create_service_profile`, `profiles:create_url_list`, `profiles:create_http_header_profile`, `profiles:delete`, `profiles:deploy`
  - Base recipes: `profiles:manage` → customcategories, destinations, dns, dns/inheritancegroups, httpheaders, networks, serviceobjects
- **Private Access (NPA)** — Private apps, publishers, and NPA policy groups and rules. npa:list_publishers lists publishers (and the apps behind one); changes and the rest go through the base recipes.
  - Recipes: `npa:list_publishers`
  - Base recipes: `policy:manage` → npa/policygroups, npa/rules; `steering:manage` → apps/private, apps/private/discoverysettings, apps/private/tags; `infrastructure:manage` → publishers, publishers/alertsconfiguration, publisherupgradeprofiles
- **DLP & incidents** — Investigate DLP incidents and their workflow, and manage DLP profiles, rules, dictionaries and fingerprints.
  - Workflows: Analyze DLP Incidents (`intent.incident.analysis`); Analyze Incident Status & Workflow (`intent.incident.status.analysis`)
  - Recipes: `dlp:top_10_violations`
  - Base recipes: `incidents:manage` → dlpincidents/{id}/notes, incidents, watchlists; `services:manage` → dlp/entities/dataidentifiers, dlp/entities/dictionaries, dlp/fileprofiles, dlp/fingerprints, dlp/profiles, dlp/rules/columnclassification, dlp/rules/content
- **Investigations & reporting** — Search and aggregate events (alerts, apps, DLP incidents, web, network, client status, endpoint DLP) with the events:search recipe — no code — and guided workflows for insider risk, user and app activity, client versions, security posture and digital experience (ADEM metrics still need code access).
  - Workflows: Analyze Insider Risk (`intent.insider.risk.analysis`); Generate Security Posture Report (`intent.security.posture.report`); Search & Analyze Events (`analyze.events`); Troubleshoot User Digital Experience (`intent.adem.troubleshooting`); Analyze Application Activity (`intent.application.activity.analysis`); Analyze Client Versions (`intent.client.version.analysis`); Generate User Activity Report (`intent.user.activity.report`)
  - Recipes: `events:rank_insider_risk`, `events:search`, `events:summarize_posture`
- **Users, groups & admin roles** — SCIM users and groups, admin roles and labels.
  - Base recipes: `scim:manage` → Groups, Users; `rbac:manage` → labels, roles
- **Steering & connectivity** — IPsec and GRE tunnels, device tags and client enrollment settings.
  - Base recipes: `steering:manage` → gre/tunnels, ipsec/tunnels; `devices:manage` → device/tags; `enrollment:manage` → secure-config, secure-enrollment, tokenset, tokenset/{id}
- **Anything else:** every changeable API resource (352 resources) has a generic `<domain>:manage` recipe. List a domain's resources and operations with `execute_read({prompt: "<domain>:manage", args: {op: "resources", q: "<keyword>"}})`.

---

## Related guides

- Curating recipes (netSkope/uap-mcp-content): https://github.com/netSkope/uap-mcp-content/blob/main/docs/curating-recipes.md
- Building agents (netSkope/uap-mcp-content), coming: https://github.com/netSkope/uap-mcp-content/blob/main/docs/building-agents.md
- Installing `skope`: https://github.com/netSkope/netskope-cli/blob/main/docs/install.md
- Using `skope`: https://github.com/netSkope/netskope-cli/blob/main/docs/usage.md

These repositories are internal: the links work for Netskope people with access to the netSkope GitHub organization.
