﻿---
title: "CSP API and MCP server for AI agents and CI/CD"
description: "Read CSP violations, script inventories and metrics over a REST API, gate deploys from CI, or connect Claude Code and Cursor to the built-in MCP server."
url: "https://centralcsp.com/en/platform/api-mcp/"
lang: "en"
---

API and MCP

# Anything you can click, your agent can too.

Connect the built-in MCP server and ask in plain language: your agent scans a site, reads the reports and comes back with what to fix first. The same coverage is a REST API when you would rather script it, authenticated with a workspace API key that carries your own roles.

[Set up the MCP server](https://centralcsp.com/en/docs/api-mcp/mcp/quickstart) [Read the API docs](https://centralcsp.com/en/docs/api-mcp/api)

claude — shop.example.com

\> Scan shop.example.com and tell me what to fix first.

Running a scan and pulling the last 30 days of reports.

centralcsp - scans\_create (MCP) (url: "shop.example.com")

queued · sc\_8f2a19c4

centralcsp - reports\_summary (MCP) (range: "30d")

1,087,621 reports · 2,710 blocked · 10 pages

centralcsp - compliance\_scripts (MCP) (cve: true)

4 scripts with known CVEs

Three things, in this order:

1.  1.
    
    Critical Unknown script on /checkout
    
    cdn.pixel-metrics.io/t.js first appeared 14:02 yesterday and is not in your policy.
    
2.  2.
    
    High script-src still allows 'unsafe-inline'
    
    Nonces are already on 94% of your inline scripts. Drop the keyword and the policy holds.
    
3.  3.
    
    Medium jQuery 3.4.1 carries CVE-2020-11023
    
    Loaded on 3 pages. Patched in 3.5.0.
    

\>

Ask a follow-up

3 MCP tools · centralcsp connected

Coverage

## Every CSP report, script and alert over one REST API.

The dashboard is just another API client. Every workspace resource has endpoints to read it and manage it, so if a number is on a screen, there is a call that returns it.

-   `GET /workspaces/:id/websites`
    
    Sites
    
    List, create and configure monitored sites. Each returns its managed reporting endpoint, ready for the header.
    
    [View endpoints](https://centralcsp.com/en/docs/api-mcp/api)
-   `GET …/websites/:id/reports/:type/raw`
    
    Reports
    
    Raw and aggregated browser reports, filterable by type, directive, origin and time range.
    
    [View endpoints](https://centralcsp.com/en/docs/api-mcp/api)
-   `GET …/websites/:id/compliance/scripts`
    
    Scripts and SBOM
    
    The script inventory with integrity hashes, library versions and known CVEs.
    
    [View endpoints](https://centralcsp.com/en/docs/api-mcp/api)
-   `GET …/websites/:id/stats/metrics/:id`
    
    Metrics and charts
    
    The same metrics and chart series the dashboard renders, per site or across the workspace, for your own reporting.
    
    [View endpoints](https://centralcsp.com/en/docs/api-mcp/api)
-   `POST …/websites/:id/alerts/rules`
    
    Alerting
    
    Create alert rules and route them to Slack, Teams or any webhook.
    
    [View endpoints](https://centralcsp.com/en/docs/api-mcp/api)
-   `GET /workspaces/:id/members`
    
    Members and audit
    
    Invite members, assign roles and read the workspace audit log.
    
    [View endpoints](https://centralcsp.com/en/docs/api-mcp/api)

MCP server

## Put the API in your agent's hands.

The CentralCSP MCP server exposes your websites, reports, scans and alert rules as tools any agent can call. Connecting is one server URL and an OAuth sign-in, with no secret to store.

-   Works with Claude Code, Claude Desktop, Codex CLI and any MCP client
-   Same coverage as the REST API
-   The server holds no credential: it signs you in over OAuth and acts as you
-   Flip the workspace AI integration kill switch and it is cut off

[Set up the MCP server](https://centralcsp.com/en/docs/api-mcp/mcp/quickstart)

Agent permissions

## What an agent can and cannot do

The server acts as you. It never gains a permission you do not already have, and the workspace kill switch cuts every AI integration at once.

What the MCP server can read, can change, and can never do
| Scope | What that means |
| --- | --- |
| Can read | Your websites, their reports and scores, script inventories, scan results and alert rules, for the sites your roles already reach |
| Can change | What your roles let you change: start a scan, create or edit an alert rule, add a website |
| Can never | Reach a workspace or a site you have no role on, act after the key is revoked, or survive the workspace AI integration kill switch |

## What teams script first.

No SDK required. Three calls with curl and a cron get you further than most integrations.

### Gate your deploys from CI/CD

Your CI/CD job starts a scan on the release URL, polls until it finishes, and reads the score back. Compare it to the previous run and exit non-zero when a release would weaken the policy or drop a security header, so the build fails before the deploy lands.

### Feed your SIEM or data warehouse

Pull CSP violations, script hashes and network errors, plus scores and inventories, into your SIEM, your data warehouse or a weekly client report.

### Onboard sites in a pipeline

Create the site, read back its reporting endpoint and ship the header in the same run.

Further reading

## Start with the reference

Connect an agent, create a key, and read the endpoint reference.

-   [MCP quickstart for Claude Code and Codex](https://centralcsp.com/en/docs/api-mcp/mcp/quickstart)
-   [REST API reference](https://centralcsp.com/en/docs/api-mcp/api)
-   [Connect Claude Code, Claude Desktop or Codex](https://centralcsp.com/en/docs/api-mcp/mcp/connect)
-   [What an agent can and cannot do](https://centralcsp.com/en/docs/api-mcp/mcp/permissions)
-   [Create a workspace API key](https://centralcsp.com/en/docs/platform/integrations/api-keys)
-   [AI integration kill switch and API key restrictions](https://centralcsp.com/en/docs/platform/security/platform-security)

FAQ

## Frequently asked questions

MCP, tokens and plans, answered.

### What is an MCP server?

A standard interface AI agents use to discover and call a product's capabilities. Point any MCP client at the CentralCSP server and it lists the available tools itself: no API glue code, no custom plugin.

### Does the MCP server replace the API?

No. It sits on top of the same API with the same permissions. Agents and assistants talk MCP; your scripts, CI jobs and integrations call REST directly.

### MCP server or REST API: which should I use?

Use the REST API when something deterministic calls it: a script, a CI job, a nightly sync into your warehouse, an integration you maintain. Use MCP when a person is asking a question and an agent decides which calls to make: the same capability, exposed as tools the agent discovers by itself, under the same permissions. They are two front doors to one set of operations, not two products, so nothing is available over one and missing from the other.

### How do I authenticate to the API?

With a workspace API key, sent as a bearer token in the Authorization header. You create the key in the workspace, and it acts as the person who created it: the same website roles, the same plan limits. That also means a key cannot be edited after creation to widen what it reaches, so changing access means creating a new key and revoking the old one. Revocation takes effect immediately.

### Is it safe to connect an AI agent to my security data?

The server is first-party and it holds no credential of its own. It signs you in over OAuth and then acts as you: the same website roles you already have, and the same workspace plan. It cannot reach a site you cannot reach. If you want it gone, revoke the API key or flip the workspace AI integration kill switch, and access stops immediately.

### Which plan includes the API and MCP?

Business and up. Start covers collection and the dashboard; the API and MCP server come in with the automation tier.

### Which AI tools can use it?

Any MCP client. The ones we document and test are Claude Code, Claude Desktop and Codex CLI; Cursor, VS Code, Windsurf and the rest of the growing agent ecosystem speak the same protocol and connect the same way, with one server URL and an OAuth sign-in.

## Collect the signal. Script the rest.

Start free, add the header, and automate from day one. API and MCP are included from the Business plan.

[Start free trial](https://app.centralcsp.com) [Read the API docs](https://centralcsp.com/en/docs/api-mcp/api)

---

Available in: [en](https://centralcsp.com/en/platform/api-mcp/), [fr](https://centralcsp.com/fr/platform/api-mcp/)
