Commonshell

MCP API

Commonshell gives coding agents its memory, plans, tests and tools through an MCP server: 18 tools, listed here exactly as the server describes them to agents.

How agents get it
{
  "mcpServers": {
    "commonshell": {
      "type": "stdio",
      "command": "/Applications/Commonshell.app/Contents/Resources/bin/cs",
      "args": [
        "mcp"
      ]
    }
  }
}

Everything runs on your Mac. Learnings stay on this machine unless you are in a team: then those of your projects sync with your teammates. The full schema is in tools.json, the server's own tools/list answer.

Memory

What worked, what failed and why, recalled across sessions and agents.

memory_record always loaded

Record a learning in Commonshell's learning memory: an approach that worked, one that failed and why, a decision, or an environment fact. A failed learning must give `why` (what made it fail) and should give `instead` when known; it is kept even after a later fix. Use space=private by default; team only for learnings the whole team should reuse (team episodes are shared with your teammates peer to peer).

ParameterTypeDescription
insteadstringkind=failed: what worked or should be done instead
kind requiredstring (worked | failed | decision | environment | note)
projectstringDefaults to the current repository
spacestring (private | team) Default: "private".
supersedesstring[]IDs of learnings this one replaces (from memory_search or a memory_record reply's similar list): they rank as older and stop being recalled
teamstringspace=team: which team (name), when you're in several
text requiredstringSelf-contained: approach taken, outcome, and why
whystringkind=failed (required): what made the approach fail

prior_work

Before researching something on the web, check whether it was researched before: earlier research (the question, sources and conclusion, dated) from this and other sessions. Use it if it answers the question and is recent enough; search again if it may be out of date.

ParameterTypeDescription
limitinteger Default: 3.
query requiredstringWhat you are about to research

Goals and tasks

Plans with acceptance criteria that the agent works through.

create_goal

Create a goal. With plan=true, also break it into tasks with the planner.

ParameterTypeDescription
descriptionstring
planboolean Default: false.
title requiredstring

plan_goal

Break a goal into tasks and subtasks with dependencies and acceptance criteria. replace=true replans the unfinished tasks of an already planned goal.

ParameterTypeDescription
goal_id requiredstringGoal id, e.g. k3x9qa
reasonstringWith replace: why the old plan was wrong (used for learning)
replaceboolean Default: false.

list_goals

List goals with their tasks.

ParameterTypeDescription
include_doneboolean Default: false.

get_next_task

Get the next actionable tasks: open, unblocked, dependencies finished. In-progress tasks come first.

ParameterTypeDescription
countinteger Default: 1.
goal_idstringGoal id, e.g. k3x9qa

get_task

Get one task with its acceptance criteria and dependencies.

ParameterTypeDescription
task_id requiredstringTask id, e.g. k3x9qa

set_task_status

Change a task's status. Use complete_task to finish it. Pass context whenever you start, pause or block a task, so it can be resumed later by you or anyone else.

ParameterTypeDescription
contextstringReplaces the task's context: where it stands, the files involved, how to check it, what's left and what it's waiting on
status requiredstring (todo | in_progress | blocked | cancelled)
task_id requiredstringTask id, e.g. k3x9qa

complete_task

Record the result of working on a task. pass closes it (and its parent/goal when nothing is left); fail records the attempt and keeps it in the queue. Returns the next task.

ParameterTypeDescription
notesstringWhat was done, or why it failed
result requiredstring (pass | fail)
task_id requiredstringTask id, e.g. k3x9qa

Testing

Run web and phone tests, and keep the patterns that make them reliable.

run_web_test

Test a web page (headless Chrome by default) or a phone app. Give url + verify to have a Selenium IDE test written and run (saved to tests/commonshell/ when it passes), or side_path to run an existing .side file. target picks where it runs: microbrowser (the browser in Commonshell, the user watches), headless, external (a tab of the user's own Chrome through the Commonshell extension; the user must click Allow in Chrome, so tell them first) or android/ios (through Appium; native apps need side_path). Captures screenshots, console errors and failed requests; with a Claude key, also checks the screenshots. Results feed the learning loop; with task_id the task is completed as pass/fail.

ParameterTypeDescription
appstringtarget android/ios: native app (.apk/.app/.ipa path or URL, or an installed app's id); without it, the phone's browser
appium_urlstringtarget android/ios: the Appium server (default http://127.0.0.1:4723)
devicestringtarget android/ios: device or simulator name (iOS simulators need one)
mobilebooleanTest the mobile web: phone-sized screen, touch, mobile user agent Default: false.
shared_browserbooleanSame as target microbrowser Default: false.
side_pathstringPath to a .side file to run instead
tabstringtarget external: the tab the user must pick on the Allow page (its id or the start of its URL); the run fails if they pick another
targetstring (microbrowser | headless | external | android | ios)Where to run: microbrowser (the browser the user has open in Commonshell, so they watch and can take over), headless, external (a tab of the user's own Chrome through the Commonshell extension, after they click Allow there), android or ios (Appium) Default: "headless".
task_idstringTask id, e.g. k3x9qa
test_namestringWith side_path: run only this test
urlstring
verifystringWhat must be true on the page
visualboolean Default: true.

add_pattern

Teach a reusable rule. The planner sees relevant patterns when planning future goals.

ParameterTypeDescription
guidance requiredstringWhat to do, e.g. 'wait for #app[data-ready] before asserting'
scopestring (global | repo | language | site) Default: "global".
scope_valuestringRepo name, language or domain for non-global scopes
trigger requiredstringWhen it applies, e.g. 'testing pages on shop.example.com'

search_patterns

Find learned patterns relevant to a situation (uses the current repo and languages for scoped patterns).

ParameterTypeDescription
limitinteger Default: 5.
query requiredstring

Team library

Files and codebases your team shared.

library_list

List the collections in the team library (id, title, author, file count).

No parameters.

library_read

Read a file from the team library (downloaded on first read, verified, then cached). At most 2000 lines per call; use start_line/end_line for long files.

ParameterTypeDescription
collection requiredstring
end_lineinteger
path requiredstring
start_lineinteger

Browser and notifications

Drive a connected browser; tell the person when something is done.

remote_browser

Drive a browser on another computer that is paired with Commonshell through the Commonshell browser extension (end-to-end encrypted, peer to peer). Actions: list (connected browsers), tabs, open {url}, navigate {url}, back, forward, reload, activate {tab}, close {tab}, read (page text plus numbered interactive elements), click {ref|selector|text}, type {ref|selector, text, submit?}, select {ref|selector, value}, key {key, e.g. Enter}, scroll {y | ref}, wait {selector|text, timeout_ms}, screenshot, eval {code}. Most take an optional `tab` (id from tabs); the default is the active tab. Use read before click or type, and act on its refs.

ParameterTypeDescription
action requiredstring (list | tabs | open | navigate | back | forward | reload | activate | close | read | click | type | select | key | scroll | wait | screenshot | eval)
argsobjectThe action's arguments, e.g. {"url": "https://example.com"} or {"ref": 12}
browserstringWhich browser (id or name from list); optional when only one is connected

notify_user

Send the user a notification on their Mac and paired phone. Use it ONLY when the user asked to be notified (e.g. "tell me when it's done", "ping me if the tests fail"), when that moment comes. Don't use it to ask a question: questions and permission prompts notify the user by themselves.

ParameterTypeDescription
message requiredstringWhat happened, in one or two short sentences
titlestringOptional; defaults to the session's name