Browse the docs

An MCP resource changes

Runs the macro when a resource on one of your MCP servers changes: a pull request, an issue, a database row, a file the server exposes.

uri changes on server

Details #

MCP servers describe what they hold as resources: things with an address (a URI) and some content. This trigger watches one resource, or every resource whose address matches a pattern, and runs the macro when the content changes. Switchboard has no code per service: anything a server exposes as a resource can be watched.

Add the server in Settings › Agents first. Then pick it in the trigger, browse its resources, and choose one.

Where the server can push, Switchboard subscribes and hears about a change at once. Where it can't, Switchboard reads the resource every every seconds (60 by default, never less than 15) and compares the content. The trigger row says which: "Checks every minute (this server can't push)".

The first read is a baseline and never runs the macro. After that a macro runs only when the content really differs from the last read, so a repeated notification or an unchanged poll does nothing. If Switchboard was disconnected for a while (the server restarted, the Mac slept) it reads again on reconnecting and runs the macro once if the content changed in between. A change made while Switchboard itself was not running is not seen.

The macro gets these inputs, which you can use as {{ json.state }}, {{ text }} and so on:

InputWhat it holds
serverThe server's name.
uriThe resource that changed (useful with a pattern).
mimeTypeThe content type the server reported.
textThe new content as text.
jsonThe content parsed, when the type is JSON or the text parses as an object or list.
previousThe content before the change, parsed the same way.
changedFor JSON objects, the top-level keys whose values differ.

{{triggerValue}} is the new text.

Parameters #

ParameterTypeRequiredValuesWhat it does
servertextYesRequired. The server's name from Settings › Agents & MCP.
everynumberSeconds between reads for a server that can't push. Default 60, minimum 15.
filtertextAn expression over the inputs, such as json.state == "failed". The macro runs only when it is true, and only on the change into true: while it stays true, further changes don't run it again; when it turns false and true again, it does.
uritextThe resource's address, such as github://repos/acme/app/pulls/42. Use this or uriPattern.
uriPatterntextA glob matched against the server's resource list, where * is anything and ? is one character. Resources that appear later are picked up when the server says its list changed.

Every trigger also takes Limits: a cooldown, the first time each day, every nth time, twice within seconds, a chance, only while you are at the Mac, on one Mac, or in a State. See Limits on any trigger.

Examples #

Tell me when a pull request's checks fail
When
  1. Github changes “github://repos/acme/app/pulls/42” and “json.checks == "failed"” becomes true
Do
  1. Show “PR 42: checks failed” for 5 s
Open in Switchboard to try it
Note every change to any resource of a server
When
  1. Notes changes resources matching “notes://*”
Do
  1. Log “{{ uri }} changed: {{ changed }}”
Open in Switchboard to try it

Gotchas #

  • A server that runs as a program (stdio) is kept running for as long as a turned-on macro listens to it. Settings › Agents & MCP shows how much memory it uses.

  • If the server can't be reached, the trigger row shows the last error and Switchboard keeps trying again with a growing pause, up to five minutes. Reconnect in Settings › Agents & MCP tries at once. Every listening server also reconnects when the Mac wakes.

  • If the server says the resource no longer exists, the row says so. The trigger waits; it starts again if the resource comes back.

  • Many servers can't push at all. Polling is then all there is, and the macro runs up to every seconds after the change.

  • Resource content can include private details. A macro that sends it to a model or a web service sends those too.

See also #

Read an MCP resource, An MCP resource says, Call an MCP tool, Trigger on anything an MCP server knows