customaise
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| CUSTOMAISE_WS_PORT | No | WebSocket server port | 4050 |
| CUSTOMAISE_WORKSPACE | No | Absolute path where .customaise/ files should be written. Useful for IDEs that don't set cwd to the project root | |
| CUSTOMAISE_MCP_ALLOW_INSECURE | No | Set to '1' to disable the origin allowlist. Tests only. | |
| CUSTOMAISE_MCP_EXTRA_EXTENSION_IDS | No | Comma-separated list of extra extension IDs allowed to connect. Needed for unpacked dev builds with a non-standard extension ID |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Role
You are a Script Engineer working with Customaise, a Chrome extension that manages userscripts and WebMCP agents.
You create, edit, and debug scripts that run securely within the user's browser sandbox.
If you also have a terminal
The same control surface is available as a CLI, so anything you can do here you
can do from a shell: npx -p @customaise/mcp customaise doctor. That matters
when you spawn a sub-agent that has a shell but no MCP client of its own, or when you
want the browser, the filesystem and the shell driven by one process. Run
customaise init in the project to write a primer the next agent can read.
If you CANNOT read files
get_page_context and get_console_context default to writing their full payload
into .customaise/ and returning a summary plus the path, which keeps a large DOM
snapshot out of your context window. That only works if you hold a tool that can open
a local file. If you do not (a chat client with no filesystem tool, for example),
pass output: "inline" and the whole payload comes back in the response with nothing
written to disk. take_screenshot takes the same flag: output: "inline" attaches
the image to the response instead of saving a PNG you cannot open. Do not keep calling
a tool whose file you cannot read; switch to
inline on the second call. The same applies to the .dom.md files mentioned below:
if you cannot open them, call get_selected_elements, which returns the selections
directly.
Script Types
Customaise supports two distinct paradigms. Your structural formatting depends entirely on what the user is asking for. CRITICAL: You must read the specific conventions handbook before building either type.
UserScripts (Traditional DOM manipulation): Read
customaise://userscript-conventionsAgentScripts (WebMCP tool injection): Read
customaise://agentscript-conventions
For typed decisions inside either script type, also read customaise://script-decisions. It explains @grant CM_decisions, CM_decisions.create with questions written out in the code, device/provider setup, billing, and bounded failure handling. This capability requires Power User. When the person has turned on Script Decisions under Full access in Agent permissions, set_script_decisions chooses a script's provider and switches its question lists; read the state first with get_script_decisions. No tool can turn that on, and keys, device access, daily limits, the device pause, runaway-loop pauses and shared scripts stay with the person.
General Workflow
Understand: Use
get_page_contextto inspect the target page's DOM, visible elements, anddom_*IDs.Write: Create the script in the workspace directory (e.g.,
./customaise-scripts/). Never use/tmp.Install: Use
export_scriptto push the script into Customaise. It validates through a strict sanitization pipeline.Test: Use
reload_tabto re-inject the updated script on the target page.Verify: Use
get_console_contextto check for runtime errors, or uselist_webmcp_toolsto confirm agent availability.Iterate: If the pipeline returns validation errors or the console shows runtime errors, fix the file locally and re-export.
Shared / Subscribed Scripts
Some scripts in
list_scriptshaveisShared: true. These are read-only subscriptions via Customaise Cloud.You cannot import, edit, or overwrite these via MCP.
If the user wants to augment a shared script, instruct them to open the Customaise UI and click "Unlock & Fork" to create an editable clone.
User Selections & Context
When a user asks you to interact with specific page elements:
Check for manual selections: Use
get_selected_elements. The user may have explicitly clicked elements to target.Check the workspace: Look for
.dom.mdfiles in.customaise/dom-context/(auto-pushed when users select elements visually).If selections exist, use their
domIdvalues with Customaise's robustCM_findElementtargeting API.If no selections exist, ask the user to select elements via the Customaise UI DOM Selector tool, or fall back to standard CSS selectors.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| call_webmcp_toolA | Execute a registered WebMCP tool directly on the target browser tab. If the tool is interactive (trust level), the user will be natively prompted by CustomAIse to approve the execution before it returns. Approval can take minutes when the user is away from the browser (remote approvals on a phone). This server sends progress notifications while it waits, so a client that resets its timeout on progress will wait with it. A client that caps tool calls at a fixed 60 seconds regardless will report this call as failed while the user can still approve it and the tool can still run; if that happens, do not blindly re-issue a call with side effects. Check the outcome first with a read-only tool or the page itself. A result over 64 KB WRITES A FILE by default: the whole result goes to .customaise/tool-results/ in your workspace, which keeps the newest 20, and this call returns the path with the result's small values. If you have no filesystem tool, pass output: "inline" to get it in the response with long lists shortened instead. |
| close_tabA | Close a specific browser tab. Defaults to the active tab if no tabId is provided. |
| delete_scriptA | Permanently delete a script (UserScript or AgentScript) from Customaise. This action cannot be undone. NOTE: Shared/subscribed scripts cannot be deleted via MCP — the user must unsubscribe from the extension UI. Forks created via import_script(fork:true) are owned scripts and CAN be deleted via MCP. |
| export_scriptA | Export a script from a local file into Customaise. The file will be validated through Customaise's sanitization pipeline (syntax checking, AST validation, security analysis). If valid, the script is installed and ready to execute on matching pages. If invalid, detailed diagnostics explain exactly what to fix. Pass scriptId to update an existing script instead of creating a new one. Pass expectedCodeHash from import_script to reject stale edits. Save progress includes an operation ID and stage. A timeout may leave the outcome unknown: query get_bridge_status with the scriptId and operationId from the error before retrying. The extension enforces a 90-second save deadline and cancels work that has not reached persistence. A storage write already submitted cannot be recalled; its commit receipt resolves that uncertainty. For a script that uses CM_decisions, scriptDecisions in the result says whether its Script Decisions provider stays chosen for the new code, and if not, why and what to do. NOTE: You cannot overwrite a shared/subscribed script — they are read-only. If you need to edit a shared script, first call import_script with fork:true (creates an editable independent copy), then export to that copy's scriptId. |
| focus_tabA | Bring a specific browser tab to the front and make it active. |
| get_bridge_statusA | Report the bridge's own state: whether the extension is attached, the plan tier, whether you are signed in, whether remote approvals are enabled, the browser's agent permissions (agentPermissions: Full access, and scriptDecisions, whether agents may choose Script Decisions providers), and how much of the MCP cap is left today and this week. Costs NO cap units. Without scriptId it reads cached bridge state; with scriptId it queries the browser for the latest save status and durable commit receipt. After a timeout, inspect that status before retrying. Unknown means no retained proof, not proof of failure. Check this before a long run so you find out you have three calls left now rather than mid-task. |
| get_console_contextA | Get console logs from the browser, including errors, warnings, and userscript GM_log output. Use after reload_tab to check for script runtime errors. WRITES A FILE by default: the full log data goes to .customaise/console-context.json in your workspace and this call returns counts plus the path. Read the file with view_file or grep_search. If you have no filesystem tool, pass output: "inline" to get the whole log in the response and write nothing to disk. |
| get_page_contextA | Get a DOM snapshot of the current page including URL, title, page structure, and visible elements. Use this to understand the page layout before writing userscripts that manipulate it. WRITES A FILE by default: the full snapshot goes to .customaise/page-context.json in your workspace and this call returns a summary plus the path, so a large page does not fill your context window. Read the file with view_file or grep_search. If you have no filesystem tool, pass output: "inline" to get the whole snapshot in the response and write nothing to disk. |
| get_script_decisionsA | Read Script Decisions on this device: the typed decisions scripts make through @grant CM_decisions. Returns whether agents may manage it (agentAccess.scriptDecisions; the person turns it on under Full access in Customaise Settings, Agent permissions), sign-in and plan (Power User is required), whether this device is allowed (deviceEnabled) or paused (locallyPaused), which provider keys are saved, and every script that uses CM_decisions or has a provider: its provider (jev, openai-decisions, gemini-decisions or null), supported (the providers that can answer at least one of its question lists; choose among these) and state, one of ready, off, choose_again (its code or this device changed since the provider was chosen; reason says which), paused (pausedReason loop_repeat or loop_runaway) or invalid (issue). chosenByAgent marks a provider an agent chose. With scriptId it also returns that script's question lists (sets: hash, enabled, questions, and providers, the ones that answer that list; under another provider it stays Off), the problems found in its code (issues, with line numbers) and today's decisions on this device (rowsToday). Use it before set_script_decisions, which names question lists by these hashes, and after export_script to check a script's provider. Reads only; nothing is sent to a provider. Needs extension 1.4.0 or later. |
| get_selected_elementsA | Get DOM elements that the user has visually selected in the browser for a specific script. Returns each selection's stable, tiered selectors, element context, and user comments. Returns the selections in this response, so it needs no filesystem access. WRITES FILES only when you pass writeFiles: true, which saves .dom.md context files under the directory you name. Use CM_findElement with the domId for precise targeting in scripts. When MCP is connected, .dom.md context files and screenshots are automatically pushed to the workspace (.customaise/dom-context//) in real-time as the user selects elements. Use this tool to retrieve selections if the auto-pushed files are missing or to get the raw JSON data. |
| import_scriptA | Import a Customaise script (UserScript or AgentScript) to a local file for editing. The file contains the full source with metadata block. After editing with your IDE tools, use export_script to push changes back. Optional 'fork' flag (default false): when set to true, the script is FORKED into a new independent local copy BEFORE import, and the FORK is what gets written to the file. ALWAYS creates a new script — symmetric across source types, never a silent no-op:
Without 'fork', subscribed scripts cannot be imported — they're read-only and the call refuses with a clear error pointing at fork:true. Owned scripts import normally (edit-in-place workflow). IMPORTANT: Save files inside your current workspace or project directory (e.g., ./customaise-scripts/), never in /tmp. |
| list_scriptsA | List all scripts (UserScripts & AgentScripts) installed in Customaise with their IDs, names, enabled status, match patterns, and whether they are shared (subscribed). Scripts marked isShared are read-only subscriptions — they cannot be imported, exported, or deleted directly. To edit a shared script, call import_script with fork:true (creates an independent editable copy). To uninstall a shared script, the user must unsubscribe from the extension UI. |
| list_tabsA | List all open browser tabs with their IDs, URLs, titles, and active status. Use to find a specific tab ID for other tools like reload_tab or take_screenshot. |
| list_webmcp_toolsA | List all WebMCP tools currently registered by AgentScripts for a specific browser tab. Use this to verify that an exported AgentScript is correctly registering its tools on the target page. Each entry carries a |
| open_tabA | Open a new browser tab with the specified URL. Defaults to opening in the background so the user is not snatched away from the tab they are currently viewing. Returns the new tab ID. |
| reload_tabA | Reload a browser tab to re-inject updated userscripts. Use after export_script to see the effect of your changes. Waits for the page to fully load before returning. If the tab has AgentScript (WebMCP) tools registered, automatically waits for them to re-register before returning. |
| set_script_decisionsA | Choose the Script Decisions provider for one script on this device: jev, openai-decisions (OpenAI Decisions API), gemini-decisions (Gemini Decisions API), or off. Once a provider is chosen, the script's CM_decisions calls run without asking and are billed to the person's saved key for that provider, so choose one only when the person wants it. sets switches On exactly the question lists it names, by the hashes get_script_decisions returns for this scriptId, and every other list Off. Without sets, unchanged code keeps its On/Off choices and changed code switches every list On. Choosing a provider again also resumes a script the loop guard paused for repeating the same input (pausedReason loop_repeat). Choosing a provider needs the person to have turned on Script Decisions under Full access in Customaise Settings, Agent permissions; only they can, in the extension. Switching a script off is always allowed. These stay with the person: provider keys, this device's Allow Script Decisions switch, daily limits, pausing this device, a script paused for a runaway loop (loop_runaway), and scripts shared with them. When the error type is person_required, tell the person the next step the message names and do not retry. Other refusals carry type rejected, not_found, auth_required or invalid_argument, with the precise reason in code. After service_unavailable or a timeout the outcome is uncertain: read the state with get_script_decisions before trying again. Returns the script's state as get_script_decisions does for one script. Needs extension 1.4.0 or later. |
| sync_scriptsA | Bulk export all your own scripts from Customaise to a local directory as individual .user.js or .agent.js files. WRITES MANY FILES and OVERWRITES existing ones: a local file whose name matches a script is replaced by the copy held in Customaise, so unexported local edits in that directory are lost. Creates a .customaise-manifest.json mapping filenames to script IDs. Shared/subscribed scripts are excluded (they are read-only). Use this to set up a local workspace for editing scripts with your IDE. |
| take_screenshotA | Capture a screenshot of a browser tab without stealing focus from the user. Defaults to the visible viewport. Set fullPage: true to capture the entire scrollable page as one tall image. WRITES A FILE by default: the PNG is saved to filePath, or to an auto-generated path in the system temp directory when filePath is omitted, and this call returns that path rather than the image. If you have no filesystem tool, pass output: "inline" and the image is attached to this response instead, with nothing written to disk. For background tabs and full-page captures, Chrome briefly displays its standard yellow developer-tools notice at the top of the target tab during capture; it clears automatically when capture completes (typically under one second). |
| toggle_scriptA | Enable or disable a userscript. Disabled scripts are not injected into matching pages. Use this to temporarily turn off a script without deleting it. |
| toggle_uiA | Show or hide the Customaise UI overlay on the active tab. Use this to make the Customaise interface visible or dismiss it — AI agents cannot click the extension icon directly. Optionally specify which panel to open. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| scripts-list | Live list of all userscripts managed by Customaise, including their IDs, names, and enabled status. |
| conventions | Directory pointer for Customaise conventions. |
| userscript-conventions | Complete conventions, workflow, and API guide for building Customaise UserScripts. |
| script-decisions | Script Decisions: questions written in the code, the CM_decisions API, a working example, setup, choosing providers with get_script_decisions and set_script_decisions, billing and safe failure handling for both script engines. |
| agentscript-conventions | Complete conventions, workflow, and API guide for building Customaise AgentScripts. |
TDQS
Scored across 21 tools
Most tools target a clearly distinct resource and action (tabs, scripts, page context, WebMCP tools, bridge status). The main ambiguity is import_script vs export_script, whose directionality is counterintuitive (import = app→local file, export = local file→app), and sync_scripts adds another bulk-export path. Descriptions clarify the boundaries, but an agent could still misselect on the import/export pair.
Every tool follows a consistent snake_case verb_noun pattern: get_page_context, list_tabs, open_tab, close_tab, delete_script, export_script, toggle_ui, etc. No mixed conventions or vague bare verbs.
At 21 tools the surface is on the heavy side, but the server genuinely spans several subdomains: tab control, script lifecycle, page/console/selection context, WebMCP tools, and bridge diagnostics. Each tool maps to a distinct capability, though some tab and script operations could potentially be consolidated.
Script lifecycle coverage is strong (list, import, export, sync, toggle, delete, fork semantics) and tab/context/WebMCP operations are well represented. Minor gaps include no direct inline script read/write without relying on filesystem tools, and no ability to change WebMCP permissions or agent settings from the MCP surface. These are documented limitations but still leave some dead ends for fileless agents.