mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-11-18 20:54:26 +00:00
* MCP server at /mcp, plus GET /api/v1/changes, so AI assistants (Claude, ChatGPT, Cursor...) can use changedetection.io /mcp - a small hand-written implementation of MCP's Streamable HTTP transport in its stateless form: one POST per JSON-RPC message, plain JSON back, no SSE stream and no sessions, no new dependency. The app is a single process, so every MCP call is a normal short request and every tool is bounded. - 21 tools: read (list_watches, get_watch with the latest change, list_tags, get_changes, get_diff, get_snapshot, get_system_info, list_notifications), write (create_watch, import_watches, update_watch, recheck_watches, add_tags/remove_tags by name, create_tag, update_tag, add_notification) and destructive (delete_watch, never 'all', clear_history, delete_tag, remove_notification), with tool annotations. /mcp?readonly=1 serves the read-only ones only. - A 'watch' can be its uuid or part of its title/URL; ambiguous names return the candidates. - Arguments are validated against each tool's schema (unknown keys, types, ranges, all errors at once, as a tool error). Watch fields take their limits from the API spec. - Auth is the REST API key (x-api-key or Authorization: Bearer), also required whenever the UI is password protected; Origin is checked against DNS rebinding. Page text in results is marked as untrusted. - Rechecks are only queued, get_changes has a time budget and yields between watches. GET /api/v1/changes - every change across a group of watches between two dates as unified diffs, net_change (default) or each, with totals; shared with the MCP get_changes tool (changes_report.py). api/operations.py - watch create/update and tag create/update/delete moved out of the REST handlers so REST and MCP validate and answer the same way, now also checking values against the API spec's CreateWatch/UpdateWatch schemas. /api/v1/systeminfo also returns fetch_workers and checking_now (which watches are being checked, for how long). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Spec validation follows the merged spec cache, a plugin processor registered later wasn't accepted The validator and the MCP watch field schemas were cached on their own, so after a plugin processor was registered (the merged API spec cache cleared, as test_example_processor_plugin does) they still held the old spec: "processor: must be one of image_ssim_diff, restock_diff, text_json_diff" for word_counter. Each now keeps the spec object it was built from and is rebuilt when that changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * MCP - "MCP Server" tab at /settings/ai/mcp, its own access token, DISABLE_MCP The AI settings are two pages with tabs: /settings/ai/llm (AI / LLM, the default) and /settings/ai/mcp (MCP Server). Each tab is its own route, not an #anchor, so each page's form stands alone. /settings/ai and the previous /settings/llm redirect to /settings/ai/llm. The MCP Server tab explains what MCP is and shows the server address (the Base URL setting when set, otherwise built from the request, X-Forwarded-* included), the MCP access token with click to copy and "Regenerate MCP token", the Claude Code command, the read-only address, configs for Cursor, VS Code and Claude Desktop, and what an assistant can and can't do. - MCP has its own token, settings.application.mcp_access_token, separate from the REST API key and always required (Authorization: Bearer or x-api-key). It's created at startup for any datastore without one. - /mcp is off (not registered, or 404 when switched later) with DISABLE_MCP=true or LLM_FEATURES_DISABLED. - A debug log line per tool call, with how long it took. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Adding text and infographics * MCP - Read-only mode switch, mcp-types for protocol versions and request validation, AI settings as a /settings tab - "Read-only" checkbox on the MCP Server tab (settings.application.mcp_read_only): write tools are hidden from tools/list, initialize instructions say the server is read-only, and a write tool called anyway (e.g. from a cached tool list) gets a tool error the assistant can pass on. ?readonly=1 now gets the same readable error instead of "Unknown tool". - Use the official SDK's wire types (`mcp-types`, MIT, needs only pydantic) instead of the full ASGI `mcp` SDK: protocol versions come from mcp_types.version, requests are validated against the negotiated version's schema, and an unsupported MCP-Protocol-Version header is a 400. It costs ~15MB on import, so it is only imported on the first authenticated /mcp request (test_mcp_types_imported_lazily guards that). - MCP page is one form with the same Save button at the bottom as the AI / LLM page; "Regenerate MCP token" posts via formaction. - The AI link moves from the left sidebar to an "AI / LLM / MCP" tab on /settings. The tab row is a shared settings_tabs() macro, so the AI pages show it with that tab active and the other tabs link back to /settings#<tab>. AI / LLM | MCP Server becomes a segmented switch inside the box. - test_ai_settings_csrf: with CSRF switched back on, every AI settings POST without a token is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * UI tweaks * rebuild translations * bump licence doc * MCP - On/off switch, named access tokens with per-token permissions, notification tools, processor plugin tools - Switch at the top of the MCP Server tab, off by default, covering the MCP (and future OAuth) endpoints; every sub-tab can be set up while it's off - Endpoint versioned as /mcp/v1 - Named access tokens (one per assistant), stored SHA-256 hashed and shown once, each with its own None / Read / Write grid for monitors, groups, notifications and system info; add / edit overlay saved with ajax (X-CSRFToken), revoke with the confirm dialog, "last used" and client name. Replaces the single token and the server-wide read-only switch (never released) - notification_* arguments of update_watch / update_tag / create_tag need Notifications: write - list_notifications shows format, title, body and muted; notification_services (from Apprise details()); add_notification from service + tokens - register_mcp_tools pluggy hook for processor plugins, with the built-in restock_status / restock_set_rules - get_watch shows processor fields the same way as the REST API - MCP Server tab rebuilt on the vertical sub-tabs: Overview, Connect, Access tokens, OAuth connections - AI / LLM | MCP Server switch readable on the white box, Regenerate API key asks for confirmation - Translations for all languages Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * MCP - get_snapshot unfiltered (whole page from the saved HTML) and over many monitors, in/out direction on the AI pages - get_snapshot unfiltered=true: the HTML saved with the snapshot through html_to_text, non-HTML content as it is, the filtered text (saying so) when no page was kept; logged start/done per monitor - get_snapshot with 'watches' or a 'tag': paged (limit/offset), per-monitor character cap, time budget, and a warning when more than 100 monitors match - AI / LLM | MCP Server switch: outgoing / incoming arrows and a subtitle, teal accent for the MCP page - Translations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * MCP settings - one translated string per line, for the fragmented-gettext CI check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * rebuild translations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * bump * AI settings - Load models / Test connection work for a keyless server (Ollama) at an address not saved yet The credential guard (GHSA-g36r-fm2p-87xm) refused any api_base that differs from the saved one when no api_key was sent, even with no key saved at all, so trying a local Ollama before Save failed with "api_key is required when api_base differs from the saved configuration". It now refuses only when a key is saved. The connection test then sends a placeholder key, so litellm can't fall back to a provider key from the environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Licences - regenerate THIRD-PARTY-LICENSES.md (Flask-SocketIO 5.7.1 reports its licence as MIT, python-socketio 5.18.0, WTForms 3.3.2) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Settings sub-tabs - the URL hash selects the tab (/settings/ai/llm#prompts, /settings/ai/mcp#connect), switching tabs updates it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * MCP Server tab - Get started steps, "add your first token" call to action, floating copy hint - Overview: "Get started" steps (switch on, add a token, connect) until the server is on and has a token, then the tokens as blue links; refreshed with every token change, no page reload needed - Access tokens: an empty list is a blue "Add your first access token" call to action that opens the overlay - Sub-tabs reordered: Overview, Access tokens, Connect, OAuth; the client configs on Connect are all shown - Click to copy: "copy" + icon floats over the box (top right of code blocks, right of inline values) instead of pushing the page down, lingers 2s, the hint itself is clickable; the API key on /settings uses it too - Translations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * AI settings - llm-settings.html is one wrapper for both AI pages, including llm-settings_llm.html or llm-settings_mcp.html The wrapper has the /settings tab row, the AI / LLM | MCP Server switch and the scripts; each page's form is its own file (mcp-settings.html becomes llm-settings_mcp.html). Translations: locations only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * MCP settings test - the on/off switch sits under Overview's introduction now Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * rebuild * AI settings - restore the llm-settings.html wrapper, move "Switch thinking off" into llm-settings_llm.html The merge of master (#4643) put the whole old single-file llm-settings.html back over the wrapper, so both AI pages returned 500. The wrapper is back, and #4643's checkbox and its show/hide lines are in the AI / LLM part, where that form lives now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>