MCP endpoint¶
Midair can serve its main operations to an AI assistant over the Model Context Protocol. The assistant acts as one account, through a token of that account, and it may see and start exactly what that account may.
Turn it on¶
The endpoint is off by default. Open Settings, then Integrations, then MCP, and turn the switch on. While it is off, the address answers 404.
The credential is a personal API token with the mcp scope. See
API tokens and the HTTP API.
claude mcp add --transport http midair https://midair.example.com/mcp \
--header "Authorization: Bearer <token>"
The transport is Streamable HTTP in its JSON-only form: one JSON-RPC message or batch per request, one JSON body per answer. There is no event stream and no session identifier.
The core resolves the token to its owner before the plugin sees the request. Every tool then acts as that account, under the same route guard and the same team seats as the screens.
The tools¶
Workspaces
midair_list_workspacesThe workspaces that the account may see.
Test runs
midair_list_runsThe test runs and the test templates, with a filter for the kind and the state.
midair_get_runOne run or template, with its configuration, state, timings, result counts and last error.
midair_create_runA new test template in a workspace. With
start, it also starts a run. Withlock_nodeset to false, its runs do not lock the node.midair_update_runChange the name, the run parameters, the notes or
lock_nodeof a template or a run.midair_start_runStart a run from a template or from an earlier run. The answer carries the identifier of the new run.
midair_wait_runWait for a run or an analysis to settle.
midair_run_failuresThe tests of a finished run that did not pass, each with its path, its parameters, the two verdicts, the error lines and the node identifier.
midair_get_run_resultsThe full result tree of a finished run.
midair_get_logOne page of the log of a run.
midair_analyze_logProcess the log of a finished run.
midair_get_ai_reviewThe timeline and the review of a run.
Analyses
midair_list_analysesThe analysis runs and the analysis templates.
midair_get_analysisOne analysis, with its state, progress, finding counts, findings, SBOM and authorship data.
midair_start_analysis,midair_stop_analysisStart an analysis from a template or from an earlier one, and stop a running one.
midair_analysis_treeThe source tree that an analysis looked at.
midair_analysis_fileOne source file as the analysis saw it.
midair_analysis_suspicionsThe suspicious places that one analysis reported, with a filter for the category and the confidence. Empty unless the analysis asked for them. See Suspicious places.
Attack vectors
midair_list_attack_vectorsThe attack vectors, with the stage, the iteration and the finding count of each.
midair_get_attack_vectorOne vector: what it aims at, where the loop is, and the runs of the current iteration.
midair_attack_vector_reportWhat a vector established: the findings with their evidence, the per-iteration log with the gaps each round reported, and the plan the current iteration works from.
midair_start_attack_vector,midair_stop_attack_vectorStart attacking a vector, or stop a running one. See Attack vectors.
Nodes
midair_list_node_locksEach node and its lock: the holder, the reason and the time.
midair_lock_nodeLock a node by hand, with an optional reason.
midair_unlock_nodeRelease the lock of a node, whoever holds it. Ask the user before you release a lock that is not theirs. See Locks.
Devices
midair_list_devicesThe monitored devices, with their status and drift counts.
Comments
midair_list_commentsThe thread on a run, an analysis or a device.
midair_add_commentPost a comment as the owner of the token.
A tool that starts or changes something needs a developer seat on the workspace of the record. See Users, teams and access.
Setting up¶
The assistant can set up an instance from nothing, in one conversation: the
nodes, the projects, the templates, the test suites, the attack vectors, the
users and the teams. Each kind of record has a create, an update and a
delete tool.
midair_create_node,midair_update_node,midair_delete_nodeA node. Every account may create one. It belongs to the account, and only that account and the administrators change it.
midair_test_nodechecks that Midair can sign in to it.midair_list_nodeslists the nodes that the account may see.midair_create_workspace,midair_update_workspace,midair_delete_workspaceA project: the code under test, the Test Environment, the test suite and the node.
midair_get_workspaceshows its configuration.midair_create_run,midair_update_run,midair_delete_runA test template.
scheduleplans runs.midair_create_analysis,midair_update_analysis,midair_delete_analysisAn analysis template: the jobs, the suspicious places, the coding standard and the schedule.
midair_list_distributionsnames the analyzer builds.midair_create_test_suite,midair_update_test_suite,midair_delete_test_suiteA generated test suite, which an attack vector writes its tests into.
midair_create_attack_vector,midair_update_attack_vector,midair_delete_attack_vectorAn attack vector, with its analysis template, test template and test suite.
midair_create_user,midair_update_user,midair_delete_user,midair_list_usersA user. Administrators only. Midair stores the password as a hash.
midair_create_team,midair_update_team,midair_delete_team,midair_list_teamsA team: its members, the projects with the seat on each, and its nodes. Administrators only. On a shared instance,
midair_list_teamsreturns nothing to other accounts.
A reference to another record takes its identifier or its name: the node of a project, the project of a template, the templates of an attack vector, the members of a team.
The tools do not take passwords or keys for nodes and repositories, and the
assistant must not ask for them in the conversation. When it needs one, it
calls midair_request_credentials with the secrets it needs, and says for
each what it is for, for example “SSH login and password for node lasirena”.
The tool returns the address of a short page, /secrets/new, that numbers
the secrets and shows that explanation above each. The person opens the
page, types the secrets there, and copies back the list that the page shows:
one line name = id for each credential. The explanation becomes the
description of the credential. The tools take those names or identifiers.
midair_list_credentials lists the names, not the contents.
The page stores each credential for the account that opens it. A record may point only at a credential of the account that writes it, unless that account is an administrator. The address names the account that the assistant works as, and the page refuses to store anything for a different account.
A delete that also removes or unlinks other records needs confirm: true.
Removing a project removes its runs, analyses, test suites and attack vectors.
The tools apply the same rules as the screens: the rights of the account, the limits of the licence features, a unique login and e-mail for a user.
The loop for a test suite¶
An assistant that edits a test suite runs this loop:
Push a branch.
midair_start_runwithts_git_refset to the branch. Follow the run identifier from the answer, and not the identifier that you passed in.midair_wait_run.midair_run_failures.midair_get_logwith thenode_idof a failure, to read the log of that one test.Fix, and start again.
A run pins any of the three checkouts to a branch, a tag or a commit. The three
fields are ts_git_ref, repo_git_ref and te_git_ref. A pin changes
nothing in the workspace. See Revision overrides.