tampermonkey-mcp

v0.0.4
io.github.Tampermonkey/tampermonkey-mcp Checked 4 days ago Published 6 months ago

MCP server to manage your Tampermonkey scripts

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

tampermonkey.get-connection-code

REQUIRED FIRST STEP: Get the connection code to connect Tampermonkey Editors to the MCP server. **How it works:** The MCP server creates a WebSocket server that waits for Tampermonkey Editors to connect. You must call this tool FIRST to start the WebSocket server and get a connection code. Then enter the code in the Tampermonkey Editors extension - it will connect TO the MCP server. **Steps:** 1. Call this tool to get the connection code 2. Open Tampermonkey Editors extension in your browser 3. Enter the code in the ext…

tampermonkey.list

List all userscripts available in Tampermonkey. **Input:** - `pattern` (optional): Filter scripts by name pattern - `includePattern` (optional): Filter scripts by include URL pattern **Output:** Array of userscript metadata including: - `name`: Script name - `namespace`: Script namespace - `path`: Script path (used for get/patch operations) - `requires`: List of @require dependencies - `storage`: Storage path (if any)

ParameterTypeDescription
includePatternarrayFilter scripts by include URL pattern
patternstringFilter scripts by name pattern

tampermonkey.get

Get the content of a specific userscript. **Input:** - `path`: The script path (from list operation) - `ifNotModifiedSince` (optional): Unix timestamp - only return if script was modified after this time **Output:** - `value`: The script source code - `lastModified`: Unix timestamp of last modification - `error`: Error object if script not found or concurrent edit detected

ParameterTypeDescription
path *stringThe script or resource path (<script-uuid>/source, <script-uuid>/storage or <script-uuid>/<external-resource-url>
ifNotModifiedSincenumberUnix timestamp - only return if script was modified after this time

tampermonkey.patch

Update the content of a userscript. **Input:** - `path`: The script or resource path (from list operation) - `value`: The new script content - `lastModified` (optional): Unix timestamp for optimistic locking **Output:** - `success`: true if patch was applied successfully - `error`: Error object if patch failed (e.g., concurrent edit conflict)

ParameterTypeDescription
path *stringThe script path (e.g., "<script-uuid>/source")
value *stringThe new script content
lastModifiednumberUnix timestamp for optimistic locking

tampermonkey.put

Create a new userscript. **Input:** - `value`: The script source code content - `lastModified` (optional): Unix timestamp for optimistic locking **Output:** - `success`: true if script was created successfully - `path/name`: The path and name of the new script - `error`: Error object if creation failed (e.g., script already exists, concurrent edit conflict)

ParameterTypeDescription
value *stringThe script source code content
lastModifiednumberUnix timestamp for optimistic locking

tampermonkey.delete

Delete a userscript by path. **Input:** - `path`: The script or resource path (<script-uuid>/source, <script-uuid>/storage or <script-uuid>/<external-resource-url>) **Output:** - `success`: true if script was deleted successfully - `error`: Error object if deletion failed (e.g., script not found)

ParameterTypeDescription
path *stringThe script or resource path (<script-uuid>/source, <script-uuid>/storage or <script-uuid>/<external-resource-url>)