
Tampermonkey Mcp
io.github.Tampermonkey由 GitHub 帳號 Tampermonkey 發布v0.0.4更新於 Oct 24, 2026
MCP server to manage your Tampermonkey scripts
概覽
讓 AI 助理透過 Tampermonkey Editors 瀏覽器擴充功能讀取、建立、修改與刪除 Tampermonkey 使用者腳本。
- 可以做什麼
- 取得連線碼,將伺服器與 Tampermonkey Editors 擴充功能配對
- 列出使用者腳本,可依名稱或 URL 樣式篩選
- 讀取腳本內容與最後修改時間
- 更新腳本內容,可選擇性使用樂觀鎖定
- 建立新的使用者腳本並刪除既有腳本
- 適用情境
- 適合已在 Tampermonkey 中維護瀏覽器使用者腳本、希望助理直接檢視、改寫、新增或刪除腳本而不必手動複製貼上程式碼的情境。僅限桌面環境,對象是已在 Chrome 或 Firefox 使用 Tampermonkey 的人。
- 執行需求
- 以本機程序方式透過 npm 執行(npx tampermonkey-mcp 或全域安裝),需在桌上型電腦使用。需要安裝 Tampermonkey 擴充功能,以及適用於 Chrome 或 Firefox 的 Tampermonkey Editors 擴充功能,並把助理回傳的連線碼輸入該擴充功能。建立與刪除腳本需 Tampermonkey Editors 1.0.6+ 與 Tampermonkey 5.6+。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Tampermonkey Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
How to use
First install the following browser extensions:
- Tampermonkey
- Tampermonkey Editors for Firefox or Chrome
Then install tampermonkey-mcp globally:
Finally configure your AI assistant to use the tampermonkey tool:
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
Build
Tampermonkey MCP Server Architecture
Overview
This project implements an MCP (Model Context Protocol) server that allows AI assistants to read and modify Tampermonkey userscripts via the Tampermonkey Editors browser extension.
Architecture Components
Connection Flow
- MCP Server starts - Creates WebSocket server on a random available port
- Connection code generated - Format:
<base32(port - 1024)><auth_token><echo_token> - User calls
tampermonkey_get_connection_code- Gets the connection code - User enters code in Tampermonkey Editors - Extension parses code to get port and auth
- Extension connects to MCP server - WebSocket handshake with authentication
- MCP tools become available - list, get, patch can now be called
Authentication Protocol
MCP Tools
tampermonkey_get_connection_code
- Purpose: Initialize connection by getting the WebSocket connection code.
- Required: Must be called first to start the WebSocket server.
- Output: Connection code to enter in Tampermonkey Editors.
tampermonkey_list
- Purpose: List all available userscripts.
- Input: Optional filter by name pattern or include URL pattern.
- Output: Array of userscript metadata (name, namespace, path, requires).
tampermonkey_get
- Purpose: Get content of a specific userscript.
- Input:
path(from list), optionalifNotModifiedSincetimestamp. - Output: Script content, lastModified timestamp, or error.
tampermonkey_patch
- Purpose: Update userscript content.
- Input:
path,value(new content), optionallastModifiedfor optimistic locking. - Output: Success confirmation or error.
tampermonkey_put
- Purpose: Create a new userscript with the given name and namespace.
- Input:
value(new script), optionallastModified. - Output: Success confirmation, path of created script, or error.
- Requires: Tampermonkey Editors 1.0.6+ and Tampermonkey 5.6+
tampermonkey_delete
- Purpose: Delete an existing userscript.
- Input:
path(from list). - Output: Success confirmation or error.
- Requires: Tampermonkey Editors 1.0.6+ and Tampermonkey 5.6+
Basic testing
MCP Server capabilities
test stdio
來源:README.md,提交 72a8ae1
工具
0版本歷史
1- v0.0.4最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。