> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.pensar.dev/console/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pensar.dev/console/_mcp/server.

# MCP Server

> Connect AI tools to Pensar using the Model Context Protocol

## Overview

Pensar provides a remote [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that lets AI tools interact directly with your Pensar workspace. Through MCP, you can list scans, launch pentests, review security issues, and retrieve auto-generated fixes using tools like Claude Code, Desktop, or Web, or even directly in Slack.

> **Info**
>
> MCP is an open standard that allows AI assistants to connect to external tools and data sources. Pensar's MCP server implements the **Streamable HTTP** transport so it works with any MCP-compatible client.

## Prerequisites

Before connecting an MCP client to Pensar you need:

* A Pensar Console account at [console.pensar.dev](https://console.pensar.dev)
* At least one workspace with a connected repository
* An MCP-compatible client (e.g., Claude Desktop, Claude Code, Cursor, Windsurf)

## Server URL

The Pensar MCP server is available at:

```
https://api.pensar.dev/mcp
```

## Authentication

The Pensar MCP server uses **OAuth 2.0** for authentication, following the [MCP Authorization specification (2025-03-26)](https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization). When you first connect, your MCP client will open a browser window where you sign in with your Pensar Console credentials. After signing in, the client receives a token and uses it automatically for all subsequent requests.

> **Note**
>
> Most MCP clients handle the OAuth flow automatically. You do not need to create or manage API keys, just sign in.

## Setup

#### Claude Code

1. Open Claude Code by running `claude` in your terminal
2. Add the Pensar MCP server:

```bash
claude mcp add Pensar --transport http https://api.pensar.dev/mcp
```

3. Run the `/mcp` command, you'll see **Pensar** with a **needs authentication** status
4. Select it and choose **Authenticate** to sign in with Pensar in your browser

#### Claude Desktop / Web

These steps work in both Claude Desktop and Web. Setting up the connector in one makes it available in the other.

1. Go to **Customize** > **Connectors**
2. Click **+** > **Add custom connector**
3. Enter **Pensar** as the name
4. Enter `https://api.pensar.dev/mcp` as the **Remote MCP server URL**
5. Click **Add**
6. The connector appears under your Connectors list, click on it then click **Connect** to sign in with Pensar

After connecting, click the Pensar connector to configure tool permissions. Read-only tools (like `list_scans` and `get_issue`) default to **Always allow**, while write tools (like `dispatch_pentest`) default to **Needs approval**

#### Cursor

1. Go to **Cursor** > **Settings...** > **Cursor Settings** > **Tools & MCP**
2. Click **New MCP Server**, this opens your MCP config file (e.g., `~/.cursor/mcp.json`)
3. Add Pensar under `mcpServers`:

```json
{
  "mcpServers": {
    "Pensar": {
      "url": "https://api.pensar.dev/mcp"
    }
  }
}
```

4. Save the file, Pensar appears under **Installed MCP Servers** with a **Needs authentication** status
5. Click **Connect** to sign in with Pensar

#### Windsurf

1. Go to **Windsurf** > **Settings...** > **Windsurf Settings** > **Cascade** > **MCP Servers**
2. Click **MCP Marketplace**, then the **Settings** icon to open `~/.codeium/windsurf/mcp_config.json`
3. Add Pensar under `mcpServers`:

```json
{
  "mcpServers": {
    "Pensar": {
      "serverUrl": "https://api.pensar.dev/mcp"
    }
  }
}
```

4. Save the file, Windsurf will automatically direct you to sign in with Pensar in your browser

## Toolsets

A connection exposes every tool by default. To give an agent only some of them, name the toolsets you want, comma-separated, in a `toolsets` query parameter on the server URL:

```
https://api.pensar.dev/mcp?toolsets=issues,fixes
```

If your client lets you set request headers, you can send the same list in an `X-MCP-Toolsets` header instead:

```
X-MCP-Toolsets: issues,fixes
```

An unknown toolset name is rejected with a 400 error that lists the valid names.

| Toolset     | Tools                                                                                                                                                                                                                                                                                            |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `pentests`  | `list_scans`, `get_scan`, `dispatch_pentest`, `list_pentest_targets`                                                                                                                                                                                                                             |
| `issues`    | `list_issues`, `get_issue`, `get_issue_evidence`, `list_issue_retests`, `update_issue`, `retest_issue`, `link_pull_request`, `list_issue_pull_requests`, `list_comments`, `create_comment`                                                                                                       |
| `fixes`     | `list_fixes`, `get_fix`                                                                                                                                                                                                                                                                          |
| `incidents` | `list_incidents`, `list_incident_events`, `get_incident`, `list_incident_logs`, `get_incident_log_attachment`                                                                                                                                                                                    |
| `logs`      | `list_agent_logs`, `search_agent_logs`, `list_target_logs`, `search_target_logs`                                                                                                                                                                                                                 |
| `knowledge` | `list_knowledge`, `get_knowledge`, `create_knowledge`, `update_knowledge`, `archive_knowledge`                                                                                                                                                                                                   |
| `inventory` | `list_applications`, `get_application`, `search_applications`, `create_application`, `update_application`, `delete_application`, `list_endpoints`, `get_endpoint`, `get_endpoints`, `search_endpoints`, `create_endpoint`, `update_endpoint`, `delete_endpoint`, `list_domains`, `create_domain` |

## Available Tools

The Pensar MCP server exposes the following tools to your AI coding agent:

### Scans

#### list_scans

List all scans in your workspace.

**Parameters:** None

**Returns:** A list of scans with their IDs, labels, statuses, scan types, branches, and timestamps.

**Example prompt:** *"Show me all my Pensar scans."*

#### get_scan

Get detailed information about a specific scan.

**Parameters:**

| Parameter | Type   | Required | Description                     |
| --------- | ------ | -------- | ------------------------------- |
| `scanId`  | string | Yes      | Scan ID to retrieve details for |

**Returns:** Detailed scan information including workspace name, status, error messages, issue count, and whether a report is ready.

**Example prompt:** *"What's the status of scan xyz-789?"*

#### list_pentest_targets

List the targets of a pentest. Each target is an attack-surface endpoint the pentest exercised. Use a target ID to read its logs with `list_target_logs` or `search_target_logs`, even when the target produced no issue.

**Parameters:**

| Parameter   | Type   | Required | Description                   |
| ----------- | ------ | -------- | ----------------------------- |
| `pentestId` | string | Yes      | Pentest ID, from `list_scans` |

**Returns:** Each target's ID, URL, application, status, attempt count, start and completion times, and any error. API keys require `pentests:read`.

#### dispatch_pentest

Queue a hosted pentest in the authenticated workspace. The scan runs asynchronously; an identical active launch may be reused.

**Parameters:**

| Parameter           | Type      | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------- | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `endpointIds`       | string\[] | No       | Exact list of 1–1000 discovered endpoint UUIDs in this workspace. Cannot be combined with `branch`; only full depth is supported.                                                                                                                                                                                                                                                                                                 |
| `scanLevel`         | string    | No       | `"priority"` or `"full"`. Defaults to `"full"` with `endpointIds`, otherwise `"priority"`. `"priority"` is rejected with `endpointIds`.                                                                                                                                                                                                                                                                                           |
| `branch`            | string    | No       | Must match the connected repository's configured target branch, which is used when omitted. Cannot be combined with `endpointIds`.                                                                                                                                                                                                                                                                                                |
| `knowledgeEntryIds` | string\[] | No       | Up to 20 active knowledge base entry UUIDs to give the run as context (see [Knowledge Base](#knowledge-base)).                                                                                                                                                                                                                                                                                                                    |
| `customTest`        | object    | No       | Run a custom test driven by your own instructions. `brief` (string, up to 20,000 characters) is applied to every listed application; `applications` is a list of `{ applicationId, endpointIds? }`, where `endpointIds` limits that application to those of its endpoints and omitting it tests the whole application. Runs at full depth. Cannot be combined with top-level `endpointIds`, `branch`, or `scanLevel: "priority"`. |

**Exact endpoint arguments:**

```json
{
  "endpointIds": [
    "7e4fe67a-61e5-4aa5-b93a-6871b470aaef",
    "59e9b6d5-d13b-4912-9e46-a1e801c1d053"
  ],
  "scanLevel": "full"
}
```

Find discovered endpoint IDs with the `list_endpoints` or `search_endpoints` tools, `pensar apps endpoints <appId>` in the [Apex CLI](/console/apex/cli-commands/pensar-pentests#launch-selected-endpoints), or [`GET /apps/{appId}/endpoints`](/console/api/api-reference/endpoints/list-endpoints) in the Console API.

Exact lists use full depth and test the supplied endpoints without commit-based narrowing. Each selected application must be ready to test. Omit `endpointIds` to test eligible workspace applications at priority depth by default.

Invalid IDs or incompatible arguments return a tool error without expanding the requested scope.

**Returns:** The queued scan's `scanId`, `label`, `status`, and confirmation `message`. Use `get_scan` with that ID to check completion. Failures are MCP tool errors (`isError: true`).

**Example prompt:** *"Use dispatch_pentest with these two discovered endpoint IDs only: 7e4fe67a-61e5-4aa5-b93a-6871b470aaef and 59e9b6d5-d13b-4912-9e46-a1e801c1d053. Then check the returned scan ID until it completes."*

### Issues

#### list_issues

List security issues with optional filtering.

**Parameters:**

| Parameter  | Type   | Required | Description                                                      |
| ---------- | ------ | -------- | ---------------------------------------------------------------- |
| `scanId`   | string | No       | Filter by scan ID                                                |
| `status`   | string | No       | Filter by issue status (e.g., `"open"`, `"closed"`)              |
| `severity` | string | No       | Filter by severity (`"critical"`, `"high"`, `"medium"`, `"low"`) |
| `branch`   | string | No       | Filter by git branch                                             |

**Returns:** A list of issues with their IDs, `issueLabel` references (`VULN-000123`), console `url`s, titles, severities, statuses, and file locations. Closed issues also carry `closedAt`, `closedDisposition` and `duplicateOf`, so a closed finding is not mistaken for a resolved one; all three are `null` while the issue is open.

**Example prompt:** *"Show me all critical open issues."*

#### get_issue

Get detailed information about a specific security issue.

**Parameters:**

| Parameter | Type   | Required | Description                                                      |
| --------- | ------ | -------- | ---------------------------------------------------------------- |
| `issueId` | string | Yes      | Issue UUID or label (e.g. `VULN-000123`) to retrieve details for |

**Returns:** The [issue object](/console/features/webhooks#the-issue-object), including full CVSS, nested application, endpoint, and repository, and `pullRequest` (the tracked pull request URL, or `null`). API keys require `issues:read`.

**Example prompt:** *"Give me the details on VULN-000123."*

#### get_issue_evidence

Read a finding's PoC, execution output, evidence steps, attack path, and source snippet at its recorded commit.

**Parameters:** `issueId` (required), an issue UUID or label in your workspace.

**Returns:** The [evidence object](/console/api/api-reference/issues/get-issue-evidence), including null reasons, redaction, and truncation flags. API keys require `issues:read`.

#### list_issue_retests

Read retest attempts for a finding, newest first.

**Parameters:** `issueId` (required), an issue UUID or label in your workspace.

**Returns:** The [retest history](/console/api/api-reference/issues/list-issue-retests). API keys require `issues:read`. This tool reads history; it does not launch a retest.

#### retest_issue

Queue a retest against a finding's original target. Accepts an `issueId` containing an issue UUID or label such as `VULN-000123` in your workspace.

After a target-scope failure, pass optional `targetRetry: { domainId, targetUrl }` to select a verified replacement for this run. The fields and validation are shared with [Retest an issue in the Console API](/console/api/api-reference/issues/retest-issue).

OAuth sessions and API keys with `issues:write` can launch retests. This is a write tool, so approve the launch in your client when prompted.

**Returns:** `issueId`, `sessionId`, `status: "queued"`, and a message. Queued means the request was accepted, not that the finding is fixed. View the outcome in Console or read [`GET /issues/{issueId}/retests`](/console/api/api-reference/issues/list-issue-retests) through the Console API.

**Example prompt:** *"Retest VULN-000123 against its original target."*

#### update_issue

Update a security issue's status, disposition, inventory endpoint association, or the pull request it tracks.

**Parameters:**

| Parameter                        | Type           | Required         | Description                                                                                                                                                       |
| -------------------------------- | -------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `issueId`                        | string         | Yes              | Issue UUID or label (e.g. `VULN-000123`) to update                                                                                                                |
| `status`                         | string         | No               | New status: `"open"`, `"closed"`, `"false-positive"`, or `"in-review"`                                                                                            |
| `userFlaggedFalsePositive`       | boolean        | No               | Flag the issue as a false positive                                                                                                                                |
| `userFlaggedFalsePositiveReason` | string         | No               | Reason for flagging as false positive                                                                                                                             |
| `closedDisposition`              | string         | No               | Structured close verdict: `resolved`, `duplicate`, `wont-fix`, `out-of-scope`, `risk-accepted`                                                                    |
| `duplicateOf`                    | string         | With `duplicate` | The issue this one duplicates, as a UUID or label (e.g. `VULN-000123`)                                                                                            |
| `closedReason`                   | string         | No               | Free-text reason for closing                                                                                                                                      |
| `closedComments`                 | string         | No               | Additional comments on closure                                                                                                                                    |
| `endpointId`                     | string or null | No               | Inventory endpoint UUID to associate. Omit to preserve the association; send `null` to clear endpoint and application                                             |
| `pullRequest`                    | string or null | No               | http(s) URL of the pull request this finding tracks. Replaces the current link. Send `null` to clear it. Omit to leave it unchanged. Any provider URL is accepted |

Pair `closedDisposition` with `status: "closed"` — without it the finding reads as **Resolved** whatever the reason says. Reopening clears it, and `false-positive` never carries one. `other` is not accepted, as it is being retired from the vocabulary.

A `duplicate` close must name its original in `duplicateOf`, another issue in the same workspace that is not itself closed as a duplicate, and no other disposition may carry one.

Endpoint updates validate workspace ownership, keep `applicationId` synchronized to the endpoint's application, and reject duplicate `(pentest, title, endpoint)` associations.

**Returns:** The updated issue details, including close metadata, `endpointId`, `applicationId`, and `pullRequest`.

The change is also applied to the finding's linked GitHub, Linear and Notion tickets.

**Example prompt:** *"Close issue abc-123 as risk-accepted, we have a WAF rule in front of it."*

#### list_issue_pull_requests

List the pull requests linked to a security issue, with the status of each and how it was created.

**Parameters:**

| Parameter | Type   | Required | Description                                                        |
| --------- | ------ | -------- | ------------------------------------------------------------------ |
| `issueId` | string | Yes      | Issue UUID or label (e.g. `VULN-000123`) to list pull requests for |

**Returns:** Each pull request's ID, URL, status, how it was created, and when. API keys require `issues:read`.

### Fixes

#### list_fixes

List all available fixes for a security issue.

**Parameters:**

| Parameter | Type   | Required | Description                                                |
| --------- | ------ | -------- | ---------------------------------------------------------- |
| `issueId` | string | Yes      | Issue UUID or label (e.g. `VULN-000123`) to list fixes for |

**Returns:** A list of fixes with their IDs and affected file paths.

**Example prompt:** *"Are there any fixes for issue def-456?"*

#### get_fix

Get detailed information about a specific fix, including the code diff.

**Parameters:**

| Parameter | Type   | Required | Description                    |
| --------- | ------ | -------- | ------------------------------ |
| `fixId`   | string | Yes      | Fix ID to retrieve details for |

**Returns:** The fix details including the file path, a unified diff of the changes, an explanation of what the fix does, and the related issue ID.

**Example prompt:** *"Show me the diff for fix ghi-789."*

### Agent Logs

#### list_agent_logs

List agent execution logs for a specific issue. Useful for understanding how the agent discovered and verified a vulnerability.

**Parameters:**

| Parameter | Type   | Required | Description                                                                         |
| --------- | ------ | -------- | ----------------------------------------------------------------------------------- |
| `issueId` | string | Yes      | Issue UUID or label (e.g. `VULN-000123`) to list logs for                           |
| `level`   | string | No       | Filter by log level: `"debug"`, `"info"`, `"warn"`, `"error"`                       |
| `role`    | string | No       | Filter by role: `"assistant"`, `"user"`, `"system"`, `"tool-call"`, `"tool-result"` |
| `limit`   | number | No       | Maximum number of log entries to return                                             |

**Returns:** A list of agent log entries with timestamps, levels, roles, and content.

**Example prompt:** *"Show me the agent logs for issue abc-123."*

#### search_agent_logs

Search agent execution logs by text pattern with configurable context lines.

**Parameters:**

| Parameter      | Type   | Required | Description                                                 |
| -------------- | ------ | -------- | ----------------------------------------------------------- |
| `issueId`      | string | Yes      | Issue UUID or label (e.g. `VULN-000123`) to search logs for |
| `query`        | string | Yes      | Text pattern to search for                                  |
| `level`        | string | No       | Filter by log level                                         |
| `role`         | string | No       | Filter by role                                              |
| `contextLines` | number | No       | Number of surrounding context lines to include              |

**Returns:** Matching log entries with surrounding context.

**Example prompt:** *"Search the agent logs for issue abc-123 for mentions of SQL injection."*

#### list_target_logs

List the agent execution logs from one pentest target, whether or not it produced an issue.

**Parameters:**

| Parameter  | Type   | Required | Description                                                                         |
| ---------- | ------ | -------- | ----------------------------------------------------------------------------------- |
| `targetId` | string | Yes      | Pentest target ID, from `list_pentest_targets`                                      |
| `level`    | string | No       | Filter by log level: `"debug"`, `"info"`, `"warn"`, `"error"`                       |
| `role`     | string | No       | Filter by role: `"assistant"`, `"user"`, `"system"`, `"tool-call"`, `"tool-result"` |
| `limit`    | number | No       | Maximum number of log entries to return, 1 to 500. Defaults to 100                  |

**Returns:** Log entries with their ID, timestamp, level, role, message, metadata, service, and subagent. API keys require `pentests:read`.

#### search_target_logs

Search the agent logs of one pentest target, with surrounding context entries.

**Parameters:**

| Parameter      | Type   | Required | Description                                                      |
| -------------- | ------ | -------- | ---------------------------------------------------------------- |
| `targetId`     | string | Yes      | Pentest target ID, from `list_pentest_targets`                   |
| `query`        | string | Yes      | Text to search for in log messages. Case-insensitive             |
| `level`        | string | No       | Filter by log level                                              |
| `role`         | string | No       | Filter by role                                                   |
| `contextLines` | number | No       | Number of surrounding entries to include, 0 to 20. Defaults to 3 |

**Returns:** Matching log entries with surrounding context. API keys require `pentests:read`.

### Knowledge Base

Knowledge base entries are the context Pensar agents use during pentests; an entry's `priority` decides when agents get it (see [Knowledge Base](/console/features/knowledge-base#priority)). Entries steer what agents test and report, so the write tools need a user credential: an OAuth session can create, update, and archive entries, while a workspace API key can only read them. Creating, editing, or archiving an `always` entry also needs that user to be a workspace admin or owner. Every entry records the user who wrote it. Like `dispatch_pentest`, the write tools default to **Needs approval**.

#### list_knowledge

List knowledge base entries, newest first.

**Parameters:**

| Parameter  | Type      | Required | Description                                                                                         |
| ---------- | --------- | -------- | --------------------------------------------------------------------------------------------------- |
| `category` | string    | No       | `false_positive_pattern`, `technology_context`, `testing_history`, `user_note`, or `agent_learning` |
| `status`   | string    | No       | `active`, `stale`, or `archived`                                                                    |
| `tags`     | string\[] | No       | Only entries carrying every one of these tags                                                       |

**Returns:** Entries with their ID, title, content, category, status, priority, source, tags, `createdBy`, and timestamps.

**Example prompt:** *"What does Pensar know about our tech stack?"*

#### get_knowledge

Get one knowledge base entry.

**Parameters:**

| Parameter | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `id`      | string | Yes      | Entry UUID  |

**Returns:** The full entry.

#### create_knowledge

Add a knowledge base entry, attributed to you. Requires a user credential.

**Parameters:**

| Parameter  | Type      | Required | Description                        |
| ---------- | --------- | -------- | ---------------------------------- |
| `title`    | string    | Yes      | Entry title                        |
| `content`  | string    | Yes      | Entry body                         |
| `category` | string    | Yes      | Entry category                     |
| `priority` | string    | No       | `always` or `on_request` (default) |
| `tags`     | string\[] | No       | Tags for filtering                 |

**Returns:** The created entry.

**Example prompt:** *"Add a technology note to Pensar that our API sits behind a WAF."*

#### update_knowledge

Edit a knowledge base entry. Omitted fields are unchanged; `tags` replaces the existing list. Requires a user credential.

**Parameters:**

| Parameter  | Type      | Required | Description                      |
| ---------- | --------- | -------- | -------------------------------- |
| `id`       | string    | Yes      | Entry UUID                       |
| `title`    | string    | No       | Entry title                      |
| `content`  | string    | No       | Entry body                       |
| `category` | string    | No       | Entry category                   |
| `status`   | string    | No       | `active`, `stale`, or `archived` |
| `priority` | string    | No       | `always` or `on_request`         |
| `tags`     | string\[] | No       | Tags for filtering               |

**Returns:** The updated entry.

#### archive_knowledge

Archive a knowledge base entry so agents stop using it. The entry stays readable. Requires a user credential.

**Parameters:**

| Parameter | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `id`      | string | Yes      | Entry UUID  |

**Returns:** The archived entry.

### Applications

#### list_applications

List the applications in your workspace, a page at a time.

**Parameters:**

| Parameter | Type   | Required | Description                                      |
| --------- | ------ | -------- | ------------------------------------------------ |
| `limit`   | number | No       | Applications per page, 1 to 200. Defaults to 100 |
| `offset`  | number | No       | Number of applications to skip. Defaults to 0    |

**Returns:** A page of applications with their ID, name, type, framework, and domain, plus `hasMore`. When `hasMore` is true, pass the next `offset` to continue. API keys require `inventory:read`.

#### get_application

Get one application with its full detail.

**Parameters:**

| Parameter | Type   | Required | Description    |
| --------- | ------ | -------- | -------------- |
| `appId`   | string | Yes      | Application ID |

**Returns:** The application, including its description and disallowed actions. API keys require `inventory:read`.

#### search_applications

Search applications by name and description.

**Parameters:**

| Parameter | Type   | Required | Description                                                                              |
| --------- | ------ | -------- | ---------------------------------------------------------------------------------------- |
| `query`   | string | Yes      | Text to match, 1 to 256 characters                                                       |
| `type`    | string | No       | Filter by application type. An invalid value returns an error listing the allowed values |
| `limit`   | number | No       | Applications per page, 1 to 200. Defaults to 50                                          |
| `offset`  | number | No       | Number of applications to skip. Defaults to 0                                            |

**Returns:** A page of matching applications, plus `hasMore`. API keys require `inventory:read`.

#### create_application

Create an application.

**Parameters:**

| Parameter           | Type           | Required | Description                                                                    |
| ------------------- | -------------- | -------- | ------------------------------------------------------------------------------ |
| `name`              | string         | Yes      | Application name                                                               |
| `description`       | string         | Yes      | What the application does                                                      |
| `type`              | string         | No       | Application type. An invalid value returns an error listing the allowed values |
| `framework`         | string         | No       | Framework the application is built with                                        |
| `domainId`          | string or null | No       | ID of a domain in your workspace to attach                                     |
| `disallowedActions` | string         | No       | Actions the testing agent must not perform                                     |

**Returns:** The created application. API keys require `inventory:write`.

#### update_application

Update an application. Only the fields you pass change, and at least one is required.

**Parameters:**

| Parameter           | Type           | Required | Description                                                  |
| ------------------- | -------------- | -------- | ------------------------------------------------------------ |
| `appId`             | string         | Yes      | Application ID                                               |
| `name`              | string         | No       | Application name                                             |
| `description`       | string         | No       | What the application does                                    |
| `type`              | string or null | No       | Application type. `null` clears it                           |
| `framework`         | string or null | No       | Framework. `null` clears it                                  |
| `domainId`          | string or null | No       | ID of a domain in your workspace. `null` detaches the domain |
| `disallowedActions` | string or null | No       | Actions the testing agent must not perform. `null` clears it |

**Returns:** The updated application. API keys require `inventory:write`.

#### delete_application

Permanently delete an application and all of its endpoints. This cannot be undone.

**Parameters:**

| Parameter | Type   | Required | Description    |
| --------- | ------ | -------- | -------------- |
| `appId`   | string | Yes      | Application ID |

**Returns:** A confirmation with the deleted application's ID. API keys require `inventory:write`.

### Endpoints

#### list_endpoints

List the endpoints of one application, a page at a time.

**Parameters:**

| Parameter | Type   | Required | Description                                                                           |
| --------- | ------ | -------- | ------------------------------------------------------------------------------------- |
| `appId`   | string | Yes      | Application ID                                                                        |
| `type`    | string | No       | Filter by endpoint type. An invalid value returns an error listing the allowed values |
| `limit`   | number | No       | Endpoints per page, 1 to 200. Defaults to 100                                         |
| `offset`  | number | No       | Number of endpoints to skip. Defaults to 0                                            |

**Returns:** A page of endpoints with their ID, path, transport, type, and whether authentication is required, plus `hasMore`. Objectives, business logic, and the threat model are left out; read them with `get_endpoint` or `get_endpoints`. API keys require `inventory:read`.

#### get_endpoint

Get one endpoint with its full detail.

**Parameters:**

| Parameter    | Type   | Required | Description |
| ------------ | ------ | -------- | ----------- |
| `endpointId` | string | Yes      | Endpoint ID |

**Returns:** The endpoint, including its description, objectives, source location, authentication details, business logic, and threat model. API keys require `inventory:read`.

#### get_endpoints

Get the full detail of up to 100 endpoints in one call.

**Parameters:**

| Parameter     | Type      | Required | Description                  |
| ------------- | --------- | -------- | ---------------------------- |
| `endpointIds` | string\[] | Yes      | 1 to 100 unique endpoint IDs |

**Returns:** The full detail of each endpoint, in the order requested. If any ID is not found in your workspace, the call fails with a 404 error and returns none of them. API keys require `inventory:read`.

#### search_endpoints

Search endpoints across your workspace, or within one application.

**Parameters:**

| Parameter       | Type    | Required | Description                                                                           |
| --------------- | ------- | -------- | ------------------------------------------------------------------------------------- |
| `query`         | string  | Yes      | Text to match, 1 to 256 characters                                                    |
| `applicationId` | string  | No       | Search only this application. Defaults to every application in the workspace          |
| `type`          | string  | No       | Filter by endpoint type. An invalid value returns an error listing the allowed values |
| `authRequired`  | boolean | No       | Only endpoints that do, or do not, require authentication                             |
| `limit`         | number  | No       | Endpoints per page, 1 to 200. Defaults to 50                                          |
| `offset`        | number  | No       | Number of endpoints to skip. Defaults to 0                                            |

**Returns:** A page of matching endpoints, plus `hasMore`. Like `list_endpoints`, it leaves out objectives, business logic, and the threat model. API keys require `inventory:read`.

#### create_endpoint

Create a new endpoint under an application. If the application already has the same endpoint, the call returns a 409 error and changes nothing; it does not update the existing endpoint. Use `update_endpoint` to change it.

HTTP paths match after normalization, so case, a trailing slash, and parameter style such as `:id` or `{id}` do not matter. Other transports match on transport and exact path.

**Parameters:**

| Parameter                | Type      | Required | Description                                                                 |
| ------------------------ | --------- | -------- | --------------------------------------------------------------------------- |
| `appId`                  | string    | Yes      | Application to add the endpoint to                                          |
| `endpoint`               | string    | Yes      | Endpoint path                                                               |
| `description`            | string    | Yes      | What the endpoint does                                                      |
| `type`                   | string    | No       | Endpoint type. An invalid value returns an error listing the allowed values |
| `transport`              | string    | No       | Transport. An invalid value returns an error listing the allowed values     |
| `location`               | string    | No       | Source file that handles the endpoint                                       |
| `startLineNumber`        | number    | No       | Line in `location` where the endpoint's code starts                         |
| `endLineNumber`          | number    | No       | Line in `location` where the endpoint's code ends                           |
| `objectives`             | string\[] | No       | The full list of testing objectives                                         |
| `authenticationRequired` | object    | No       | `{ "required": boolean, "details": string }`, where `details` is optional   |
| `businessLogic`          | string    | No       | Free-text description of the endpoint's business logic                      |
| `threatModel`            | string    | No       | Free-text threat model for the endpoint                                     |

**Returns:** The created endpoint. API keys require `inventory:write`.

#### update_endpoint

Update an endpoint. Only the fields you pass change, and at least one is required.

**Parameters:**

| Parameter                | Type           | Required | Description                                                              |
| ------------------------ | -------------- | -------- | ------------------------------------------------------------------------ |
| `endpointId`             | string         | Yes      | Endpoint ID                                                              |
| `applicationId`          | string         | No       | Move the endpoint to this application in your workspace                  |
| `endpoint`               | string         | No       | Endpoint path                                                            |
| `description`            | string         | No       | What the endpoint does                                                   |
| `type`                   | string or null | No       | Endpoint type. `null` clears it                                          |
| `transport`              | string         | No       | Transport                                                                |
| `location`               | string or null | No       | Source file that handles the endpoint. `null` clears it                  |
| `startLineNumber`        | number or null | No       | Line where the endpoint's code starts. `null` clears it                  |
| `endLineNumber`          | number or null | No       | Line where the endpoint's code ends. `null` clears it                    |
| `objectives`             | string\[]      | No       | Replaces the whole list of testing objectives; it does not append        |
| `authenticationRequired` | object or null | No       | `{ "required": boolean, "details": string }`. `null` clears it           |
| `businessLogic`          | string or null | No       | Free-text description of the endpoint's business logic. `null` clears it |
| `threatModel`            | string or null | No       | Free-text threat model for the endpoint. `null` clears it                |

A change that would give an application two endpoints with the same path and transport returns a 409 error.

**Returns:** The updated endpoint. API keys require `inventory:write`.

#### delete_endpoint

Permanently delete one endpoint. This cannot be undone.

**Parameters:**

| Parameter    | Type   | Required | Description |
| ------------ | ------ | -------- | ----------- |
| `endpointId` | string | Yes      | Endpoint ID |

**Returns:** A confirmation with the deleted endpoint's ID. API keys require `inventory:write`.

### Domains

#### list_domains

List the domains in your workspace.

**Parameters:** None

**Returns:** The domains with their ID, URL, and verification status. API keys require `inventory:read`.

#### create_domain

Add a domain to your workspace. Adding a domain does not verify it; see [Verifying Domains](/console/domains/verifying-domains).

**Parameters:**

| Parameter | Type   | Required | Description                                                                   |
| --------- | ------ | -------- | ----------------------------------------------------------------------------- |
| `url`     | string | Yes      | Domain or URL to add, e.g. `app.acme.example`. It is stored in canonical form |

**Returns:** The `domain`, and `created`, which is false when the domain was already in your workspace. API keys require `inventory:add`.

## Console API

Every MCP tool except `get_endpoints` has a matching Console API endpoint for programmatic access via API keys. The Console API also exposes webhook endpoints, which are not available over MCP. See the [Console API](/console/api/overview/introduction) for authentication and the full endpoint reference.

## Usage Examples

Once connected, you can interact with Pensar through natural language in your AI coding agent. Here are some common workflows:

### Run a Security Scan

Ask your agent to launch a pentest and then check the results:

> *"Run a Pensar pentest and let me know when it finishes."*

The agent will use `dispatch_pentest` to start the scan, then `get_scan` to poll for completion. To select exact targets, provide discovered endpoint UUIDs and ask the agent to pass them as `endpointIds`; omitting that field uses the workspace launch behavior described above.

### Review Security Issues

Ask your agent to summarize findings from a recent scan:

> *"Show me all high and critical issues from my latest scan."*

The agent will use `list_scans` to find the most recent scan, then `list_issues` with severity filters to retrieve the relevant findings.

### Apply a Fix

Ask your agent to retrieve and apply a recommended fix:

> *"Get the fix for issue abc-123 and apply it to my codebase."*

The agent will use `list_fixes` to find available fixes, `get_fix` to retrieve the diff, and then apply the patch to your local files.

## Supported Clients

The Pensar MCP server works with any client that supports the Streamable HTTP transport and OAuth-based authorization. Tested clients include Claude Code, Claude Desktop, Cursor, and Windsurf.

> **Note**
>
> If your preferred client is not listed above, consult its documentation on adding a remote MCP server.

## Next Steps

#### [Hybrid Testing](/console/features/hybrid-testing)

Learn about Pensar's hybrid testing methodology that powers MCP issue and
fix data.

#### [Auto-Remediation](/console/features/auto-remediation)

Understand how Pensar generates fixes you can retrieve via MCP.

#### [CI/CD Integration](/console/features/ci-integration)

Automate pentesting in your pipeline alongside MCP-driven workflows.

#### [Getting Started](/console/getting-started)

Set up your workspace and connect your first repository.

## Incidents

Use the `incidents` toolset to investigate Datadog alerts. API keys need
`incidents:read`; OAuth connections use your workspace access.

* `list_incidents` returns grouped alerts across all verdicts. Filter with `verdict`,
  `status`, or `triageStatus`. Pass `nextCursor` as `cursor` for the next page.
* `list_incident_events` returns individual events. Set `groupOf` to an incident id
  to inspect that alert group.
* `get_incident` takes `incidentId` and returns the full raw payload, triage analysis,
  evidence, indicators, recommendations, and timestamps.
* `list_incident_logs` takes `incidentId` and returns paginated execution parts for
  the current triage run. Restart pagination after re-triage or to refresh active tools.
* `get_incident_log_attachment` takes `incidentId` and `partId` from a log entry
  with `hasAttachment: true`. Its download URL expires after 60 seconds and provides
  the full content stored outside the inline log.

These tools read data. Remediation text is a recommendation to review, not approval
for an agent to execute it.