PT Application Inspector MCP

v1.1.0
io.github.POSIdev-community/ptai-mcp Checked 41 minutes ago Published 14 days ago

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

ParameterTypeDescription
limitintegerMaximum 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.

ParameterTypeDescription
projectPath *stringThe 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.

ParameterTypeDescription
issueId *stringThe 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'.

ParameterTypeDescription
blockingbooleanIf 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.
hookFormatstringOptional. 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…
modestringOptional mode for the scan. Use 'incremental' (default) to only scan changed files, or 'full' to perform a complete analysis from scratch.
sourcestringOptional. The source of the scan invocation. Use 'hook' when called from a lifecycle hook to enable .hooks_disabled check. Leave empty for manual invocations.
stopHookActivebooleanOptional. 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.

ParameterTypeDescription
comment *stringThe reasoning or comment justifying the status change.
issueId *stringThe unique identifier of the issue (the actual 'id' field returned by list_issues or get_issues_by_location).
newStatus *stringThe 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.

ParameterTypeDescription
filePathstringOptional filter to search in a specific file path relative to project root.
severitystringOptional filter for severity level: 'High', 'Medium', 'Low', or 'Potential'.
statusstringOptional filter for triage status: 'None', 'Approval', 'Discard', or 'AutoApproval'.
vulnTypestringOptional 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.

ParameterTypeDescription
filePath *stringThe specific file path (relative to project root) to search for issues.
lineNumberintegerOptional 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?').

ParameterTypeDescription
limitintegerMaximum 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.

ParameterTypeDescription
settingKey *stringThe setting key to modify. Uses dot-notation for nested properties. Examples: 'ProjectName', 'SkipGitIgnoreFiles', 'DotNetSettings.DownloadDependencies', 'ProgrammingLanguages'.
settingValue *stringThe 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.

ParameterTypeDescription
action *string
force_loginboolean
login_idstring
server_urlstring

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.

ParameterTypeDescription
login_idstring

aie_list_projects

List accessible AIE projects with IDs and a compact summary.

ParameterTypeDescription
cursorstringFor 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…
namestring
page_sizeintegerItems 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.

ParameterTypeDescription
project_id *string
cursorstringFor 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_sizeintegerItems 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.

ParameterTypeDescription
branch_id *string
project_id *string
cursorstringFor 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…
labelstringExact readable label; it may match multiple launches.
orderstringSort by scan date. desc with page_size=1 selects latest matching scan.
page_sizeintegerItems per page (default 20, max 100). total counts all matching items; summary total counts groups.
statearray

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.

ParameterTypeDescription
project_id *string
scan_id *string
approval_statearray
branch_idstring
counterinteger
cursorstringFor 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_lineinteger
filestringExact relative file path, slash-normalized and case-insensitive.
is_newboolean
is_suppressedbooleanExact suppression flag; omitted includes both values.
issue_typearray
locationstring
page_sizeintegerItems per page (default 20, max 100). total counts all matching items; summary total counts groups.
pathstring
scan_modulearrayModule names, e.g. RaceConditionDetection (6.4), StaticCodeAnalysis, PatternMatching. view=summary lists observed values. Races use issue_type=Vulnerability and type such as Toctou.
severityarray
start_lineinteger
typestringForgiving type/CWE-title/component search, e.g. sql injection, Pathname Restricted, lodash. Does not correct spelling.
viewstring

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.

ParameterTypeDescription
issue_id *string
project_id *string
scan_id *string
branch_idstring

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.

ParameterTypeDescription
comment *string
issue_id *string
project_id *string
scan_id *string
state *string
branch_idstring

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.

ParameterTypeDescription
branch_id *string
destination *string
project_id *string
scan_idstring

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.

ParameterTypeDescription
branch_name *string
kind *string
source_directory *string
descriptionstring
namestring
project_idstring
scan_changesobject

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.

ParameterTypeDescription
branch_id *string
kind *string
project_id *string
cursorstringFor 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…
depthinteger
end_lineinteger
page_sizeintegerItems per page (default 20, max 100). total counts all matching items; summary total counts groups.
pathstring
scan_idstring
start_lineinteger

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.

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

ParameterTypeDescription
project_id *string
section *string
include_templateboolean
scan_idstring

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.

ParameterTypeDescription
changes *object
project_id *string
section *string
base_revisionstring

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.

ParameterTypeDescription
kind *string
cursorstringFor 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_schemaboolean
page_sizeintegerItems 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.

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

ParameterTypeDescription
action *string
kind *string
base_revisionstring
changesobject
idstring
valueobject

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.

ParameterTypeDescription
cursorstringFor 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…
idstring
page_sizeintegerItems 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.

ParameterTypeDescription
branch_id *string
project_id *string
label_suffixstringOptional readable suffix, e.g. SCA_SCAN gives MCP-SCA_SCAN. Empty gives MCP. No random suffix is added.
scopestringModules 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.

ParameterTypeDescription
branch_idstring
cursorstringFor 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_diagnosticsboolean
operation_idstring
page_sizeintegerItems per page (default 20, max 100). total counts all matching items; summary total counts groups.
project_idstring
scan_idstring

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.

ParameterTypeDescription
branch_idstring
operation_idstring
project_idstring
scan_idstring