Skip to navigation

MCP Server

Overview

Pensar provides a remote Model Context Protocol (MCP) 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.

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
  • 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). 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.

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

Setup

  1. Open Claude Code by running claude in your terminal
  2. Add the Pensar MCP server:
claude mcp add Pensar --transport http https://api.pensar.dev/mcp
  1. Run the /mcp command, you’ll see Pensar with a needs authentication status
  2. Select it and choose Authenticate to sign in with Pensar in your browser

Available Tools

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

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 detailed information about a specific scan.

Parameters:

ParameterTypeRequiredDescription
scanIdstringYesScan 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?”

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

Parameters:

ParameterTypeRequiredDescription
endpointIdsstring[]NoExact list of 1–1000 discovered endpoint UUIDs in this workspace. Cannot be combined with branch; only full depth is supported.
scanLevelstringNo"priority" or "full". Defaults to "full" with endpointIds, otherwise "priority". "priority" is rejected with endpointIds.
branchstringNoMust match the connected repository’s configured target branch, which is used when omitted. Cannot be combined with endpointIds.
knowledgeEntryIdsstring[]NoUp to 20 active knowledge base entry UUIDs to give the run as context (see Knowledge Base).

Exact endpoint arguments:

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

Find discovered endpoint IDs with pensar apps endpoints <appId> in the Apex CLI or GET /apps/:appId/endpoints in the REST API. MCP does not expose endpoint discovery.

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 security issues with optional filtering.

Parameters:

ParameterTypeRequiredDescription
scanIdstringNoFilter by scan ID
statusstringNoFilter by issue status (e.g., "open", "closed")
severitystringNoFilter by severity ("critical", "high", "medium", "low")
branchstringNoFilter by git branch

Returns: A list of issues with their IDs, issueLabel references (VULN-000123), console urls, 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 detailed information about a specific security issue.

Parameters:

ParameterTypeRequiredDescription
issueIdstringYesIssue UUID or label (e.g. VULN-000123) to retrieve details for

Returns: Full issue details including the issueLabel reference, the console url, the finding name, description, affected file and lines (startLineNumber, endLineNumber), CWE classification, branch, proof-of-concept, endpointId, applicationId, and workspace information. A closed issue adds the full close record: closedAt, closedDisposition, duplicateOf, closedMethod, closedReason, and closedComments.

Example prompt: “Give me the details on VULN-000123.”

Update a security issue’s status, disposition, or inventory endpoint association.

Parameters:

ParameterTypeRequiredDescription
issueIdstringYesIssue UUID or label (e.g. VULN-000123) to update
statusstringNoNew status: "open", "closed", "false-positive", or "in-review"
userFlaggedFalsePositivebooleanNoFlag the issue as a false positive
userFlaggedFalsePositiveReasonstringNoReason for flagging as false positive
closedDispositionstringNoStructured close verdict: resolved, duplicate, wont-fix, out-of-scope, risk-accepted
duplicateOfstringWith duplicateThe issue this one duplicates, as a UUID or label (e.g. VULN-000123)
closedReasonstringNoFree-text reason for closing
closedCommentsstringNoAdditional comments on closure
endpointIdstring or nullNoInventory endpoint UUID to associate. Omit to preserve the association; send null to clear endpoint and application

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 plus endpointId and applicationId.

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.”

Fixes

List all available fixes for a security issue.

Parameters:

ParameterTypeRequiredDescription
issueIdstringYesIssue 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 detailed information about a specific fix, including the code diff.

Parameters:

ParameterTypeRequiredDescription
fixIdstringYesFix 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 execution logs for a specific issue. Useful for understanding how the agent discovered and verified a vulnerability.

Parameters:

ParameterTypeRequiredDescription
issueIdstringYesIssue UUID or label (e.g. VULN-000123) to list logs for
levelstringNoFilter by log level: "debug", "info", "warn", "error"
rolestringNoFilter by role: "assistant", "user", "system", "tool-call", "tool-result"
limitnumberNoMaximum 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 execution logs by text pattern with configurable context lines.

Parameters:

ParameterTypeRequiredDescription
issueIdstringYesIssue UUID or label (e.g. VULN-000123) to search logs for
querystringYesText pattern to search for
levelstringNoFilter by log level
rolestringNoFilter by role
contextLinesnumberNoNumber 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.”

Knowledge Base

Knowledge base entries are the context Pensar agents use during pentests. A false_positive_pattern entry suppresses matching findings, 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. Every entry records the user who wrote it. Like dispatch_pentest, the write tools default to Needs approval.

List knowledge base entries, newest first.

Parameters:

ParameterTypeRequiredDescription
categorystringNofalse_positive_pattern, technology_context, testing_history, user_note, or agent_learning
statusstringNoactive, stale, or archived
tagsstring[]NoOnly entries carrying every one of these tags

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

Example prompt: “What does Pensar know about our tech stack?”

Get one knowledge base entry.

Parameters:

ParameterTypeRequiredDescription
idstringYesEntry UUID

Returns: The full entry.

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

Parameters:

ParameterTypeRequiredDescription
titlestringYesEntry title
contentstringYesEntry body
categorystringYesEntry category
tagsstring[]NoTags for filtering

Returns: The created entry.

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

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

Parameters:

ParameterTypeRequiredDescription
idstringYesEntry UUID
titlestringNoEntry title
contentstringNoEntry body
categorystringNoEntry category
statusstringNoactive, stale, or archived
tagsstring[]NoTags for filtering

Returns: The updated entry.

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

Parameters:

ParameterTypeRequiredDescription
idstringYesEntry UUID

Returns: The archived entry.

REST API

Every MCP tool has a matching REST API endpoint for programmatic access via API keys. The REST API is a superset — it also exposes attack-surface endpoints (apps and endpoints) that are not available over MCP. See the REST API documentation for full endpoint details and authentication instructions.

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.

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

Next Steps