Salesforce MCP UI Automation
Integrates with Salesforce to automate browser-based UI interactions via Playwright, including Data Cloud, Setup, Marketing Cloud Growth, and Agentforce, with tools for browsing, clicking, filling, querying, and orchestrating workflows.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Salesforce MCP UI Automation Search for Data Cloud in Setup"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Salesforce MCP UI Automation
MCP server Python per automatizzare Salesforce via browser Playwright con sessione persistente. L'MVP parte da Data Cloud, ma i tool sono generici abbastanza da coprire Setup, Marketing Cloud Growth, Agentforce e altre aree configurabili solo da UI.
Setup
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e ".[dev]"
python -m playwright install chromium
Copy-Item .env.example .envAggiorna .env con l'URL della tua org e, se usi le API Data Cloud, con endpoint tenant e token:
SALESFORCE_ORG_URL=https://your-domain.my.salesforce.com
SALESFORCE_INSTANCE_URL=https://your-domain.my.salesforce.com
SALESFORCE_ACCESS_TOKEN=
SALESFORCE_API_VERSION=61.0
SALESFORCE_DATACLOUD_API_URL=https://your-data-cloud-tenant.example.com
SALESFORCE_DATACLOUD_INGESTION_URL=https://your-ingestion-tenant.example.com
SALESFORCE_DATACLOUD_QUERY_URL=
SALESFORCE_DATACLOUD_ACCESS_TOKEN=
SALESFORCE_JOURNAL_REDACT_FIELDS=token,password,secret,access_token,refresh_token,authorization
SALESFORCE_OAUTH_CLIENT_ID=
SALESFORCE_OAUTH_CLIENT_SECRET=
SALESFORCE_OAUTH_REDIRECT_URI=http://localhost:1717/oauth/callback
SALESFORCE_OAUTH_SCOPES=api refresh_token
SALESFORCE_PROFILE=default
SALESFORCE_HEADLESS=falseRelated MCP server: Playwright MCP Server
Avvio MCP
python -m salesforce_mcpOppure, dopo installazione editable:
salesforce-mcpPer configurare un client MCP, parti da mcp.example.json e aggiorna SALESFORCE_ORG_URL.
Autenticazione
Il server non salva username, password o token applicativi. Al primo uso apre Chromium con profilo persistente in .auth/<profile>. Completa login, SSO e MFA manualmente. Le chiamate successive riusano la stessa sessione finche Salesforce la mantiene valida.
Per usare le API senza copiare manualmente SALESFORCE_ACCESS_TOKEN, puoi chiamare use_browser_session_token dopo il login Playwright: il tool legge il cookie Salesforce sid tramite API Playwright e lo usa come token runtime in memoria. Il refresh token non viene estratto dalla normale sessione browser; per ottenerlo usa start_oauth_token_flow con una Connected App configurata per Authorization Code + PKCE e scope refresh_token.
Tool Esposti
Browser e Setup
open_org: apre l'org configurata o un URL specifico.snapshot: restituisce URL, titolo, testo visibile, screenshot opzionale, DOM opzionale, iframe e suggerimenti.click: clicca per testo, selector CSS o ruolo accessibile.fill: compila un input per label/placeholder/testo o selector CSS.select: seleziona un valore in un campo select.wait_for: attende caricamenti, testo o selector.search_setup: apre Setup e cerca una voce.open_datacloud_area: apre o ricerca aree Data Cloud note.diagnose_datacloud: raccoglie uno snapshot diagnostico orientato a Data Cloud.close_browser: chiude browser e profilo persistente.
Autenticazione API
browser_auth_status: verifica sessione Playwright e token runtime senza mostrare segreti.use_browser_session_token: usa il cookiesidSalesforce come token runtime perquery_salesforce.start_oauth_token_flow: avvia OAuth Authorization Code + PKCE in Playwright e salva access/refresh token in memoria.refresh_oauth_token: rinnova l'access token runtime usando il refresh token.clear_runtime_tokens: svuota i token runtime in memoria.
Orchestrazione supervisionata
list_capabilities: elenca workflow Data Cloud supportati, input attesi e classe di rischio.plan_request: crea un run journal per Data Streams, metadata, ingestion e validazioni Data Cloud.execute_plan: esegue il piano fino a completamento, errore o richiesta approvazione.get_run_status: legge lo stato completo di un run.approve_step: approva uno step supervisionato.rollback_run: prepara rollback safe/manual_review/dangerous sulle sole risorse tracciate.
Verifica dati
query_salesforce: esegue SOQL usando token runtime oSALESFORCE_INSTANCE_URLeSALESFORCE_ACCESS_TOKEN.query_datacloud: esegue query Data Cloud su endpoint configurabileSALESFORCE_DATACLOUD_QUERY_URL.datacloud_submit_query: invia una query SQL alla Data Cloud Query API.datacloud_query_status: legge lo stato di una query Data Cloud.datacloud_query_rows: legge righe paginabili per una query Data Cloud.datacloud_cancel_query: cancella una query Data Cloud in esecuzione.datacloud_metadata: legge metadata Data Cloud per DLO, DMO, Calculated Insights, campi, chiavi e relazioni.assert_records: valida record count, campi obbligatori, valori attesi, freshness e assenza errori.compare_before_after: confronta evidenze query raccolte nel run journal.
Workflow supportati da plan_request:
data_streams: configurazione supervisionata via browser.validate_data_stream: validazione metadata/query di uno stream.ingest_streaming_records: validazione e invio JSON via Streaming Ingestion API.ingest_bulk_csv: validazione CSV, creazione job, upload, close e status Bulk Ingestion API.inspect_data_model: ispezione DLO, DMO, relazioni, chiavi e key qualifier.validate_identity_resolution: validazione output identity resolution.validate_calculated_insight: validazione metadata e risultati Calculated Insight.validate_data_action: validazione dati e metadata collegati a Data Actions.
I run journal sono salvati in runs/<run_id>/run.json, esclusi da Git perche possono contenere dati operativi e screenshot correlati. I campi configurati in SALESFORCE_JOURNAL_REDACT_FIELDS vengono mascherati prima della scrittura.
Guardrail
Le azioni potenzialmente distruttive richiedono confirm_dangerous=true. Screenshot e log operativi sono salvati in logs/, escluso da Git insieme a .auth/ e .env.
Le scritture Data Cloud dei workflow ingestion richiedono approvazione step tramite approve_step. Gli endpoint Data Cloud restano configurabili per tenant: usa SALESFORCE_DATACLOUD_API_URL per Query/Metadata API, SALESFORCE_DATACLOUD_INGESTION_URL per Ingestion API e SALESFORCE_DATACLOUD_QUERY_URL solo come endpoint legacy compatibile per query_datacloud.
Test
pytestI test automatici validano configurazione, guardrail, journal, planner, assertion engine e shape degli output. Se la directory temp utente non e' scrivibile, usa:
pytest -p no:cacheprovider --basetemp .testtmpIl test reale su Salesforce resta manuale perche richiede una org e login interattivo.
Per validare anche Chromium/Playwright su una pagina HTML locale:
$env:RUN_PLAYWRIGHT_SMOKE="1"
pytest tests/test_browser_smoke.pyAvailable Tools
30 toolsapprove_stepC
Approve one supervised run step.
Inputs: run_id (required), step_id (required). Returns: object
assert_recordsC
Validate records with count, contains, required field, freshness, and no-error checks.
Inputs: assertion (required), records. Returns: object
browser_auth_statusA
Report masked browser/runtime authentication status for the active Playwright session.
Inputs: no named parameters. Returns: object
clear_runtime_tokensA
Clear in-memory Salesforce and Data Cloud runtime tokens.
Inputs: no named parameters. Returns: object
clickC
Click a visible element by text, CSS selector, or accessibility role.
Inputs: text, selector, role, name, +2 more. Returns: object
close_browserB
Close the persistent browser context for the current MCP server process.
Inputs: no named parameters. Returns: object
compare_before_afterC
Compare before/after query evidence captured in a run journal.
Inputs: run_id (required). Returns: object
datacloud_cancel_queryC
Cancel a submitted Data Cloud SQL query.
Inputs: query_id (required). Returns: object
datacloud_metadataC
Retrieve Data Cloud metadata for DLOs, DMOs, Calculated Insights, fields, and relationships.
Inputs: entity_type, entity_category, entity_name. Returns: object
datacloud_query_rowsB
Return paginated rows for a submitted Data Cloud SQL query.
Inputs: query_id (required), offset, row_limit. Returns: object
datacloud_query_statusC
Return status for a submitted Data Cloud SQL query.
Inputs: query_id (required). Returns: object
datacloud_submit_queryB
Submit a Data Cloud SQL query and return query metadata or a query id.
Inputs: sql (required), mode. Returns: object
diagnose_datacloudA
Collect a Data Cloud-oriented diagnostic snapshot of the current page.
Inputs: no named parameters. Returns: object
execute_planB
Execute a planned run until completion, failure, or approval is required.
Inputs: run_id (required), max_attempts. Returns: object
fillC
Fill an input by label, CSS selector, or placeholder.
Inputs: value (required), label, selector, placeholder, +1 more. Returns: object
get_run_statusC
Return the current run journal state.
Inputs: run_id (required). Returns: object
list_capabilitiesA
List supported supervised Data Cloud workflow capabilities.
Inputs: no named parameters. Returns: object
open_datacloud_areaC
Search Setup for a known Data Cloud area such as Data Streams or Identity Resolution.
Inputs: area. Returns: object
open_orgC
Open a Salesforce org URL with the persistent browser profile.
Inputs: org_url. Returns: object
plan_requestC
Create a supervised execution plan and run journal for a user request.
Inputs: request (required), target_area, dry_run. Returns: object
query_datacloudC
Run a Data Cloud query against the configured Data Cloud query endpoint.
Inputs: sql_or_query (required). Returns: object
query_salesforceC
Run a Salesforce SOQL query using configured OAuth access token environment variables.
Inputs: soql (required). Returns: object
refresh_oauth_tokenB
Refresh the in-memory OAuth access token using the runtime refresh token.
Inputs: no named parameters. Returns: object
rollback_runC
Prepare or execute rollback for resources tracked in a run journal.
Inputs: run_id (required), mode, confirm_dangerous. Returns: object
search_setupC
Open Salesforce Setup and search the Quick Find box.
Inputs: query (required). Returns: object
selectC
Select an option in a native select field by selector or label.
Inputs: value, label, selector, option_label. Returns: object
snapshotB
Return the current page state, visible text, optional screenshot, warnings, and next actions.
Inputs: include_screenshot, max_text_chars, include_dom, include_iframes. Returns: object
start_oauth_token_flowC
Start OAuth Authorization Code + PKCE in Playwright and store tokens in memory.
Inputs: timeout_seconds. Returns: object
use_browser_session_tokenA
Use the Salesforce sid cookie from Playwright as an in-memory API session token.
Inputs: no named parameters. Returns: object
wait_forC
Wait for page stability, a selector, or visible text.
Inputs: selector, text, timeout_ms. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 30 tools
Most tools have distinct purposes, but there is potential confusion between 'query_datacloud' and 'datacloud_submit_query', both appearing to execute Data Cloud queries. Otherwise, tools are well-separated by prefix and action.
Naming mostly follows snake_case with descriptive verbs and nouns, but 'query_datacloud' deviates from the 'datacloud_*' prefix pattern used by other Data Cloud tools. Overall, the convention is consistent across the majority.
30 tools is high but plausible for a complex domain covering Salesforce UI automation, Data Cloud, OAuth flows, and run management. However, some redundancy (e.g., two query tools) suggests slight over-scoping.
The tool set covers core UI automation actions (click, fill, select), Data Cloud operations (submit, status, cancel, rows, metadata), OAuth token management, and run planning/execution. Minor gaps exist (e.g., no direct data creation via UI), but overall it addresses its purpose well.
Related MCP Connectors
Playwright browser automation ā navigate, click, fill forms, extract, screenshot ā 17 agent tools.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to iā¦
Related MCP Servers
AlicenseNot gradedqualityDmaintenanceEnables comprehensive browser automation and web interaction through Playwright with 50+ specialized functions for navigation, form filling, data extraction, and Chrome DevTools Protocol support. Designed specifically for AI agents to perform complex web workflows including scraping, testing, and automated browsing tasks.15 npm1Apache 2.0- AlicenseNot gradedqualityDmaintenanceProvides browser automation capabilities using Playwright, enabling users to navigate websites, extract content, take screenshots, and interact with web pages through natural language prompts.24 npmMIT
- AlicenseNot gradedqualityDmaintenanceProvides browser automation capabilities for AI assistants, enabling web navigation, form filling, and data extraction through Playwright.MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to perform browser automation using Playwright, including navigation, content extraction, screenshot analysis, and custom script execution.520 npmMIT