Skip to content

MCP reference

Use this page to look up how an MCP client connects to Reflex and what it can do. To set up a tool, start with Work with AI.

https://<server>/mcp (Streamable HTTP). The server checks your project access and sends execution to the project’s agents. An administrator can turn the endpoint off with MCP_ENABLED=false.

  • OAuth (default). Your client opens a Reflex consent page that shows the client and the scopes it asks for. Grant only what you need. Revoke a client under Profile → API tokens.
  • Bearer token (headless). Send Authorization: Bearer <token> with a personal access token (rfx_pat_…) or a service-account token (rfx_sat_…). Create one under Profile → API tokens.

A token never grants more than your project role allows.

A client only sees tools that its scopes and your role allow. Management scopes are opt-in.

ScopeAllows
projects:read, files:read, access:readSee projects, files, members and roles.
runs:read, jobs:read, suites:readRead runs, logs, digests, replays and health.
runs:execute, jobs:run, suites:runStart runs, jobs and suites.
runs:debugAttach the live debugger.
heals:read, heals:proposeRead the heal inbox; propose and verify heals.
heals:reviewAccept or reject heals.
secrets:writeAsk for secret input links.
jobs:write, suites:write, jobs:enable, suites:enableChange definitions; pause and resume schedules.
browser:remote, agents:manage, projects:write, files:write, members:writeRemote browsers, agents, project setup, files, membership.

Call whoami to see your user and scopes. list_projects shows which scopes work in each project.

AreaTools do this
DiscoverList projects and library documentation.
ScriptsValidate a script; start a run from a server file or from your working copy.
RunsRead status, masked logs, events and failure digests; cancel a run.
Jobs and suitesList, trigger, and check health.
DebugAttach, read state, send commands (wait, retry, continue), read patches.
ReplayRead actions, frames and the DOM; test a selector on a recorded page.
HealsList, propose, verify, and (with heals:review) accept or reject.
ManageProjects, members, roles, files, agents, remote browser sessions.

Run tools return an ID at once; poll for status and events. Each tool description names the scope it needs.

Your assistant can ask you for a project or development secret but never receives the value.

  1. The assistant calls prepare_project_secret (one value) or prepare_project_secrets (up to 20, as production or development values). It needs secrets:write.
  2. Reflex returns a link. Open it yourself and sign in if asked.
  3. Check the project, secret name and environment, then enter the value.
  4. The assistant calls get_secret_input and sees only whether you finished.

The link works once and expires after 10 minutes. Development values need the project owner or an administrator.

The assistant must never open the form or take the value in chat.

In a terminal, run reflex secret set api_key --remote --project owner/project for a hidden prompt. Add --dev for a development value, or use --stdin or --from-file in a trusted pipeline. Scripts read the value with secret("api_key").