TruePx

v0.1.6
io.github.thyitachi/truepx-mcp Checked 1 day ago Published 1 day ago

Lets AI coding agents measure, inspect, edit and audit web pages in your Chrome through TruePx.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

ping

Health check, forwarded to the extension. Replies with extension + bridge versions.

tabs_list

Tabs where TruePx is currently on. Returns { tabId, url, title } per tab; other tabs are invisible.

tab_focus

Bring a tab to the foreground so the user can watch edits happen.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

page_info

Page metadata: url, title, lang, description, OG tags, h1, viewport meta, page size, scroll, devicePixelRatio.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

selection_get

The element the user has locked in the TruePx overlay (id, tag, selector, classes, rect, computed subset, text). Starting point for "this element".

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

element_inspect

Uniform summary for one element: id, tag, selector, classes, rect, computed CSS subset, direct text.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.
viewportIdnumberResponsive mode only: viewport from viewport_state that should answer. Element ids are per-viewport — only pass ids that came from this viewport.

elements_inspect

Batch element_inspect for up to 50 ids; unresolvable ids are reported separately.

ParameterTypeDescription
elementIds *array
tabId *numberId of a tab where TruePx is on, from tabs_list.
viewportIdnumberResponsive mode only: viewport from viewport_state that should answer. Element ids are per-viewport — only pass ids that came from this viewport.

dom_outline

Depth-limited subtree walk from an element (default body). Keeps layout exploration payloads small.

ParameterTypeDescription
elementIdstringRoot element id; 'body' targets document.body. Omit for current selection.
maxChildrennumberMax children per node (default 30).
maxDepthnumberMax depth (default 8).
tabIdnumberId of a tab where TruePx is on, from tabs_list.
viewportIdnumberResponsive mode only: viewport from viewport_state that should answer. Element ids are per-viewport — only pass ids that came from this viewport.

dom_query

CSS selector search, up to 200 matches (id, tag, classes, rect, text, attrs). Optional rootId scopes the search.

ParameterTypeDescription
selector *string
tabId *numberId of a tab where TruePx is on, from tabs_list.
limitnumber
rootIdstring
viewportIdnumberResponsive mode only: viewport from viewport_state that should answer. Element ids are per-viewport — only pass ids that came from this viewport.

css_matched_rules

Every CSS rule matching an element, highest specificity first, plus inline style text. Each rule carries a ruleHandle for css_set_inline.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.
viewportIdnumberResponsive mode only: viewport from viewport_state that should answer. Element ids are per-viewport — only pass ids that came from this viewport.

edits_list

All tracked edits on the tab (CSS diffs with revert ids, class/HTML/text edits). Call first to review prior work.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

capture_screenshot

Viewport PNG with the TruePx highlight overlay (dock excluded), returned as an image block for vision models.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

css_set_inline

Merge declarations into a rule (ruleHandle) or an element's inline style (elementId). Empty value deletes a property; values may carry !important.

ParameterTypeDescription
styles *objectCSS prop → value, e.g. { color: 'red' }.
tabId *numberId of a tab where TruePx is on, from tabs_list.
elementIdstringRequired without ruleHandle; ignored with ruleHandle.
ruleHandleobjectRule handle from css_matched_rules or css_create_rule. Pass back exactly as received; hand-built refs are rejected.

css_create_rule

Add a real cascade rule (no !important needed). Optional at-rule wrappers outermost-first, optional seed declarations. Returns a ruleHandle.

ParameterTypeDescription
selector *string
tabId *numberId of a tab where TruePx is on, from tabs_list.
elementIdstringInject into this element's shadow root instead of the document.
stylesobject
wrappersarrayAt-rule strings, e.g. ["@media (min-width: 768px)"].

css_set_selector

Retarget a rule's selector. Returns a refreshed ruleHandle; nesting selectors are read-only.

ParameterTypeDescription
ruleHandle *objectRule handle from css_matched_rules or css_create_rule. Pass back exactly as received; hand-built refs are rejected.
selector *stringNew selector text.
tabId *numberId of a tab where TruePx is on, from tabs_list.

edits_revert

Revert one tracked CSS change by its changeId (from an edit response or edits_list).

ParameterTypeDescription
changeId *string
tabId *numberId of a tab where TruePx is on, from tabs_list.

edits_revert_all

Revert every tracked change on the tab (rules, inline styles, classes, HTML/text). Same coverage as the panel's revert-all.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

dom_set_text

Replace an element's text (drops HTML children). Undoable.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.
text *stringNew plain text.

dom_set_html

Replace inner HTML. Strips script/style/iframe/form/input/link/meta and inline handlers.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
html *string
tabId *numberId of a tab where TruePx is on, from tabs_list.

dom_insert_html

Insert sanitized HTML relative to an element: before | after | prepend | append.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
html *string
position *string
tabId *numberId of a tab where TruePx is on, from tabs_list.

element_set_classes

Replace the full class list (space-separated; empty clears). Undoable.

ParameterTypeDescription
classes *string
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.

selection_set

Highlight an element in the TruePx overlay, scroll it into view, update the panel.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.

dom_remove

Soft-delete (hidden, reported removed, restorable). Undoable.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.

dom_duplicate

Clone after the original with a fresh id. Undoable.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.

page_breakpoints

Declared @media breakpoints ascending; em/rem normalized against root font size.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

find_overflow

Elements pushing the page past the viewport (horizontal-scroll culprits), biggest overflow first with fix hints.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

fix_contrast

Nudge foreground colors in an element subtree until each text meets its WCAG AA requirement (4.5:1, or 3:1 for large text), measured by axe-core against the real background. target overrides it (e.g. 7 for AAA). Pass preview:true to suggest without applying.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.
previewboolean
targetnumber

simulate_vision

Simulate color-vision deficiency page-wide so designs can be judged as affected users see them. Mode off disables.

ParameterTypeDescription
mode *string
tabId *numberId of a tab where TruePx is on, from tabs_list.

mockup_overlay

Pin a design mockup over the live page to compare implementation vs design. set takes a data:image URL (+ optional file name; "@2x" in it picks @2x size); config adjusts opacity/blend/position/scale (fit = page width, 1x = actual pixels, 2x = half size for Retina exports; set picks 1x or 2x automatically); difference blend is an onion-skin diff.

ParameterTypeDescription
action *string
tabId *numberId of a tab where TruePx is on, from tabs_list.
blendstring
dataUrlstring
namestring
opacitynumber
scalestring
visibleboolean
xnumber
ynumber

sweep_breakpoints

Load the page at probe widths in hidden frames and report where layout breaks or heals. Optional widths array (max 9, 200–3840). Slow — allow up to ~40s.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.
widthsarray

find_inconsistencies

Scan the page for visual drift: button style clusters, heading variation, off-grid spacing, near-miss alignment.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

list_pins

Designer pins: id, selector, note, status, live rect. Work open pins top to bottom, then resolve each.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

add_pin

Drop a pin on an element with a note (for batch review comments).

ParameterTypeDescription
note *string
tabId *numberId of a tab where TruePx is on, from tabs_list.
elementIdstringElement id from an earlier element tool.
selectorstring

resolve_pin

Close a pin by id once acted on (resolved:false reopens).

ParameterTypeDescription
pinId *string
tabId *numberId of a tab where TruePx is on, from tabs_list.
resolvedboolean

font_forensics

Which font in the stack actually rendered, plus faux bold/italic detection.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.

find_heavy_images

Images costing more than they show: oversized, unsized, eager below the fold, legacy formats.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

capture_states

Screenshots of one element in default/hover/focus/active states, returned as image blocks. Slow — allow ~30s.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.

viewports_open

Wrap the page in resizable frames. Discards pending CSS edits — call edits_list first.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

viewports_close

Reload at natural viewport. Discards edits made inside responsive mode.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

viewport_update

Resize one viewport (200–3840 × 300–3840). Without viewportId resizes the first.

ParameterTypeDescription
height *number
tabId *numberId of a tab where TruePx is on, from tabs_list.
width *number
viewportIdnumber

viewport_state

Canvas state: viewports in on-screen order (id, size, name, color scheme), zoom, breakpointsMode, scroll sync. Empty outside responsive mode.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

viewports_set

Replace the whole viewport set left-to-right in one rebuild (prefer over repeated viewport_add). Exits breakpoints mode.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.
viewports *array

viewport_add

Add one frame (inherits current edits for comparison). Omit size to copy the last viewport.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.
heightnumber
namestring
widthnumber

viewport_remove

Remove one frame by id. Removing the last leaves an empty canvas. Unavailable in breakpoints mode.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.
viewportId *number

viewports_zoom

Canvas scale 0.25–2 (visual only; frames still report declared size, media queries unaffected).

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.
zoom *number

breakpoints_overlay

One viewport per declared breakpoint. Fails when the page declares none.

ParameterTypeDescription
enabled *boolean
tabId *numberId of a tab where TruePx is on, from tabs_list.

audit_run

Full page audit like the Audit tab: accessibility (labels, button names, contrast, alt), performance measured on this load (LCP + element, CLS + moved elements, server time, render-blocking, uncompressed files, images, third parties), content (placeholder text, repeated words, staging links, broken images, old © year, vague link text, cut-off text), launch & privacy (security headers, mixed content, secret keys in scripts, trackers before cookie consent, privacy/terms links, favicon), accessibility extras (zoom blocked, small tap targets, missing focus ring, ARIA mistakes, autoplay sound), sl…

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

page_seo_audit

SEO audit (title, description, h1, robots, alt text, OG tags…, plus robots.txt incl. AI assistant bots, sitemap, llms.txt and soft 404s) with severity + recommendations.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

page_meta

Meta values grouped SEO / Open Graph / Twitter. Read before social-card previews.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

page_weight

Byte breakdown: scripts, stylesheets, images, fonts, fetch, media, other + document size.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

css_variables

Every --* custom property in the cascade. Read before authoring CSS so agents reuse var(--foo).

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

page_typography

Font family/stack/size/weight/spacing/transform inside a subtree, with using selectors.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.

css_specificity

Specificity of any selector as tuple + comparable score. Use before writing overrides.

ParameterTypeDescription
selector *string
tabId *numberId of a tab where TruePx is on, from tabs_list.

page_colors

Distinct text/background/border colors rendered in a subtree (incl. gradients, canvas samples).

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.

page_assets

Images, SVGs, data URLs in a subtree with URL/content + rendered dimensions.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.

element_layout

Flex/grid breakdown (direction, justify, align, gap, templates). Null when neither.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.
viewportIdnumberResponsive mode only: viewport from viewport_state that should answer. Element ids are per-viewport — only pass ids that came from this viewport.

element_force_state

Force hover/focus/active/visited/focus-visible/focus-within to preview rendering; empty clears. Not in responsive mode.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
state *string
tabId *numberId of a tab where TruePx is on, from tabs_list.

page_tech_stack

Frameworks/CMS/analytics with versions. Call first on a new task — the stack shapes suggestions.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.

get_a11y_issues

WCAG contrast on the page: text measured by axe-core (AA failures, AAA misses, and kind "unknown" for text it could not measure, e.g. over a photo) plus single-colour SVG icons (3:1), worst first.

ParameterTypeDescription
tabId *numberId of a tab where TruePx is on, from tabs_list.
limitnumberMax issues (default 50).

element_tailwind

Computed styles → Tailwind v4 utilities. Pair with element_set_classes to apply.

ParameterTypeDescription
elementId *stringElement id from an earlier element tool.
tabId *numberId of a tab where TruePx is on, from tabs_list.

css_fetch_stylesheet

Raw CSS of an external stylesheet URL, fetched from the extension service worker (cross-origin reachable). HTTP(S) only; localhost/private IPs blocked.

ParameterTypeDescription
url *string