mcp-server-macos

v1.3.3
io.github.JeanExtreme002/mcp-server-macos Checked 4 days ago Published 19 days ago

Let your AI assistant use your Mac: an MCP server for macOS, built on pymacos.

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

get_clipboard Read the clipboard

Read the clipboard: its text, whether it holds an image, and the files on it. What the user copied last may be private (a password, a message): read it when the task calls for it.

get_clipboard_image Get the image on the clipboard

Get the image on the clipboard, as a PNG. Fails when the clipboard holds no image.

set_clipboard Copy text to the clipboard

Put text on the clipboard, replacing what it held, for the user to paste.

ParameterTypeDescription
text *stringThe text to put on the clipboard.
sensitivebooleanTrue for a password or a token: clipboard managers are asked not to show it or keep it in their history. Any app can still read it, so clear the clipboard after use.

copy_files_to_clipboard Copy files to the clipboard

Put files on the clipboard, replacing what it held, as if they were copied in Finder: pasting in Finder copies them there, and apps like Mail attach them.

ParameterTypeDescription
paths *arrayThe paths of the files and folders to copy. They must exist.

copy_image_to_clipboard Copy an image to the clipboard

Put an image on the clipboard, from a file, replacing what it held. Other apps get it as an image copied in Preview, not as a file.

ParameterTypeDescription
path *stringThe path of the image file, in any format macOS opens (PNG, JPEG, HEIC, GIF, TIFF, PDF...).

clear_clipboard Clear the clipboard

Empty the clipboard. What it held is gone.

wait_for_clipboard_change Wait for something to be copied

Wait until the user, or an app, copies something new, and return it. Clearing the clipboard doesn't count. Fails when nothing is copied in time.

ParameterTypeDescription
include_sensitivebooleanFalse to wait on past a copy marked as sensitive (a password, from a password manager), for the next one.
timeout_secondsnumberHow long to wait, in seconds, before giving up.

show_alert Show an alert

Show the user an alert with an OK button, and wait until it's dismissed. To tell them something without waiting, send a notification instead.

ParameterTypeDescription
message *stringWhat the dialog says.
detailSmaller text under the message.
timeout_secondsnumberHow long to wait for the user, in seconds, before closing the dialog as if it was cancelled.

ask_confirmation Ask a yes or no question

Ask the user a yes or no question in a dialog, and wait for the answer.

ParameterTypeDescription
message *stringWhat the dialog says.
cancelstringThe label of the button that cancels.
okstringThe label of the button that confirms.
timeout_secondsnumberHow long to wait for the user, in seconds, before closing the dialog as if it was cancelled.
titleThe dialog's title.

ask_text Ask for a line of text

Ask the user for a line of text in a dialog, and wait for it. What they type comes back as the result, a password included: ask for one only when the task needs it.

ParameterTypeDescription
message *stringWhat the dialog says.
defaultstringText the field starts with. Not a secret: other processes of the user can see it.
hiddenbooleanTrue to show dots instead of what's typed, for a password.
timeout_secondsnumberHow long to wait for the user, in seconds, before closing the dialog as if it was cancelled.
titleThe dialog's title.

ask_choice Ask to pick from a list

Let the user pick one option from a list, in a dialog. It waits until they answer, or the time runs out.

ParameterTypeDescription
options *arrayThe options to pick from.
defaultThe option selected when the dialog opens.
promptWhat the dialog says above the list.
timeout_secondsnumberHow long to wait for the user, in seconds, before closing the dialog as if it was cancelled.
titleThe dialog's title.

ask_for_files Ask to pick files

Let the user pick a file, or several, in the system's file picker. It waits until they answer, or the time runs out.

ParameterTypeDescription
folderThe folder the picker opens in.
multiplebooleanTrue to let the user pick several files.
promptWhat the picker says.
timeout_secondsnumberHow long to wait for the user, in seconds, before closing the dialog as if it was cancelled.
typesLimit the choice, by extension (['pdf', 'png']) or type identifier (['public.image']).

ask_for_folder Ask to pick a folder

Let the user pick a folder in the system's folder picker. It waits until they answer, or the time runs out.

ParameterTypeDescription
folderThe folder the picker opens in.
promptWhat the picker says.
timeout_secondsnumberHow long to wait for the user, in seconds, before closing the dialog as if it was cancelled.

check_notification_permission Check whether notifications are allowed

Check whether send_notification can show notifications, without sending one. A Focus mode such as Do Not Disturb can still hide notifications that are allowed.

send_notification Send a notification

Show a notification on this Mac, in the top-right corner of the screen and in Notification Center. macOS shows it as coming from Script Editor. Text over 4096 characters is clipped. Don't put a secret in a notification: other processes of the user can see its text while it's being posted.

ParameterTypeDescription
message *stringThe notification's text.
soundThe name of a system alert sound to play, e.g. 'Glass', 'Ping' or 'Basso'. Silent by default.
subtitleA line between the title and the text.
titleThe title, in bold above the text.

get_ui_elements List what an app shows

List what an app shows on screen: its buttons, text fields, links, checkboxes, tabs and menus, each with an id, its name, its value and where it is. Use it to see an app before acting on it, rather than a screenshot: then press_ui_element, set_ui_element_value or click_menu_item with what it gives. Only what can be seen is listed: the window in front, with the panels over it. When a menu, a dialog or a sheet (a save panel) is open, only it is, as nothing else can be used until it closes. Web pages are read too, in Safari, Chrome and Electron apps. Some apps (games, a few cross-platform ones)…

ParameterTypeDescription
appThe app, by name, bundle identifier or path. The app in front by default.
include_textbooleanAlso list what's there to be read (text, headings, images), not only the controls.
max_elementsintegerThe most elements to list.

find_ui_elements Find an element on screen

Find the elements on screen with a name, a role, or both: the 'Send' button, the search field. Those named exactly so come first ('Save' before "Don't Save"), then the others, top to bottom. Text is found too, not only controls. Give a name, a role, or both.

ParameterTypeDescription
appThe app, by name, bundle identifier or path. The app in front by default.
nameA part of its name, label, text, placeholder or tooltip, in any case.
roleWhat it is: 'button', 'text field', 'link', 'check box', 'menu item', 'search field'...

wait_for_ui_element Wait for an element

Wait until an element shows up (a page loaded, a dialog opened, a button enabled), and return it; null if it doesn't within the timeout. An app that isn't running yet is waited for too.

ParameterTypeDescription
appThe app, by name, bundle identifier or path. The app in front by default.
nameA part of its name, label or text, in any case.
roleWhat it is: 'button', 'text field', 'link'...
timeout_secondsnumberHow long to wait at most, in seconds.

get_focused_ui_element Get the focused element

Get the element keystrokes go to now (a text field, a list), in whichever app. Null when there's none.

get_ui_element_at Get the element at a point

Get the element at a point of the screen, in whichever app shows it there: what a click there would reach.

ParameterTypeDescription
x *numberAcross, in points from the left of the main display.
y *numberDown, in points from the top of the main display.

read_ui_element_text Read an element's text

Read all the text an element holds, its own and what's in it, what's scrolled out of view included: a long text area, a message, a dialog.

ParameterTypeDescription
id *integerThe element's id, from get_ui_elements, find_ui_elements or another tool of these that returned it.

list_menu_items List an app's menu items

List the items of an app's menus, with their keyboard shortcuts: what the app can do, including what no button on screen shows. The app needn't be in front. click_menu_item chooses one.

ParameterTypeDescription
appThe app, by name, bundle identifier or path. The app in front by default.
menuOnly this menu of the menu bar, such as 'File' or 'View'. Every menu by default.

focus_ui_element Focus an element

Bring an element's app to the front and give it the keyboard focus, for type_text or press_keys to go to it.

ParameterTypeDescription
id *integerThe element's id, from get_ui_elements, find_ui_elements or another tool of these that returned it.

set_ui_element_value Set an element's value

Set what an element holds: a text field's text, replacing it, or a slider's position. When the app refuses, or a web form doesn't notice, focus_ui_element and type_text instead.

ParameterTypeDescription
id *integerThe element's id, from get_ui_elements, find_ui_elements or another tool of these that returned it.
value *Text for a text field (it replaces what's there), a number for a slider.

press_ui_element Press an element

Use an element as a click would: press a button, follow a link, toggle a checkbox, choose a tab or a menu item. It's done through Accessibility: the pointer doesn't move, and the window needn't be in front. What it does is the app's: a button may send, delete or buy.

ParameterTypeDescription
id *integerThe element's id, from get_ui_elements, find_ui_elements or another tool of these that returned it.

click_ui_element Click an element

Click an element's middle with the mouse, bringing its app to the front: for a double-click, a right click, or an element press_ui_element doesn't work on.

ParameterTypeDescription
id *integerThe element's id, from get_ui_elements, find_ui_elements or another tool of these that returned it.
buttonstring'right' opens a context menu.
countinteger2 double-clicks: opens a file in a list.

perform_ui_action Perform an element's action

Ask an element to do one of its actions, as its actions field lists them.

ParameterTypeDescription
action *stringOne of the element's actions: 'AXShowMenu' opens its menu, 'AXIncrement' and 'AXDecrement' step a slider or a stepper, 'AXConfirm', 'AXCancel', 'AXPick'.
id *integerThe element's id, from get_ui_elements, find_ui_elements or another tool of these that returned it.

click_menu_item Choose a menu item

Choose an item of an app's menus, as a click on it would. The app comes to the front first, since its menus act on its window in front. What it does is the app's: an item may delete, send or quit.

ParameterTypeDescription
path *stringThe menu, then the item, through any submenus, separated by '>': 'File > Save As…', 'Format > Font > Bold'. '...' stands for '…', and case doesn't matter.
appThe app, by name, bundle identifier or path. The app in front by default.

find_tools Find a tool

Search every tool this server has, enabled or not: the best matches first. A tool that isn't enabled yet is called once its toolset is, with enable_toolsets.

ParameterTypeDescription
query *stringWhat the tool should do, in a few words, such as 'encrypt a pdf' or 'take a screenshot'.
limitintegerThe most tools to return.
toolsetOnly this toolset's tools: all of them, whatever the query.

enable_toolsets Enable toolsets

Add toolsets to this server: their tools are listed, and callable, from now on, as the others. Enable only what the task needs: each toolset makes the list of tools longer. The toolsets: - appearance: Tools for the system appearance (Light and Dark mode, the accent color...). Tools: get_appearance, set_appearance, wait_for_appearance_change - apps: Tools for applications: the running and the installed ones, opening, quitting and uninstalling them. Tools: list_running_apps, get_frontmost_app, get_running_app, list_installed_apps, open_app, activate_app, set_app_hidden, quit_app, get_default_ap…

ParameterTypeDescription
names *arrayThe toolsets to add, such as ['pdf'].