mcp-salesforce-connector
Enables sophisticated, conversational access and manipulation of Salesforce platform entities, including configuration schemas, transactional records, and proprietary Apex logic, via the Model Context Protocol.
Author

tsmztech
Quick Info
Actions
Tags
Salesforce Model Context Protocol Integration Server
This repository details an MCP (Model Context Protocol) service layer specifically engineered to bridge large language models (like Claude) with Salesforce environments. It grants AI agents the capability to programmatically interface with, query, govern, and administer Salesforce data structures and underlying code using only natural language directives.
Core Capabilities
- Metadata Governance: Dynamic creation and modification of custom Salesforce object definitions and their associated fields via plain language.
- Schema Introspection: Retrieval of exhaustive details concerning object structures, field attributes, and relationship linkages.
- Record Lifecycle Management: Comprehensive Data Manipulation Language (DML) operations: Insert, Modify, Delete, and Upsert logic execution.
- Advanced Data Retrieval: Support for complex SOQL queries featuring relationship traversal and intricate filtering mechanisms.
- Cross-Object Discovery: Utilizing SOSL for simultaneous searching across disparate data entities.
- Apex Code Operations: Capabilities to retrieve, instantiate, and revise Apex Classes and Triggers.
- Authentication Agility: Flexible credential management supporting multiple Salesforce organizations, typically managed via VS Code environment settings (leveraging Salesforce CLI tokenization).
Deployment Guide
Installation is executed via npm:
bash npm install -g @tsmztech/mcp-server-salesforce
Available Interaction Tools (Function Signatures)
Metadata & Structure Operations
| Tool Name | Purpose |
|---|---|
salesforce_search_objects |
Locate standard/custom objects based on pattern matching. |
salesforce_describe_object |
Obtain deep schema definition for a specified entity. |
salesforce_manage_object |
Provision or alter custom object definitions. |
salesforce_manage_field |
Define or refine fields, including relationship linkage and initial security settings. |
salesforce_manage_field_permissions |
Fine-tune Field Level Security (FLS) across various user profiles. |
Data Query & Manipulation
| Tool Name | Purpose |
|---|---|
salesforce_query_records |
Standard data fetching with complex filtering and relational joins. |
salesforce_aggregate_query |
Execute SQL-like grouping and aggregation functions (SUM, AVG, COUNT). |
salesforce_dml_records |
Handle bulk insertion, modification, or deletion of records. |
salesforce_search_all |
Perform platform-wide text search via SOSL across configured objects. |
Code & Execution Management
| Tool Name | Purpose |
|---|---|
salesforce_read_apex |
Retrieve source code or metadata for Apex Classes. |
salesforce_write_apex |
Create new Apex Classes or update existing ones. |
salesforce_read_apex_trigger |
Retrieve source code or metadata for Apex Triggers. |
salesforce_write_apex_trigger |
Create new Apex Triggers or update existing ones for specified objects. |
salesforce_execute_anonymous |
Run arbitrary Apex code snippets for testing or immediate action; logs are returned. |
salesforce_manage_debug_logs |
Control log capture settings (enable/disable/retrieve) for specified users. |
Connection Setup
The server supports three primary methods for authenticating against your target Salesforce instance:
1. CLI-Driven Context (Recommended for Development)
Requires the Salesforce CLI (sf) to be installed and an active, default organization configured (sf org display). The server leverages the existing session credentials.
2. Username/Password Authentication
Requires explicit provision of the username, password, and security token. The instance URL defaults to https://login.salesforce.com unless specified.
3. OAuth 2.0 Client Credentials Flow
Requires setting up a Connected App in Salesforce. You must provide the Client ID, Client Secret, and critically, the full Instance URL (e.g., https://your-domain.my.salesforce.com).
Configuration Snippets for Claude Desktop Integration
(Configuration examples for claude_desktop_config.json omitted for brevity, as they map directly to environment variables required by the tool execution context.)
Usage Examples (Illustrative Prompts)
Data Retrieval: "List all Accounts established this fiscal quarter that have an open 'High Priority' Case linked to them."
Metadata Modification: "Establish a new custom object named 'Audit_Log__c' with fields for Timestamp (DateTime), Actor (Lookup to User), and Result (Text Area)."
Code Development: "Draft a new Apex Class named 'SystemHealthChecker' that contains a static method to check for overdue scheduled jobs."
Development & Licensing
- Source Repository: [GitHub Link Removed]
- Licensing: MIT License.
--- Contextual Background: Business administration technologies encompass all mechanisms—software, frameworks, and operational models—utilized by enterprises to maintain market viability, optimize internal procedures, and enhance overall productivity against dynamic market pressures. The selection and proper tailoring of these instruments are paramount to realizing measurable value from technology investments, moving beyond mere adoption of the newest available solution.*
