Skip to content

mcp-app-lint: lint live servers, suggest CSP, MCP server mode - #15

Merged
shteynu merged 1 commit into
mainfrom
feat/mcp-app-lint-live
Oct 13, 2026
Merged

shteynu merged 1 commit into
mainfrom
feat/mcp-app-lint-live

Conversation

@shteynu

@shteynu shteynu commented Oct 13, 2026

Copy link
Copy Markdown
Owner

What

mcp-app-lint can now check a running server, suggest the CSP a UI needs, and serve its checks to agents over MCP.

  • Live servers. --url <endpoint> (Streamable HTTP, --header "Name: value" repeatable, --timeout) and --stdio "<command>" do what a host does: initialize, resources/list, resources/read for every UI resource, tools/list. They never call a tool. A 401, a 404 or a timeout comes with a hint. The HTTP client moved here from census/lib/mcp-client.mjs, and the census now subclasses it with its own user agent.
  • --suggest-csp. Prints the _meta.ui.csp each UI document needs (connectDomains, resourceDomains, frameDomains, following the host formula in conformance/host.mjs), as JSON or text. MCPAPP001 carries the same suggestion in its message and in properties.suggestedCsp.
  • New rules, checked where the exact document is known (a read result or a live server):
    • MCPAPP020 csp-unused-domain (note): a declared host the document never mentions.
    • MCPAPP021 csp-host-undeclared (warning): the document loads from or calls an origin the declared CSP does not allow, so the host blocks it.
  • --mcp. Runs as an MCP server over stdio with six read-only tools: lint_ui_resource, suggest_csp, lint_tools, lint_a2ui, lint_directory, lint_server. No tool starts a process. The plugin still ships no MCP server; the mcp-app-csp skill uses these tools when the user has registered the server.
  • Fixes.
    • --dir path/ gave path//file locations, which code scanning cannot map.
    • The SARIF commandLine now masks header values, URL credentials and query values, and NAME=value assignments in the --stdio command, so a token passed with --header does not end up in code scanning.

No new dependencies.

Verification

  • npm run check is green: typecheck, unit tests, build, Chromium proofs, corpus 54/54 and 24/24.
  • New tests:
    • test/live.test.mjs: HTTP and stdio fixtures, server ping, non-JSON stdout, a server that exits, the MCP server loop, command-line redaction.
    • test/csp.test.mjs: needs by key, coverage, MCPAPP020/021, the suggestion in MCPAPP001, the trailing-slash fix, --suggest-csp output.
  • Manual run against the ext-apps basic-server-vue example, over --stdio and --url: MCPAPP008 and MCPAPP009, as expected. A wrong path gives the 404 hint and exit code 2.
  • --dir over all ext-apps examples gives the same findings as before.
  • claude plugin validate: passes, with the existing privacyPolicyUrl warning only.

mcp-app-lint: --url/--header and --stdio read what a running server
publishes (initialize, resources/list, resources/read of UI resources,
tools/list) and never call a tool, so a server owner can check the CSP and
HTML a host actually gets with one command. --suggest-csp prints the
_meta.ui.csp a document needs, following the host formula; MCPAPP001 now
carries the same suggestion. New rules where the exact document is known:
MCPAPP020 csp-unused-domain (note) and MCPAPP021 csp-host-undeclared
(warning). --mcp serves six read-only tools to agents; none starts a
process. The SARIF command line masks header values, URL credentials and
query values, and env assignments in --stdio, since code scanning stores
it. --dir path/ no longer gives path//file locations.

census: the Streamable HTTP client moved into mcp-app-lint; the census
subclasses it with its own user agent and client name.

plugin: the mcp-app-csp skill covers --url, --stdio, --suggest-csp, the new
rules, and the MCP tools when the user has registered the server; the
plugin itself still ships no MCP server.
@shteynu
shteynu merged commit b9cfa84 into main Oct 13, 2026
3 checks passed
@shteynu
shteynu deleted the feat/mcp-app-lint-live branch October 13, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant