PT Application Inspector MCP
v1.1.0Connect AI agents to the PT AI local analyzer and AIE server for scans, projects and triage.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_scan_errors
Retrieves a list of errors (critical and non-critical) that occurred during the last SAST scan. Use this if the scan failed or if you want to investigate why certain files were not analyzed properly.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Maximum number of errors to return (1-100, default 50). Ordered by severity. |
set_active_project
Sets the active project directory for the static analysis scanner. Call this tool FIRST to start working with MCP on your project, or if other tools return an 'Active project not set' error. IMPORTANT: - If you see only ONE workspace root directory in your system context, set it automatically without asking the user. - If you see MULTIPLE workspace roots, ask the user which one to use. MUST be derived from the 'Active Workspaces' in the system context, not inferred from the currently active document.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | The absolute path to the project root. MUST be derived from the 'Active Workspaces' in the system context, not inferred from the currently active document. |
get_issue_details
Retrieves maximum details for a specific issue by its ID. Includes dataflow paths (source to sink snippets), exploit references, and custom validation conditions.
| Parameter | Type | Description |
|---|---|---|
issueId * | string | The unique identifier of the issue (the actual 'id' field returned by list_issues or get_issues_by_location). |
get_scan_status
Returns the current execution status of the static analysis engine (idle, running with progress percentage, done, or error). When status is 'running', follow the wait instruction in the response message before calling this tool again.
trigger_scan
Starts a static analysis (SAST) scan on the project workspace. Can be run in incremental (default) or full mode. If the response status is 'running', follow the wait instruction in the response message before calling 'get_scan_status'.
| Parameter | Type | Description |
|---|---|---|
blocking | boolean | If true (default), waits up to 30 seconds for completion, then returns either a summary or running status. If false, starts the scan in the background and returns running status immediately. |
hookFormat | string | Optional. When source='hook', specifies the output format for the hook response. Valid values: 'codex' (Codex StopOutput schema), 'claude-code' (Claude Code hook schema). Leave empty for standard MCP… |
mode | string | Optional mode for the scan. Use 'incremental' (default) to only scan changed files, or 'full' to perform a complete analysis from scratch. |
source | string | Optional. The source of the scan invocation. Use 'hook' when called from a lifecycle hook to enable .hooks_disabled check. Leave empty for manual invocations. |
stopHookActive | boolean | Optional. Set to true by the agent when the Stop hook is re-running after a previous block. Used for 'block once' logic: first stop (false) → block, re-run (true) → soft inform. |
triage_issue
Triages an issue by changing its status (e.g. to 'Approval' or 'Discard') with an explanatory comment.
| Parameter | Type | Description |
|---|---|---|
comment * | string | The reasoning or comment justifying the status change. |
issueId * | string | The unique identifier of the issue (the actual 'id' field returned by list_issues or get_issues_by_location). |
newStatus * | string | The new target status: 'Approval' or 'Discard'. |
list_issues
Retrieves a filtered list of issues discovered during the last SAST scan. Use this to find critical bugs.
| Parameter | Type | Description |
|---|---|---|
filePath | string | Optional filter to search in a specific file path relative to project root. |
severity | string | Optional filter for severity level: 'High', 'Medium', 'Low', or 'Potential'. |
status | string | Optional filter for triage status: 'None', 'Approval', 'Discard', or 'AutoApproval'. |
vulnType | string | Optional filter by issue type, CWE name, or component name. Accepts both internal type identifiers (e.g. 'Potential Path Traversal') and display names shown in the UI (e.g. 'Improper Limitation', 'lod… |
get_issues_by_location
Finds all issues attached to a specific file and optional line number. Perfect for resolving a bug at a cursor position. Returns the ID that should be used to get issue details.
| Parameter | Type | Description |
|---|---|---|
filePath * | string | The specific file path (relative to project root) to search for issues. |
lineNumber | integer | Optional line number (1-indexed) where the issue is reported. |
get_scan_history
Returns a list of past scan results with dates and severity breakdown. Use this to compare scan results over time (e.g. 'did my fixes reduce the number of issues?').
| Parameter | Type | Description |
|---|---|---|
limit | integer | Maximum number of past scan results to return (1-50, default 10). |
stop_scan
Stops the currently running static analysis (SAST) scan on the project.
modify_scan_settings
Modifies settings in the project .aiproj file dynamically and returns the updated settings JSON config. Use dot-notation for nested keys (e.g. 'DotNetSettings.UsePublicAnalysisMethod'). Read current settings and schema via the 'get_scan_settings' tool first to see available keys and valid values.
| Parameter | Type | Description |
|---|---|---|
settingKey * | string | The setting key to modify. Uses dot-notation for nested properties. Examples: 'ProjectName', 'SkipGitIgnoreFiles', 'DotNetSettings.DownloadDependencies', 'ProgrammingLanguages'. |
settingValue * | string | The new setting value to assign as a JSON literal. Examples: 'true', '"my-project"', '["Java","CSharp (Windows, Linux)"]', '{"UsePublicAnalysisMethod": true}'. |
aie_auth
Explicit AIE login/logout/cancel_login. Before login, tell the user that sign-in opens in their browser and any fallback code must go into a local form, never chat. Login returns login_id, login_url and manual_url. Show the fallback link and follow next_action; check aie_get_context(login_id) to confirm connection even if the AIE page still mentions Visual Studio. A failed or cancelled login preserves the previous session.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
force_login | boolean | |
login_id | string | |
server_url | string |
aie_get_context
Read the current AIE session and advisory permissions. With login_id, inspect that login target: waiting or failed attempts are read locally without contacting the previous server. context_scope identifies the response; current_session, when present, is not validated. login.error describes a failed attempt. Known certificate failures include the Node reason, CA setup and a per-origin exception example that requires explicit approval. Reconnect MCP after environment changes. Explicitly retry working calls after login.
| Parameter | Type | Description |
|---|---|---|
login_id | string |
aie_list_projects
List accessible AIE projects with IDs and a compact summary.
| Parameter | Type | Description |
|---|---|---|
cursor | string | For the next page, pass next_cursor with the SAME target, filters and page_size (size may be omitted). Null next_cursor ends the list. Immutable snapshot expires 10 minutes after creation or on restar… |
name | string | |
page_size | integer | Items per page (default 20, max 100). total counts all matching items; summary total counts groups. |
aie_list_branches
List branches of the explicitly selected project.
| Parameter | Type | Description |
|---|---|---|
project_id * | string | |
cursor | string | For the next page, pass next_cursor with the SAME target, filters and page_size (size may be omitted). Null next_cursor ends the list. Immutable snapshot expires 10 minutes after creation or on restar… |
page_size | integer | Items per page (default 20, max 100). total counts all matching items; summary total counts groups. |
aie_list_scans
List scan summaries of the explicitly selected branch; choose a concrete historical scan ID.
| Parameter | Type | Description |
|---|---|---|
branch_id * | string | |
project_id * | string | |
cursor | string | For the next page, pass next_cursor with the SAME target, filters and page_size (size may be omitted). Null next_cursor ends the list. Immutable snapshot expires 10 minutes after creation or on restar… |
label | string | Exact readable label; it may match multiple launches. |
order | string | Sort by scan date. desc with page_size=1 selects latest matching scan. |
page_size | integer | Items per page (default 20, max 100). total counts all matching items; summary total counts groups. |
state | array |
aie_list_issues
Read compact findings or summary groups for a scan. Filters combine with AND; array values use OR. Type search uses BE4P exact → substring → all words in any order, case-insensitive, first nonempty level before pagination. Searches internal type, description/CWE titles and component names; search metadata reports unavailable titles. issue_type is the AIE category, not SQL Injection/XSS; is_new is the server baseline flag, counter is the UI number. matched_issues counts all matches including Discard/suppressed; AIE statistics exclude them.
| Parameter | Type | Description |
|---|---|---|
project_id * | string | |
scan_id * | string | |
approval_state | array | |
branch_id | string | |
counter | integer | |
cursor | string | For the next page, pass next_cursor with the SAME target, filters and page_size (size may be omitted). Null next_cursor ends the list. Immutable snapshot expires 10 minutes after creation or on restar… |
end_line | integer | |
file | string | Exact relative file path, slash-normalized and case-insensitive. |
is_new | boolean | |
is_suppressed | boolean | Exact suppression flag; omitted includes both values. |
issue_type | array | |
location | string | |
page_size | integer | Items per page (default 20, max 100). total counts all matching items; summary total counts groups. |
path | string | |
scan_module | array | Module names, e.g. RaceConditionDetection (6.4), StaticCodeAnalysis, PatternMatching. view=summary lists observed values. Races use issue_type=Vulnerability and type such as Toctou. |
severity | array | |
start_line | integer | |
type | string | Forgiving type/CWE-title/component search, e.g. sql injection, Pathname Restricted, lodash. Does not correct spelling. |
view | string |
aie_get_issue_details
Read full finding evidence, including both race paths and sharedData. For reused incremental findings, verifies membership and returns issue_record_scan_id. Source revision remains unverified; check local or downloaded code before triage.
| Parameter | Type | Description |
|---|---|---|
issue_id * | string | |
project_id * | string | |
scan_id * | string | |
branch_id | string |
aie_triage_issue
Save Approval/Discard/None and comment, verifying the selected issue. An unchanged state with a comment uses the comment endpoint. Empty comment with unchanged state is no-op. AIE asynchronously synchronizes statuses/comments by hash to other branches: verification does not cover that synchronization. Supply inspected evidence.
| Parameter | Type | Description |
|---|---|---|
comment * | string | |
issue_id * | string | |
project_id * | string | |
scan_id * | string | |
state * | string | |
branch_id | string |
aie_download_project
Download branch sources to a NEW local destination after the user has allowed access. Runs as a background operation. Existing destinations are never overwritten. Branch archives have snapshot_match=unknown for historical scans.
| Parameter | Type | Description |
|---|---|---|
branch_id * | string | |
destination * | string | |
project_id * | string | |
scan_id | string |
aie_create
Create kind=project (permanent project plus initial branch/configuration) OR kind=branch (new branch in an existing project with sources). One call runs the workflow; use operation_id to observe. Branch mode preserves project settings and does not write user working-branch selection; the server-derived Plugin default may change (before/after IDs are returned). Excludes .git, staging, .aiignore/.ptaiignore matches; skips symlinks; local .aiproj.json is unchanged. Partial failures retain created IDs, without automatic deletion.
| Parameter | Type | Description |
|---|---|---|
branch_name * | string | |
kind * | string | |
source_directory * | string | |
description | string | |
name | string | |
project_id | string | |
scan_changes | object |
aie_get_sources
Read current branch source tree or a bounded file range (default 200 lines, upstream 1 MiB, output 64 KiB). Prefer a known scan_id for nested/special paths; some 6.3 branch routes fail. scan_id validates context but does not freeze files: content_source=current_branch_sources_or_temp, snapshot_match=unknown. kind=tree is paginated; depth bounds traversal.
| Parameter | Type | Description |
|---|---|---|
branch_id * | string | |
kind * | string | |
project_id * | string | |
cursor | string | For the next page, pass next_cursor with the SAME target, filters and page_size (size may be omitted). Null next_cursor ends the list. Immutable snapshot expires 10 minutes after creation or on restar… |
depth | integer | |
end_line | integer | |
page_size | integer | Items per page (default 20, max 100). total counts all matching items; summary total counts groups. |
path | string | |
scan_id | string | |
start_line | integer |
aie_upload_sources
Upload local sources to an explicitly selected existing branch. Background operation. Excludes .git, own staging paths and files ignored by root .aiignore/.ptaiignore (gitignore syntax; both exclusion sets are combined). Symlinks are skipped. Local .aiproj.json is unchanged. Wait for confirmed source readiness before starting analysis.
| Parameter | Type | Description |
|---|---|---|
branch_id * | string | |
project_id * | string | |
source_directory * | string |
aie_get_project_settings
Read one settings section, revision and current write schema. scan_id makes only section=scan values historical. In 6.4, scan settings expose searchForRaceConditionsEnabled and raceConditionSettings when available. include_template reads the policy template.
| Parameter | Type | Description |
|---|---|---|
project_id * | string | |
section * | string | |
include_template | boolean | |
scan_id | string |
aie_update_project_settings
Patch ONE CURRENT project-wide section using its write schema. Nested objects merge; arrays replace. Preserves other fields and verifies visible changes by readback. Hidden BlackBox credentials are preserved when omitted; explicit replacements may return verified=false and verification.unverified_fields because AIE hides their values. base_revision detects changes before writing but is not atomic server CAS. Changes affect all project branches and future scans.
| Parameter | Type | Description |
|---|---|---|
changes * | object | |
project_id * | string | |
section * | string | |
base_revision | string |
aie_list_pm_catalog
List one PM catalog kind (rules/groups/types). include_create_schema returns its creation schema. PM entities are shared across projects.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
cursor | string | For the next page, pass next_cursor with the SAME target, filters and page_size (size may be omitted). Null next_cursor ends the list. Immutable snapshot expires 10 minutes after creation or on restar… |
include_create_schema | boolean | |
page_size | integer | Items per page (default 20, max 100). total counts all matching items; summary total counts groups. |
aie_get_pm_catalog_entry
Read one shared PM entity and its update schema/revision. Rule IDs are strings, not necessarily UUIDs. Group membership is included for safe editing.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
kind * | string |
aie_save_pm_catalog_entry
Explicit create/update of a shared PM entity. create requires value; update requires id and changes. Types support create only. Group rename preserves rule membership. Shared changes can affect other projects; creation is never replayed to discover an ID.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
kind * | string | |
base_revision | string | |
changes | object | |
id | string | |
value | object |
aie_list_scan_agents
Read available server scan agents, or one agent by ID, for project preferred_agents selection. Permissions are checked by AIE at request time.
| Parameter | Type | Description |
|---|---|---|
cursor | string | For the next page, pass next_cursor with the SAME target, filters and page_size (size may be omitted). Null next_cursor ends the list. Immutable snapshot expires 10 minutes after creation or on restar… |
id | string | |
page_size | integer | Items per page (default 20, max 100). total counts all matching items; summary total counts groups. |
aie_start_scan
Queue one scan and normally return scan_id/current state in this call, without waiting for analysis completion. Total wait budget 45 seconds, otherwise returns operation_id/known IDs for follow-up. Label defaults MCP or MCP-<label_suffix>; it is descriptive, not unique and does not select modules. scope defaults Incremental. Exact queue mapping and inferred branch_history correlation are distinguished; ambiguous matches remain unconfirmed. Never repeat an accepted/uncertain enqueue automatically.
| Parameter | Type | Description |
|---|---|---|
branch_id * | string | |
project_id * | string | |
label_suffix | string | Optional readable suffix, e.g. SCA_SCAN gives MCP-SCA_SCAN. Empty gives MCP. No random suffix is added. |
scope | string | Modules come from project settings or an uploaded .aiproj.json override. Read historical enabledScanModules to confirm which ran. |
aie_get_operation
Read a local workflow by operation_id OR an explicit remote project/branch/scan_id. Launch jobs return workflow_state separately from scan_state and correlation. Optional paged diagnostics. Failed scan is a successful read. Local results remain readable offline under the same verified session; remote errors are separate. Jobs are current-process-only; polling never repeats mutations.
| Parameter | Type | Description |
|---|---|---|
branch_id | string | |
cursor | string | For the next page, pass next_cursor with the SAME target, filters and page_size (size may be omitted). Null next_cursor ends the list. Immutable snapshot expires 10 minutes after creation or on restar… |
include_diagnostics | boolean | |
operation_id | string | |
page_size | integer | Items per page (default 20, max 100). total counts all matching items; summary total counts groups. |
project_id | string | |
scan_id | string |
aie_cancel_operation
Cancel a local workflow OR stop an explicitly selected remote project/branch/scan_id. Cancelling a launch job requests remote stop only with exact queue correlation; branch_history requires explicit scan_id selection. Applied writes are not rolled back. Stop acceptance differs from confirmed terminal state; poll get_operation. Shutdown/logout do not stop remote scans.
| Parameter | Type | Description |
|---|---|---|
branch_id | string | |
operation_id | string | |
project_id | string | |
scan_id | string |