How forcedotcom/datacloud-mcp-query works
Project type and purpose
• This is a thin Python‐based MCP (Model‐Command‐Plugin) server that integrates Cursor IDE with Salesforce Data Cloud’s SQL API.
• It handles OAuth2 authentication, session management, and exposes three main tools: query, list_tables, and describe_table.
File structure
• Top‐level scripts:
• server.py – the MCP entry point and command router
• oauth.py – OAuth2 flow and token management
• connect_api_dc_sql.py – SQL‐over‐Data Cloud API wrapper
• Configuration and docs:
• requirements.txt – Python deps (e.g., requests, flask/fastapi, simple‐salesforce?)
• CONNECTED_APP_SETUP.md, README.md – setup and usage
• No separate “frontend” or “backend” directories—everything runs in one Python process.
README for additional insights
• The README describes environment variables (SF_CLIENT_ID, SF_CLIENT_SECRET, etc.)
• It details the three MCP tools (query, list_tables, describe_table) and OAuth interaction
• It points to Connected App setup in Salesforce Data Cloud
Elements
• Between Cursor and MCP Server (command invocation + response)
• From OAuth Module to OAuth Authorization Server (authorization code flow)
• From SQL Connector to Salesforce Data Cloud (HTTPS requests/responses)
• Green rectangles for internal modules (server, oauth, connector)
Detailed capture of essential elements
• Environment variables at the MCP Server boundary
• Token expiry and automatic refresh in the OAuth module
• Highlights the single‐process architecture
• Separates command routing, authentication, and data access
• Shows data flow from Cursor → MCP Server → Salesforce → back to Cursor
• Captures configuration and session management details