Salesforce数据360操作服务器

一个通过认证和有界工作流,让AI代理和工程师检查、查询和操作Salesforce Data 360的MCP服务器。

  • by stijnhoste
  • Python
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 stijnhoste/sf-data-360-mcp

使用说明

SF Data 360 MCP Server

An MCP server that lets AI agents and engineers inspect, query, and operate Salesforce Data 360 through authenticated, bounded workflows.

It turns a large enterprise API surface into repeatable operator actions: discover schemas, validate queries, inspect identity and segmentation configuration, manage activations and pipelines, and troubleshoot live environments without building a Connected App.

Why it exists

Enterprise data work is rarely one API call. Operators need to select the right org, understand the data model, validate inputs, keep outputs manageable, and preserve a clear boundary around consequential changes. This server packages those steps as agent-ready tools using existing Salesforce CLI authentication.

What it enables

  • Grounded discovery — Inspect schemas, relationships, metadata, and sample data before acting.
  • Repeatable operations — Use consistent workflows across ingestion, harmonization, identity, segmentation, activation, AI/ML, and administration.
  • Multi-org delivery — Switch explicitly between authenticated environments.
  • Safer agent use — Apply bounded outputs, validation, transient-failure retries, and explicit target-org selection.
  • Full lifecycle coverage — Operate the broader Connect API lifecycle without making command counts the product story.

Quick Start

Prerequisites

  • Python 3.10+
  • Salesforce CLI installed
  • A Salesforce org with Data Cloud enabled

Installation

git clone https://github.com/stijnhoste/sf-data-360-mcp.git
cd sf-data-360-mcp
pip install -r requirements.txt

# Authenticate with your Data Cloud org
sf org login web --alias my-dc-org

Configure Your MCP Client

Add to your MCP client configuration file. You can use either:

Option 1: Project-level config (recommended for team projects)

.mcp.json              # In your project root

Option 2: Global config (applies to all projects)

Client Config File
Cursor ~/.cursor/mcp.json
Claude Code ~/.claude/mcp.json

Add this configuration:

{
  "mcpServers": {
    "datacloud": {
      "command": "python",
      "args": ["/absolute/path/to/sf-data-360-mcp/server.py"],
      "env": {
        "DC_DEFAULT_ORG": "my-dc-org"
      }
    }
  }
}

Note: Replace /absolute/path/to/ with the actual path where you cloned the repository. Project-level .mcp.json takes precedence over global config when both exist.

Configuration

Environment Variables

Variable Required Default Description
DC_DEFAULT_ORG No - SF CLI org alias to use by default
DC_API_VERSION No v65.0 Salesforce API version for Connect API
DC_RETRY_TOTAL No 3 Number of retries for transient failures (5xx)
DC_RETRY_BACKOFF No 0.5 Backoff factor between retries (seconds)
DC_RATE_LIMIT_REQUESTS No 100 Max requests per rate limit window
DC_RATE_LIMIT_WINDOW No 20 Rate limit window in seconds
DEFAULT_LIST_TABLE_FILTER No % SQL LIKE pattern for filtering tables

Multi-Org Support

If you don't set DC_DEFAULT_ORG, use these tools to select an org at runtime:

list_orgs()           # See all authenticated orgs
set_target_org(alias) # Switch to a specific org
get_target_org()      # See currently selected org

API Capabilities

This MCP server uses the Connect API exclusively (works with SF CLI auth) and now supports full CRUD operations for most resources:

Operation Supported Notes
Read (list, get, query) ✅ Yes All resources
Create ✅ Yes Most resources via Connect API
Update ✅ Yes All resources
Delete ✅ Yes All resources
Run/Execute ✅ Yes Transforms, insights, identity resolution

Note: Some complex resources may still require Metadata API or Setup UI for initial creation, but ongoing management is fully supported.

Tool reference

Org Management (3)

Tool Description
list_orgs() List all SF CLI authenticated orgs
set_target_org(alias) Switch to a different org
get_target_org() Get currently selected org

Query Tools (6)

Tool Description
query(sql) Execute SQL queries against Data Cloud
query_v2(sql) Execute SQL using V2 query API
get_query_batch_v2(query_id) Get results from V2 query batch
cancel_sql_query(query_id) Cancel a running SQL query
validate_query(sql) Validate SQL syntax before execution
format_sql(sql) Format SQL for readability

Schema Discovery (8)

Tool Description
list_tables() List available tables
describe_table(table) Get column names
describe_table_full(table) Get detailed schema with types
get_metadata(...) Get rich entity metadata
get_relationships(entity) Get relationships for JOINs
get_dmo_relationships(dmo) Get DMO relationships
explore_table(table) Schema + samples + profiles
search_tables(keyword) Search tables/columns

Segments (9)

Tool Description
list_segments() List all segments
get_segment(name) Get segment details
get_segment_members(name) Get segment members
count_segment(name) Count segment members
create_segment(definition) Create a new segment
update_segment(name, updates) Update segment
delete_segment(name) Delete segment
deactivate_segment(name) Deactivate a segment
publish_segment(name) Publish a segment

Activations (11)

Tool Description
list_activations() List all activations
get_activation(id) Get activation details
create_activation(definition) Create a new activation
update_activation(id, updates) Update activation
delete_activation(id) Delete activation
get_activation_data(id) Get activation data
list_activation_targets() List activation targets
get_activation_target(name) Get activation target details
create_activation_target(definition) Create activation target
update_activation_target(name, updates) Update activation target
list_activation_external_platforms() List external platforms

Data Streams (6)

Tool Description
list_data_streams() List all data streams
get_data_stream(name) Get stream details
create_data_stream(definition) Create a new data stream
update_data_stream(name, updates) Update data stream
delete_data_stream(name) Delete data stream
run_data_stream(name) Run a data stream

Data Transforms (13)

Tool Description
list_data_transforms() List all transforms
get_data_transform(name) Get transform details
create_data_transform(definition) Create a new transform
update_data_transform(name, updates) Update transform
delete_data_transform(name) Delete transform
run_data_transform(name) Run transform
cancel_data_transform(name) Cancel running transform
retry_data_transform(name) Retry failed transform
refresh_data_transform_status(name) Refresh transform status
get_transform_run_history(name) Get run history
get_transform_schedule(name) Get transform schedule
update_transform_schedule(name, schedule) Update schedule
validate_data_transform(definition) Validate transform definition

Connections (11)

Tool Description
list_connections() List all connections
get_connection(name) Get connection details
get_connection_objects(name) Get available objects
get_connection_schema(name, object) Get object schema
get_connection_databases(name) Get available databases
get_connection_database_schemas(name, db) Get database schemas
get_connection_endpoints(name) Get connection endpoints
list_connectors() List connector types
get_connector(type) Get connector details
update_connection(name, updates) Update connection
delete_connection(name) Delete connection

Data Lake Objects (5)

Tool Description
list_data_lake_objects() List all DLOs
get_data_lake_object(name) Get DLO details
create_data_lake_object(definition) Create a new DLO
update_data_lake_object(name, updates) Update DLO
delete_data_lake_object(name) Delete DLO

Data Model Objects (14)

Tool Description
list_data_model_objects() List all DMOs
get_data_model_object(name) Get DMO details
create_data_model_object(definition) Create a new DMO
update_data_model_object(name, updates) Update DMO
delete_data_model_object(name) Delete DMO
get_dmo_relationships(name) Get DMO relationships
create_dmo_relationship(dmo, definition) Create DMO relationship
delete_dmo_relationship(name) Delete DMO relationship
list_data_model_object_mappings() List DMO mappings
get_data_model_object_mapping(name) Get DMO mapping
create_data_model_object_mapping(definition) Create DMO mapping
delete_dmo_mapping(name) Delete DMO mapping
delete_data_model_field_mappings(name) Delete field mappings
update_data_model_field_mappings(name, mappings) Update field mappings

Data Spaces (7)

Tool Description
list_data_spaces() List all data spaces
get_data_space(name) Get data space details
create_data_space(definition) Create a new data space
update_data_space(name, updates) Update data space
get_data_space_members(name) Get objects in space
get_data_space_member(space, member) Get specific member
update_data_space_members(name, members) Update space members

Calculated Insights (8)

Tool Description
list_calculated_insights() List all insights
get_calculated_insight(name) Get insight details
create_calculated_insight(definition) Create a new insight
update_calculated_insight(name, updates) Update insight
delete_calculated_insight(name) Delete insight
run_calculated_insight(name) Run insight refresh
query_calculated_insight(...) Query insight data
get_insight_metadata(name) Get insight metadata

Data Graphs (7)

Tool Description
list_data_graphs() List all data graphs
get_data_graph(name) Get data graph details
get_data_graph_metadata() Get data graph metadata
create_data_graph(definition) Create a new data graph
delete_data_graph(name) Delete data graph
refresh_data_graph(name) Refresh data graph
query_data_graph(...) Query unified profiles

Identity Resolution (7)

Tool Description
list_identity_rulesets() List identity rulesets
get_identity_ruleset(name) Get ruleset details
create_identity_ruleset(definition) Create a new ruleset
update_identity_ruleset(name, updates) Update ruleset
delete_identity_ruleset(name) Delete ruleset
run_identity_resolution(name) Run identity resolution
lookup_unified_id(...) Look up unified IDs

Profile Queries (4)

Tool Description
query_profile(dmo, limit, offset) Query profile records
get_profile_record(dmo, id) Get specific profile record
get_profile_record_with_children(dmo, id, child) Get profile with children
get_profile_record_with_insights(dmo, id, insight) Get profile with insights

AI & ML - Models (6)

Tool Description
list_ml_models() List all ML models
get_ml_model(name) Get model details
get_prediction(model, data) Get predictions
update_ml_model(name, updates) Update ML model
delete_ml_model(name) Delete ML model
list_model_artifacts() List model artifacts
get_model_artifact(name) Get artifact details
update_model_artifact(name, updates) Update artifact
delete_model_artifact(name) Delete artifact

AI & ML - Document AI (6)

Tool Description
list_document_ai_configs() List Document AI configs
get_document_ai_config(name) Get config details
get_document_ai_global_config() Get global Document AI config
extract_document_data(...) Extract document data
run_document_ai(config, data) Run Document AI extraction
generate_document_schema(config) Generate document schema
update_document_ai_config(name, updates) Update config
delete_document_ai_config(name) Delete config

AI & ML - Semantic Search (5)

Tool Description
list_semantic_searches() List semantic search indexes
get_semantic_search(name) Get search index details
get_semantic_search_config() Get global search config
update_semantic_search(name, updates) Update search index
delete_semantic_search(name) Delete search index

Data Actions (11)

Tool Description
list_data_actions() List event-driven automation rules
get_data_action(name) Get data action details
create_data_action(definition) Create a new data action
update_data_action(name, updates) Update data action
delete_data_action(name) Delete data action
list_data_action_targets() List webhook/external targets
get_data_action_target(name) Get target details
create_data_action_target(definition) Create a new target
delete_data_action_target(name) Delete target
get_data_action_target_signing_key(name) Get target signing key

Admin & Monitoring (9)

Tool Description
get_limits() Get API limits and usage
get_data_kit_component_dependencies(kit, component, type) Get data kit dependencies
get_data_kit_deployment_status(kit, component, type) Get deployment status
undeploy_data_kit_component(kit, definition) Undeploy data kit components
list_private_network_routes() List private network routes
get_private_network_route(id) Get route details
create_private_network_route(definition) Create a network route
delete_private_network_route(id) Delete a network route

Data Clean Rooms (19)

Tool Description
list_data_clean_room_collaborations() List all collaborations
get_data_clean_room_collaboration(id) Get collaboration details
create_data_clean_room_collaboration(definition) Create a collaboration
update_data_clean_room_collaboration(id, updates) Update collaboration
delete_data_clean_room_collaboration(id) Delete collaboration
accept_data_clean_room_collaboration_invitation(id) Accept invitation
reject_data_clean_room_collaboration_invitation(id) Reject invitation
run_data_clean_room_collaboration(id) Run collaboration
list_data_clean_room_collaboration_jobs(id) List collaboration jobs
get_data_clean_room_query_job(collaboration, job) Get query job
list_data_clean_room_providers() List all providers
get_data_clean_room_provider(id) Get provider details
create_data_clean_room_provider(definition) Create a provider
update_data_clean_room_provider(id, updates) Update provider
delete_data_clean_room_provider(id) Delete provider
list_data_clean_room_provider_templates(id) List provider templates
list_data_clean_room_templates() List all templates
list_data_clean_room_specifications() List specifications
create_data_clean_room_specification(definition) Create specification

Raw Connect API (1)

Tool Description
connect_api_request(method, endpoint, params, body) Make raw Connect API request

autoApprove Settings

For agentic workflows, auto-approve read-only tools:

{
  "autoApprove": [
    "list_orgs", "get_target_org",
    "list_tables", "describe_table", "describe_table_full",
    "get_metadata", "get_relationships", "get_dmo_relationships",
    "explore_table", "search_tables",
    "list_segments", "get_segment", "get_segment_members", "count_segment",
    "list_activations", "get_activation", "get_activation_data",
    "list_activation_targets", "get_activation_target", "list_activation_external_platforms",
    "list_data_streams", "get_data_stream",
    "list_data_transforms", "get_data_transform", "get_transform_run_history", "get_transform_schedule",
    "list_connections", "get_connection", "get_connection_objects", "get_connection_schema",
    "get_connection_databases", "get_connection_database_schemas", "get_connection_endpoints",
    "list_connectors", "get_connector",
    "list_data_lake_objects", "get_data_lake_object",
    "list_data_model_objects", "get_data_model_object", "get_dmo_relationships",
    "list_data_model_object_mappings", "get_data_model_object_mapping",
    "list_data_spaces", "get_data_space", "get_data_space_members", "get_data_space_member",
    "list_calculated_insights", "get_calculated_insight", "get_insight_metadata",
    "list_data_graphs", "get_data_graph", "get_data_graph_metadata",
    "list_identity_rulesets", "get_identity_ruleset",
    "query_profile", "get_profile_record", "get_profile_record_with_children", "get_profile_record_with_insights",
    "list_ml_models", "get_ml_model", "list_model_artifacts", "get_model_artifact",
    "list_document_ai_configs", "get_document_ai_config", "get_document_ai_global_config",
    "list_semantic_searches", "get_semantic_search", "get_semantic_search_config",
    "list_data_actions", "get_data_action",
    "list_data_action_targets", "get_data_action_target", "get_data_action_target_signing_key",
    "list_private_network_routes", "get_private_network_route",
    "list_data_clean_room_collaborations", "get_data_clean_room_collaboration",
    "list_data_clean_room_collaboration_jobs", "get_data_clean_room_query_job",
    "list_data_clean_room_providers", "get_data_clean_room_provider",
    "list_data_clean_room_provider_templates", "list_data_clean_room_templates",
    "list_data_clean_room_specifications",
    "get_limits", "get_data_kit_component_dependencies", "get_data_kit_deployment_status",
    "validate_query", "format_sql", "validate_data_transform"
  ]
}

Authentication

This project uses SF CLI authentication exclusively:

  1. Authenticate via SF CLI: sf org login web --alias my-org
  2. Set DC_DEFAULT_ORG environment variable, or use set_target_org() tool
  3. The server reads credentials from SF CLI's secure token storage

Benefits:

  • No Connected App setup required
  • No client secrets to manage
  • Multi-org support built-in
  • Tokens managed by SF CLI

API Architecture

All tools use the Connect API (/services/data/v65.0/ssot/*), which works with standard Salesforce OAuth tokens from SF CLI.

Connect API (/services/data/v65.0/ssot/*)
├── query-sql/*              → query()
├── metadata                 → get_metadata(), describe_table_full()
│
├── segments/*               → list_segments(), create_segment(), etc.
├── activations/*            → list_activations(), create_activation(), etc.
│
├── data-streams/*           → list_data_streams(), create_data_stream()
├── data-transforms/*        → list_data_transforms(), create_data_transform()
├── connections/*            → list_connections(), get_connection()
│
├── data-lake-objects/*      → list_data_lake_objects(), create_data_lake_object()
├── data-model-objects/*     → list_data_model_objects(), create_data_model_object()
├── data-spaces/*            → list_data_spaces(), create_data_space()
│
├── calculated-insights/*    → list_calculated_insights(), create_calculated_insight()
├── data-graphs/*            → list_data_graphs(), create_data_graph()
├── identity-resolutions/*   → list_identity_rulesets(), create_identity_ruleset()
├── universalIdLookup/*      → lookup_unified_id()
│
├── machine-learning/*       → list_ml_models(), get_prediction()        ─┐
├── document-processing/*    → list_document_ai_configs()                 │ AI & ML
├── search-index/*           → list_semantic_searches()                  ─┘
│
├── data-actions/*           → list_data_actions(), create_data_action() ─┐
├── data-action-targets/*    → list_data_action_targets()                 │ Data Actions
├── private-network-routes/* → list_private_network_routes()             ─┘
│
├── data-clean-room/*        → list_data_clean_room_collaborations()     ─ Clean Rooms
│
└── /services/data/v65.0/limits → get_limits()                           ─ Admin

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT License