tampermonkey avatar

Tampermonkey Mcp

tampermonkey/tampermonkey-mcp

Bridges your AI assistant directly to the Tampermonkey browser extension so you can read, list, and modify userscripts through natural language. After installing the Tampermonkey Editors extension, you call get-connection-code to establish a local WebSocket connection, then use list to see all your scripts, get to read their contents, and patch to modify them. The authentication flow uses connection codes derived from the WebSocket port plus tokens for security. Reach for this when you want to iterate on userscripts conversationally instead of manually editing them in the browser, or when you need to programmatically manage a collection of scripts. Works with both Firefox and Chrome through their respective Tampermonkey Editors extensions.

GitHub stars
13
tools
6
transport
STDIO
last updated
May 13, 2026

Tools

6 tools

Public tool metadata for what this MCP can expose to an agent.

tampermonkey_get_connection_codeInitialize connection by getting the WebSocket connection code.

Initialize connection by getting the WebSocket connection code.

No parameter schema in public metadata yet.

tampermonkey_listList all available userscripts.

List all available userscripts.

No parameter schema in public metadata yet.

tampermonkey_getGet content of a specific userscript.

Get content of a specific userscript.

No parameter schema in public metadata yet.

tampermonkey_patchUpdate userscript content.

Update userscript content.

No parameter schema in public metadata yet.

tampermonkey_putCreate a new userscript with the given name and namespace.

Create a new userscript with the given name and namespace.

No parameter schema in public metadata yet.

tampermonkey_deleteDelete an existing userscript.

Delete an existing userscript.

No parameter schema in public metadata yet.

Sponsors

Readme

How to use

First install the following browser extensions:

Then install tampermonkey-mcp globally:

npm install -g tampermonkey-mcp@latest

Finally configure your AI assistant to use the tampermonkey tool:

{
  "mcpServers": {
    "tampermonkey": {
      "command": "npx",
      "args": [
        "-y",
        "tampermonkey-mcp@latest"
      ]
    }
  }
}

Your assistant will call tampermonkey_get_connection_code and return a connection code that you can enter in the Tampermonkey Editors extension.

Claude Code configuration example

npm install -g @anthropic-ai/claude-code

// either use your local checkout
npm run watch
claude mcp add --transport http --scope project tampermonkey http://localhost:4001/mcp

// or the npm package
npm install -g tampermonkey-mcp@latest
claude mcp add --transport stdio --scope project tampermonkey -- npx -y tampermonkey-mcp

View the full README on GitHub

Details

Repository
github.com/tampermonkey/tampermonkey-mcp
Package
tampermonkey-mcp
Transport
STDIO
Registry
MCP registry, active