Connect Claude Code, Cursor or VS Code to your ZopNight account. Ask about cloud cost, resources, schedules and recommendations in natural language, and the assistant reads live data instead of guessing.
An MCP server (Model Context Protocol) is a stateless proxy that exposes structured tools to an AI assistant. ZopNight’s runs over Streamable HTTP: your client sends JSON-RPC 2.0 over HTTP POST and gets a single JSON response back. It is not SSE and not WebSocket, which matters because the transport setting is the one thing clients get wrong.
The connection URL
ZopNight shows your server URL in two places in the app:
- Settings → Organisation, in the MCP Server section, once the toggle is on
- Developer Settings, on the screen where you create your token
Copy it from either one. Every config block below uses it as <server-url>.
Step 1: Enable MCP for your organisation
MCP is off by default for every organisation, and only an admin (a user with the Organisation Update permission) can turn it on.
- Log in to ZopNight and open Settings from the sidebar
- Click the Organisation tab
- In the Organisation details card, scroll to the MCP Server section, below the created date
- Toggle the switch to ON
The status badge changes from Inactive to Active, and the server URL appears. If you cannot see the toggle, you are not an admin on that organisation.
Step 2: Create a Personal Access Token
The server authenticates with a personal access token, prefixed zn_pat_.
- Click your profile avatar at the bottom-left of the sidebar
- Select Developer Settings
- Click Create Token
- Enter a name, for example “Cursor” or “Claude Code”
- Choose an expiry period
- Click Create Token, then copy the token immediately
The token is shown once. Store it in your secret manager, not in a committed file.
A PAT carries your identity, not a narrower one. Every call resolves your live role at the moment it is made, so it can do exactly what you can do in the UI, no more and no less. Mint it as the person with the narrowest role that does the job.
Step 3: Configure your client
All three use the same two values: the server URL and the token.
Claude Code
claude mcp add zopnight <server-url> -t http -H "Authorization: Bearer <your-token>"The -t http flag is required. Without it, Claude Code may attempt OAuth before it tries the header and the connection fails.
Cursor
Settings → Tools & MCP → New MCP Server, then paste:
{ "mcpServers": { "zopnight": { "url": "<server-url>", "headers": { "Authorization": "Bearer <your-token>" } } }}VS Code
Create .mcp.json in your workspace, or add the block to your user mcp.json:
{ "servers": { "zopnight": { "type": "http", "url": "<server-url>", "headers": { "Authorization": "Bearer <your-token>" } } }}Codex, Windsurf and Antigravity connect the same way, with the same URL and header.
Step 4: Confirm it works
Start a new session and ask your assistant:
List my organisationsA working connection calls the list_organisations tool and returns your organisations by name. That is the check to run before you ask anyone for help, because it isolates the connection from everything else: list_organisations is the only tool that needs no arguments, and every other tool takes the org_id it returns.
If it fails, the usual causes are the transport flag, an expired token, or the organisation toggle still being off.
What the assistant can read
The server exposes 85 read tools. Reads need no extra permission and are checked against your role, so an assistant sees exactly what you would see in the UI.
| Area | Covers |
|---|---|
| Explore | Organisations, cloud accounts, resources, teams, discovery status |
| Cost | Cost and savings summaries, per-resource and per-provider breakdowns, trends, history, snapshots, budgets, billing sync |
| Optimize | Recommendations and their savings, schedules, overrides, resource groups |
| Operate | Start and stop history, actions, scheduler events, provisioning jobs, services and their deploys |
| Govern | Tagging policies, smart tags, roles, users, audit logs, notification channels |
| Diagnose | Metrics, error detail, and the state behind a failed deploy or job |
| Ship | Projects, environments, services, infrastructure, deploy status |
| Introspect | What your own token can do, including get_my_permissions |
List tools forward the full filter and pagination set (provider, status, region, search, sort), so the assistant asks precise questions rather than pulling everything and filtering afterwards. Expensive aggregations are served from a short-TTL cache, so repeated questions in one session stay fast.
Your own list is narrower than the catalogue by design. Call tools/list, or ask the assistant what ZopNight tools it has, and what comes back is filtered to what your token and role actually allow. Nothing advertised there will fail with a permission error.
One hard boundary worth knowing before a security review: get_service_config returns a service’s shape, including its environment variable keys with every value redacted. No tool reveals an env var value, at any tier, for any role.
Read and write
The MCP server is read-only today. Write operations are refused with mcp_write_not_allowed, and no write tool is advertised to any client, whatever you configure.
34 write tools are built and gated behind a per-organisation write tier in Settings → Organisation, set to None for every organisation including existing ones. Write access is enabled per organisation on request, so contact us if you want to be part of the rollout.
When it does reach you, the tiers are cumulative:
| Tier | Admits | Examples |
|---|---|---|
| None (default) | Nothing. Read tools only. | n/a |
| 1, metadata only | ZopNight’s own records. No cloud state, no cost. | Budgets, recommendation status, smart-tag acceptance |
| 2, reversible | Bounded blast radius, may affect cost. | Schedules, overrides, tagging policies, service deploys, rollbacks and config |
| 3, irreversible | No undo, or incurs cost. | Start and stop resources, provisioning jobs, Kubernetes writes, every delete |
Some surfaces are excluded at every tier and no setting adds them: roles and permissions, user management, organisation deletion, cloud-account deletion, credentials, and bulk actions.
Before you enable any tier, read one thing: enabling MCP write means any content in your cloud environment becomes a potential instruction to your agent. Resource names, tags and descriptions are strings other people can influence, and a read tool hands them to a model that can call write tools. The control that matters is how much authority the agent has, which is what the tier is, and why the default is None.
How the permissions actually resolve
Every check happens at the gateway on the way in, which is the same place the UI’s own calls are checked.
- The gateway validates the PAT and identifies your email
- The assistant calls
list_organisationsto discover which organisations you belong to - The gateway confirms MCP is enabled for the organisation you asked about
- It confirms you are a member of that organisation
- It checks the call against your live role, and against the write tier if the tool changes something
- Results come back as JSON
The MCP server owns no authorization logic of its own. A tool call is authorized the same way the equivalent click in the UI is, with the same answer, and every call lands in the audit trail with a source of mcp.
Where to go next
Full client-by-client setup, the complete tool catalogue, and troubleshooting live in the MCP server documentation.
If you are evaluating ZopNight itself rather than the integration, the platform comparison covers how it differs from dashboard-first tools, and you can book a demo to see the estate side.
Questions we get a lot.
If yours isn't here, email us and we'll answer directly.
Which transport does the ZopNight MCP server use?
Streamable HTTP. It speaks JSON-RPC 2.0 over HTTP POST and returns a single application/json response per request. It is not SSE and not WebSocket. In Claude Code, pass -t http; in VS Code, set type to http. A wrong transport setting is the most common reason a connection fails.
Where do I find the server URL?
Two places in the app: Settings then Organisation, in the MCP Server section once the toggle is on; or Developer Settings, on the screen where you create the token. MCP is off by default and only an admin can enable it, so the URL appears once the toggle is on.
How is the MCP server authenticated?
A personal access token (zn_pat_*) sent as an Authorization Bearer header. The gateway validates it and enforces RBAC; the MCP server is a stateless proxy that owns no authz. Tokens are tied to your email rather than one organisation, permissions resolve per request against your live role, and every call is audited with a source of mcp.
Can the MCP server make changes to my cloud accounts?
Not today. Every mutating tool call is refused with mcp_write_not_allowed, and no write tool is advertised to any client, whatever you configure. Write access is opt-in per organisation via a tier in Settings, default None for every organisation, and it is enabled on request during the rollout.
Can I limit what an assistant is able to see?
Yes, through the role of the person who mints the token. A PAT can do exactly what that user can do in the UI, no more and no less, including team-scoped access that narrows visibility to the resources a team owns. Some things are never exposed at any tier: get_service_config returns environment variable keys with every value redacted, and no tool reveals an env var value for any role.