npm package: @kirtijha/salesforce-mcp-server
Description: Comprehensive Salesforce MCP Server with 61+ specialized tools for complete Salesforce ecosystem management - from data operations to advanced DevOps workflows. Supports stdio + HTTP modes for AI assistants and orchestration platforms.
Author: kirtijha
Latest version: 1.0.3

# Salesforce MCP Server

[![npm version](https://badge.fury.io/js/%40kirtijha%2Fsalesforce-mcp-server.svg)](https://www.npmjs.com/package/@kirtijha/salesforce-mcp-server)
[![npm downloads](https://img.shields.io/npm/dm/@kirtijha/salesforce-mcp-server.svg)](https://www.npmjs.com/package/@kirtijha/salesforce-mcp-server)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![CI/CD](https://github.com/IBM/salesforce-mcp-server/workflows/CI%2FCD/badge.svg)](https://github.com/IBM/salesforce-mcp-server/actions)
[![codecov](https://codecov.io/gh/IBM/salesforce-mcp-server/branch/main/graph/badge.svg)](https://codecov.io/gh/IBM/salesforce-mcp-server)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue.svg)](https://www.typescriptlang.org/)
[![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](https://nodejs.org/)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/11438/badge)](https://www.bestpractices.dev/projects/11438)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/IBM/salesforce-mcp-server/graphs/commit-activity)
[![GitHub issues](https://img.shields.io/github/issues/IBM/salesforce-mcp-server)](https://github.com/IBM/salesforce-mcp-server/issues)
[![GitHub pull requests](https://img.shields.io/github/issues-pr/IBM/salesforce-mcp-server)](https://github.com/IBM/salesforce-mcp-server/pulls)
[![GitHub last commit](https://img.shields.io/github/last-commit/IBM/salesforce-mcp-server)](https://github.com/IBM/salesforce-mcp-server/commits/main)

A comprehensive MCP (Model Context Protocol) server implementation that integrates Claude with Salesforce, providing 61+ specialized tools for complete Salesforce management. This server enables natural language interactions with your entire Salesforce ecosystem - from data operations to advanced DevOps workflows.

## 🔗 Links

- **GitHub**: [https://github.ibm.com/kirtijha/salesforce-mcp-server](https://github.ibm.com/kirtijha/salesforce-mcp-server)
- **NPM**: [https://www.npmjs.com/package/@kirtijha/salesforce-mcp-server](https://www.npmjs.com/package/@kirtijha/salesforce-mcp-server)

## 📦 Installation

### Using npx (Recommended - No Installation Required)

The easiest way to use the server is with `npx`, which automatically runs the latest version without installing:

**Configure your MCP client:**

```json
{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": ["-y", "@kirtijha/salesforce-mcp-server"],
      "env": {
        "SALESFORCE_USERNAME": "your-username@company.com",
        "SALESFORCE_PASSWORD": "your-password",
        "SALESFORCE_SECURITY_TOKEN": "your-security-token",
        "SALESFORCE_INSTANCE_URL": "https://your-instance.salesforce.com"
      }
    }
  }
}
```

### Global Installation

Install globally to use the server anywhere:

```bash
npm install -g @kirtijha/salesforce-mcp-server
```

Then configure your MCP client:

```json
{
  "mcpServers": {
    "salesforce": {
      "command": "salesforce-mcp-server",
      "env": {
        "SALESFORCE_USERNAME": "your-username@company.com",
        "SALESFORCE_PASSWORD": "your-password",
        "SALESFORCE_SECURITY_TOKEN": "your-security-token",
        "SALESFORCE_INSTANCE_URL": "https://your-instance.salesforce.com"
      }
    }
  }
}
```

### HTTP Server Mode

Run as a standalone HTTP server for remote access or orchestration platforms:

```bash
# Set environment variables
export SF_USERNAME="your-username@company.com"
export SF_PASSWORD="your-password"
export SF_SECURITY_TOKEN="your-security-token"
export MCP_API_KEY="your-secure-api-key"
export PORT=3000

# Using npx
npx -y @kirtijha/salesforce-mcp-server --http

# Or if installed globally
salesforce-mcp-http
```

The server will be available at:

- **MCP endpoint**: `http://localhost:3000/mcp`
- **Tools list**: `http://localhost:3000/tools`
- **Health check**: `http://localhost:3000/health`

See [REMOTE_CONFIG.md](REMOTE_CONFIG.md) for detailed HTTP configuration.

### Local Development Installation

For contributing or local development:

```bash
# Clone the repository
git clone https://github.ibm.com/kirtijha/salesforce-mcp-server.git
cd salesforce-mcp-server

# Install dependencies
npm install

# Build the project
npm run build
```

## ⚡ Quick Start

## 📚 Configuration Examples

### Using npx (Recommended)

<details open>
<summary><b>🔵 IBM Bob IDE</b></summary>

**Global Configuration** (`~/Library/Application Support/Bob-IDE/User/globalStorage/ibm.bob-code/settings/mcp_settings.json`):

```json
{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": ["-y", "@kirtijha/salesforce-mcp-server"],
      "env": {
        "SALESFORCE_USERNAME": "your-username@company.com",
        "SALESFORCE_PASSWORD": "your-password",
        "SALESFORCE_SECURITY_TOKEN": "your-security-token",
        "SALESFORCE_INSTANCE_URL": "https://your-instance.salesforce.com"
      }
    }
  }
}
```

**Project Configuration** (`<project>/.Bob/mcp.json`):

```json
{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": ["-y", "@kirtijha/salesforce-mcp-server"],
      "env": {
        "SALESFORCE_USERNAME": "your-username@company.com",
        "SALESFORCE_PASSWORD": "your-password",
        "SALESFORCE_SECURITY_TOKEN": "your-security-token",
        "SALESFORCE_INSTANCE_URL": "https://your-instance.salesforce.com"
      }
    }
  }
}
```

</details>

<details>
<summary><b>🟣 Claude Desktop</b></summary>

Add to your `claude_desktop_config.json` (`~/Library/Application Support/Claude/claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": ["-y", "@kirtijha/salesforce-mcp-server"],
      "env": {
        "SALESFORCE_USERNAME": "your-username@company.com",
        "SALESFORCE_PASSWORD": "your-password",
        "SALESFORCE_SECURITY_TOKEN": "your-security-token",
        "SALESFORCE_INSTANCE_URL": "https://your-instance.salesforce.com"
      }
    }
  }
}
```

</details>

<details>
<summary><b>🟢 GitHub Copilot Chat (VS Code)</b></summary>

**Project Configuration** (`<project>/.vscode/mcp.json`):

```json
{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": ["-y", "@kirtijha/salesforce-mcp-server"],
      "env": {
        "SALESFORCE_USERNAME": "your-username@company.com",
        "SALESFORCE_PASSWORD": "your-password",
        "SALESFORCE_SECURITY_TOKEN": "your-security-token",
        "SALESFORCE_INSTANCE_URL": "https://your-instance.salesforce.com"
      }
    }
  }
}
```

</details>

### Using Local Installation

If you've cloned the repository locally:

<details>
<summary><b>🔵 IBM Bob IDE (Local)</b></summary>

### Configuration

**Global Configuration** (`~/Library/Application Support/Bob-IDE/User/globalStorage/ibm.bob-code/settings/mcp_settings.json`):

```json
{
  "mcpServers": {
    "salesforce-main": {
      "command": "node",
      "args": ["/absolute/path/to/salesforce-mcp-server/dist/index.js"],
      "env": {
        "SALESFORCE_USERNAME": "your-username@company.com",
        "SALESFORCE_PASSWORD": "your-password",
        "SALESFORCE_SECURITY_TOKEN": "your-security-token",
        "SALESFORCE_INSTANCE_URL": "https://your-instance.salesforce.com"
      }
    }
  }
}
```

**Project Configuration** (`<project>/.Bob/mcp.json`):

```json
{
  "mcpServers": {
    "salesforce-main": {
      "command": "node",
      "args": ["/absolute/path/to/salesforce-mcp-server/dist/index.js"],
      "env": {
        "SALESFORCE_USERNAME": "your-username@company.com",
        "SALESFORCE_PASSWORD": "your-password",
        "SALESFORCE_SECURITY_TOKEN": "your-security-token",
        "SALESFORCE_INSTANCE_URL": "https://your-instance.salesforce.com"
      }
    }
  }
}
```

> **Note**: Replace `/absolute/path/to/` with the actual path where you cloned the repository.

</details>

<details>
<summary><b>� Claude Desktop (Local)</b></summary>

Add to your `claude_desktop_config.json` (`~/Library/Application Support/Claude/claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "salesforce-main": {
      "command": "node",
      "args": ["/absolute/path/to/salesforce-mcp-server/dist/index.js"],
      "env": {
        "SALESFORCE_USERNAME": "your-username@company.com",
        "SALESFORCE_PASSWORD": "your-password",
        "SALESFORCE_SECURITY_TOKEN": "your-security-token",
        "SALESFORCE_INSTANCE_URL": "https://your-instance.salesforce.com"
      }
    }
  }
}
```

> **Note**: Replace `/absolute/path/to/` with the actual path where you cloned the repository.

</details>

<details>
<summary><b>🟢 GitHub Copilot Chat (VS Code, Local)</b></summary>

**Project Configuration** (`<project>/.vscode/mcp.json`):

```json
{
  "mcpServers": {
    "salesforce-main": {
      "command": "node",
      "args": ["/absolute/path/to/salesforce-mcp-server/dist/index.js"],
      "env": {
        "SALESFORCE_USERNAME": "your-username@company.com",
        "SALESFORCE_PASSWORD": "your-password",
        "SALESFORCE_SECURITY_TOKEN": "your-security-token",
        "SALESFORCE_INSTANCE_URL": "https://your-instance.salesforce.com"
      }
    }
  }
}
```

> **Note**: Replace `/absolute/path/to/` with the actual path where you cloned the repository.

</details>

<details>
<summary><b>🟣 Claude Desktop</b></summary>

### Configuration

Add to your `claude_desktop_config.json` (`~/Library/Application Support/Claude/claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "salesforce-main": {
      "command": "node",
      "args": ["/absolute/path/to/salesforce-mcp-server/dist/index.js"],
      "env": {
        "SALESFORCE_USERNAME": "your-username@company.com",
        "SALESFORCE_PASSWORD": "your-password",
        "SALESFORCE_SECURITY_TOKEN": "your-security-token",
        "SALESFORCE_INSTANCE_URL": "https://your-instance.salesforce.com"
      }
    }
  }
}
```

> **Note**: Replace `/absolute/path/to/` with the actual path where you cloned the repository.

</details>

<details>
<summary><b>🟢 GitHub Copilot Chat (VS Code)</b></summary>

### Configuration

**User-wide Configuration** (`~/.config/Code/User/settings.json`):

```json
{
  "mcp.servers": {
    "salesforce-main": {
      "command": "node",
      "args": ["/absolute/path/to/salesforce-mcp-server/dist/index.js"],
      "env": {
        "SALESFORCE_USERNAME": "your-username@company.com",
        "SALESFORCE_PASSWORD": "your-password",
        "SALESFORCE_SECURITY_TOKEN": "your-security-token",
        "SALESFORCE_INSTANCE_URL": "https://your-instance.salesforce.com"
      }
    }
  }
}
```

**Project Configuration** (`<project>/.vscode/mcp.json`):

```json
{
  "mcpServers": {
    "salesforce-main": {
      "command": "node",
      "args": ["/absolute/path/to/salesforce-mcp-server/dist/index.js"],
      "env": {
        "SALESFORCE_USERNAME": "your-username@company.com",
        "SALESFORCE_PASSWORD": "your-password",
        "SALESFORCE_SECURITY_TOKEN": "your-security-token",
        "SALESFORCE_INSTANCE_URL": "https://your-instance.salesforce.com"
      }
    }
  }
}
```

> **Note**: Replace `/absolute/path/to/` with the actual path where you cloned the repository.

</details>

## 🧪 Testing the Server

Once configured, restart your IDE and test the connection:

```bash
# From the project directory, you can also run the server directly
node dist/index.js
```

The server will start and wait for MCP protocol messages via stdio.

## 🔧 Environment Variables

Configure your Salesforce connection using environment variables or in your IDE configuration:

| Variable                    | Description                  | Required | Example                                  |
| --------------------------- | ---------------------------- | -------- | ---------------------------------------- |
| `SALESFORCE_USERNAME`       | Your Salesforce username     | Yes      | `user@company.com`                       |
| `SALESFORCE_PASSWORD`       | Your Salesforce password     | Yes      | `yourpassword`                           |
| `SALESFORCE_SECURITY_TOKEN` | Salesforce security token    | Yes      | `yoursecuritytoken`                      |
| `SALESFORCE_INSTANCE_URL`   | Your Salesforce instance URL | Yes      | `https://your-instance.salesforce.com`   |
| `SALESFORCE_API_VERSION`    | API version to use           | No       | `58.0` (default)                         |
| `SALESFORCE_LOGIN_URL`      | Login URL                    | No       | `https://login.salesforce.com` (default) |

## Features Included

### Core Data & Schema Management

- **Object and Field Management**: Create and modify custom objects and fields using natural language
- **Smart Object Search**: Find Salesforce objects using partial name matches
- **Detailed Schema Information**: Get comprehensive field and relationship details for any object
- **Flexible Data Queries**: Query records with relationship support and complex filters
- **Data Manipulation**: Insert, update, delete, and upsert records with ease
- **Cross-Object Search**: Search across multiple objects using SOSL
- **Bulk Operations**: Handle large datasets efficiently with Salesforce Bulk API
- **Data Import/Export**: Transfer data in multiple formats (CSV, JSON, Excel)

### Advanced Development & DevOps

- **Apex Code Management**: Read, create, and update Apex classes and triggers
- **Anonymous Apex Execution**: Run Apex code without creating permanent classes
- **Debug Log Management**: Enable, disable, and retrieve debug logs for users
- **Test Execution**: Run Apex tests and view code coverage reports
- **Static Code Analysis**: Analyze code quality, security, and performance
- **Package Management**: Create, install, and manage Salesforce packages
- **Sandbox Management**: Create, refresh, and manage sandbox environments
- **Deployment Management**: Monitor and manage deployments and change sets

### User & Security Management

- **User Management**: Create, update, deactivate users and reset passwords
- **Profile Management**: Create, clone, and update user profiles
- **Permission Sets**: Manage permission sets and assignments
- **Role Hierarchy**: Create and manage role hierarchies
- **Field-Level Security**: Manage field permissions across profiles
- **User Permission Analysis**: View effective permissions for users

### Workflow & Automation

- **Flow Management**: List, activate, and deactivate Salesforce Flows
- **Workflow Rules**: Manage and monitor workflow rule execution
- **Process Builder**: Control Process Builder processes
- **Approval Processes**: Manage approval process configurations
- **Automation Monitoring**: View status of running processes and failed automation

### Communication & Content

- **Email Management**: Send emails using templates and track delivery
- **Email Templates**: Create and manage email templates
- **File Management**: Upload, download, share, and manage Salesforce files
- **Chatter Integration**: Post, comment, and manage Chatter feeds
- **Knowledge Articles**: Create, search, and manage Knowledge articles

### Analytics & Monitoring

- **Performance Monitoring**: Monitor org performance and system health
- **Error Monitoring**: Track and analyze system errors and exceptions
- **Usage Analytics**: Analyze user behavior and feature adoption
- **Audit Trail**: Access setup changes and user activity logs
- **Login Forensics**: Advanced security investigation and threat detection
- **Territory Management**: Manage sales territories and assignments

### Integration & External Systems

- **REST API Callouts**: Test and manage external REST integrations
- **SOAP API Callouts**: Handle SOAP web service integrations
- **Platform Events**: Publish and manage platform events for real-time integration
- **Streaming API**: Manage real-time data streaming and change data capture
- **Heroku Connect**: Manage bi-directional data synchronization with PostgreSQL

### Business Operations

- **Price Books**: Manage product pricing and price book entries
- **Forecasting**: Handle sales forecasting and quota management
- **Case Escalation**: Manage case escalation rules and processes
- **Duplicate Management**: Find and merge duplicate records
- **Data Backup**: Schedule and manage data backups with restoration

### Organization Management

- **Org Limits**: Monitor API limits, storage, and feature usage
- **Dashboard Management**: Manage dashboards and their components
- **Report Management**: Create, run, and schedule reports
- **Connected Apps**: Manage OAuth configurations and security settings
- **Scratch Orgs**: Create and manage development environments

### Intuitive Error Handling

- Clear feedback with Salesforce-specific error details
- Comprehensive logging and debugging capabilities
- Graceful error recovery with meaningful messages

## ⚠️ Requirements and Limitations

### Salesforce Edition Requirements

Some tools require specific Salesforce features or licenses that may not be available in all editions or sandbox types:

#### Features Not Available in All Editions

| Tool/Feature | Requirements | Notes |
|--------------|--------------|-------|
| **Flow Management** (`salesforce_manage_flows`) | - Salesforce Flow feature enabled<br>- FlowDefinition object access | May not be available in some sandbox types or older editions. The tool will provide a helpful error message if unavailable. |
| **Process Builder** (`salesforce_manage_process_builder`) | - Process Builder feature enabled<br>- Flow object with ProcessType='Workflow' | May not be available in all sandbox types. The tool will provide a helpful error message if unavailable. |
| **Territory Management** (`salesforce_territory_management`) | - Territory Management 2.0 enabled<br>- Territory2 object access | Requires Enterprise or Unlimited edition with Territory Management enabled |
| **Forecasting** (`salesforce_forecasting`) | - Collaborative Forecasting enabled<br>- ForecastingQuota access | Requires Professional, Enterprise, Performance, or Unlimited edition |
| **Knowledge Articles** (`salesforce_knowledge_articles`) | - Salesforce Knowledge enabled<br>- Knowledge article types configured | Requires specific Knowledge licenses |

### Object and Field Limitations

#### Metadata Object Field Availability

Some metadata objects have limited fields available via SOQL queries:

| Object | Unavailable Fields | Workaround |
|--------|-------------------|------------|
| **EntityDefinition** | `Description` | The server automatically excludes this field from queries. Use the object's Label and DeveloperName instead. |
| **ConnectedApplication** | `Description` (via SOQL) | The server fetches available fields only. Use the Salesforce UI for full metadata. |

#### Relationship Query Limitations

##### LoginHistory User Relationships

The `LoginHistory` object does **not support direct User relationship queries** in SOQL:

```soql
-- ❌ This will fail:
SELECT UserId, User.Name, User.Username FROM LoginHistory

-- ✅ The server handles this automatically:
-- Queries LoginHistory separately, then enriches with User data
```

**Affected Tools:**
- `salesforce_login_forensics` - All operations automatically handle this limitation
- `salesforce_usage_analytics` - Login pattern analysis operations

The server automatically:
1. Queries `LoginHistory` with only direct fields
2. Fetches related `User` records separately
3. Joins the data in memory
4. Returns enriched results

### SOQL Query Limitations

#### Aggregate Functions

Salesforce SOQL has specific requirements for aggregate functions:

| Issue | Incorrect | Correct | Fixed In |
|-------|-----------|---------|----------|
| **COUNT() syntax** | `COUNT()` | `COUNT(Id)` | All tools using aggregates |
| **COUNT_DISTINCT** | `COUNT_DISTINCT(Field)` | Separate `GROUP BY` query | `salesforce_usage_analytics`<br>`salesforce_connected_apps` |
| **ORDER BY aggregates** | `ORDER BY SUM(Amount) DESC` | `ORDER BY FieldName` or remove ORDER BY | `salesforce_forecasting` |

**Example - Counting users by profile:**
```soql
-- ❌ Not supported:
SELECT Profile.Name, COUNT_DISTINCT(Id) FROM User GROUP BY Profile.Name

-- ✅ Server uses:
SELECT Profile.Name FROM User GROUP BY Profile.Name
-- Then counts the result set
```

### API and Governor Limits

#### Standard Salesforce Limits Apply

| Limit Type | Description | Monitoring Tool |
|------------|-------------|-----------------|
| **API Requests** | 15,000-1,000,000 per 24 hours (edition-dependent) | `salesforce_org_limits`<br>`salesforce_performance_monitoring` |
| **Concurrent API Requests** | 25-100 concurrent requests | `salesforce_performance_monitoring` |
| **Bulk API Batches** | 10,000 per 24 hours | `salesforce_org_limits` |
| **SOQL Query Rows** | 50,000 rows per query (synchronous)<br>10,000,000 rows (Bulk API) | Use `limit` parameter in queries |
| **File Upload Size** | 2 GB per file | `salesforce_file_management` |

### Sandbox Limitations

Some features behave differently in sandboxes vs production:

| Feature | Production | Sandbox | Notes |
|---------|------------|---------|-------|
| **Email Delivery** | Real emails sent | Emails not delivered (test mode) | Use `salesforce_send_emails` with caution |
| **Debug Logs** | Full retention | Limited retention | Use `salesforce_manage_debug_logs` |
| **Storage Limits** | Full allocation | Reduced allocation | Check with `salesforce_org_limits` |
| **Integration Users** | All users available | May need separate sandbox users | Check user access before operations |

### Data Type and JavaScript Limitations

#### Number Formatting

The server includes safe formatting for numeric values:

```javascript
// ✅ Safe formatting (used internally):
const formatNumber = (num) => {
  return num !== undefined && num !== null ? num.toLocaleString() : '0';
};
```

**Affected tools:**
- `salesforce_performance_monitoring`
- `salesforce_rest_callouts`

### Best Practices

1. **Check Org Limits First:**
   ```bash
   Use salesforce_org_limits before bulk operations
   ```

2. **Use Appropriate Tools for Data Size:**
   - Small datasets (< 200 records): `salesforce_dml_records`
   - Large datasets (> 200 records): `salesforce_bulk_operations`

3. **Test in Sandbox First:**
   - Always test data modifications in sandbox
   - Verify automation behavior before production deployment

4. **Monitor Performance:**
   - Use `salesforce_performance_monitoring` to track system health
   - Check `salesforce_error_monitoring` for issues

5. **Handle Unavailable Features Gracefully:**
   - Flow and Process Builder tools provide clear error messages
   - Check error responses before retrying operations

### Getting Help

If you encounter issues:

1. **Check the error message** - The server provides detailed Salesforce error information
2. **Verify org features** - Ensure required features are enabled in your Salesforce org
3. **Check API limits** - Use `salesforce_org_limits` to verify available capacity
4. **Review documentation** - See tool-specific examples below
5. **Open an issue** - Report bugs or feature requests on [GitHub](https://github.com/IBM/salesforce-mcp-server/issues)

## 🔧 Tools (64 Total)

<details open>
<summary><b>Click to expand/collapse all tools</b></summary>

### Core Data & Schema Management

#### salesforce_search_objects

Search for standard and custom objects:

- Search by partial name matches
- Finds both standard and custom objects
- Example: "Find objects related to Account" will find Account, AccountHistory, etc.

#### salesforce_describe_object

Get detailed object schema information:

- Field definitions and properties
- Relationship details
- Picklist values
- Example: "Show me all fields in the Account object"

#### salesforce_query_records

Query records with relationship support:

- Parent-to-child relationships
- Child-to-parent relationships
- Complex WHERE conditions
- Example: "Get all Accounts with their related Contacts"
- Note: For queries with GROUP BY or aggregate functions, use salesforce_aggregate_query

#### salesforce_aggregate_query

Execute aggregate queries with GROUP BY:

- GROUP BY single or multiple fields
- Aggregate functions: COUNT, COUNT_DISTINCT, SUM, AVG, MIN, MAX
- HAVING clauses for filtering grouped results
- Date/time grouping functions
- Example: "Count opportunities by stage" or "Find accounts with more than 10 opportunities"

#### salesforce_dml_records

Perform data operations:

- Insert new records
- Update existing records
- Delete records
- Upsert using external IDs
- Example: "Update status of multiple accounts"

#### salesforce_search_all

Search across multiple objects:

- SOSL-based search
- Multiple object support
- Field snippets
- Example: "Search for 'cloud' across Accounts and Opportunities"

### Object & Field Management

#### salesforce_manage_object

Create and modify custom objects:

- Create new custom objects
- Update object properties
- Configure sharing settings
- Example: "Create a Customer Feedback object"

#### salesforce_manage_field

Manage object fields:

- Add new custom fields
- Modify field properties
- Create relationships
- Automatically grants Field Level Security to System Administrator by default
- Use `grantAccessTo` parameter to specify different profiles
- Example: "Add a Rating picklist field to Account"

#### salesforce_manage_field_permissions

Manage Field Level Security (Field Permissions):

- Grant or revoke read/edit access to fields for specific profiles
- View current field permissions
- Bulk update permissions for multiple profiles
- Example: "Grant System Administrator access to Custom_Field\_\_c on Account"

### Data Management & Operations

#### salesforce_bulk_operations

Perform bulk operations on large datasets:

- Insert, update, delete, upsert operations for thousands of records
- Export large datasets using Bulk API
- Optimized for high-volume data processing
- Example: "Bulk insert 10,000 accounts from CSV data"

#### salesforce_data_export

Export Salesforce data to various formats:

- CSV, JSON, and Excel export options
- Custom filtering and sorting
- Large dataset support with relationship fields
- Example: "Export all opportunities to CSV with custom fields"

#### salesforce_data_import

Import data into Salesforce from various formats:

- CSV and JSON import with validation
- Duplicate detection and error handling
- Batch processing with detailed error reporting
- Example: "Import contacts from CSV with validation"

#### salesforce_manage_duplicates

Find and merge duplicate records:

- Identify potential duplicates using matching rules
- Merge duplicate records with field mapping
- Configure duplicate detection rules
- Example: "Find and merge duplicate accounts by name"

#### salesforce_data_backup

Backup critical Salesforce data:

- Create full or incremental backups
- Schedule automated backups
- Export data in multiple formats with restoration capabilities
- Example: "Backup all Account data with weekly scheduling"

### Development & Code Management

#### salesforce_read_apex

Read Apex classes:

- Get full source code of specific classes
- List classes matching name patterns
- View class metadata (API version, status, etc.)
- Support for wildcards (\* and ?) in name patterns
- Example: "Show me the AccountController class" or "Find all classes matching Account*Cont*"

#### salesforce_write_apex

Create and update Apex classes:

- Create new Apex classes
- Update existing class implementations
- Specify API versions
- Example: "Create a new Apex class for handling account operations"

#### salesforce_read_apex_trigger

Read Apex triggers:

- Get full source code of specific triggers
- List triggers matching name patterns
- View trigger metadata (API version, object, status, etc.)
- Support for wildcards (\* and ?) in name patterns
- Example: "Show me the AccountTrigger" or "Find all triggers for Contact object"

#### salesforce_write_apex_trigger

Create and update Apex triggers:

- Create new Apex triggers for specific objects
- Update existing trigger implementations
- Specify API versions and event operations
- Example: "Create a new trigger for the Account object"

#### salesforce_execute_anonymous

Execute anonymous Apex code:

- Run Apex code without creating a permanent class
- View debug logs and execution results
- Useful for data operations not directly supported by other tools
- Example: "Execute Apex code to calculate account metrics"

#### salesforce_manage_debug_logs

Manage debug logs for Salesforce users:

- Enable debug logs for specific users
- Disable active debug log configurations
- Retrieve and view debug logs
- Configure log levels (NONE, ERROR, WARN, INFO, DEBUG, FINE, FINER, FINEST)
- Example: "Enable debug logs for user@example.com"

### Testing & Quality Assurance

#### salesforce_test_execution

Execute Apex tests and view code coverage:

- Run specific test classes or all tests
- View detailed test execution results
- Check code coverage reports for classes
- Example: "Run all tests and show coverage for AccountService class"

#### salesforce_static_analysis

Perform static analysis on Salesforce code:

- Analyze code quality, security, and performance issues
- Support for Apex classes, triggers, flows, and configurations
- Generate detailed reports with severity levels
- Example: "Analyze security issues in all Apex classes"

### User & Security Management

#### salesforce_manage_users

Manage Salesforce users:

- Create new users with profiles and roles
- Update user details, profiles, roles
- Deactivate users safely
- Reset passwords with email notifications
- Example: "Create new sales users with Sales User profile"

#### salesforce_manage_profiles

Manage user profiles:

- Create new custom profiles
- Clone existing profiles with modifications
- Update profile settings and permissions
- Query profiles and their permissions
- Example: "Clone Standard User profile to create Sales Manager profile"

#### salesforce_manage_permission_sets

Manage permission sets:

- Create permission sets with specific permissions
- Assign/unassign permission sets to users
- Update permission set permissions
- Query permission sets and assignments
- Example: "Create API Access permission set and assign to integration users"

#### salesforce_manage_roles

Manage role hierarchy:

- Create new roles in the hierarchy
- Update role details and hierarchy structure
- Query roles and hierarchy relationships
- Assign roles to users
- Example: "Create Sales Manager role under VP Sales"

#### salesforce_view_user_permissions

View effective permissions for users:

- Check user's profile permissions
- List assigned permission sets
- View object and field-level permissions
- Analyze effective permissions from all sources
- Example: "Check all permissions for user@example.com"

### Workflow & Automation

#### salesforce_manage_flows

Manage Salesforce Flows:

- List all flows with status information
- Get flow details and versions
- Activate or deactivate flows
- View flow execution history
- Example: "List all active flows" or "Deactivate problematic flow"

#### salesforce_manage_workflow_rules

Manage Workflow Rules:

- List all workflow rules with execution details
- Get workflow rule configuration and actions
- View workflow rule execution history
- Example: "List all active workflow rules for Account object"

#### salesforce_manage_process_builder

Manage Process Builder processes:

- List Process Builder processes with status
- Activate or deactivate processes
- Get detailed process information
- Example: "Activate lead conversion process"

#### salesforce_manage_approval_processes

Manage approval processes:

- List approval processes for objects
- Get detailed approval process configuration
- Activate or deactivate approval processes
- Example: "List all Account approval processes"

#### salesforce_view_automation_status

Monitor automation status and performance:

- View currently running processes and flows
- Check failed automation with error details
- Get automation performance statistics
- Monitor automation queue depth
- Example: "Check failed flows today" or "View running approval processes"

### Communication & Content Management

#### salesforce_send_emails

Send emails through Salesforce:

- Send individual or mass emails
- Use email templates with merge fields
- Track email delivery and opens
- Send from specific users or org-wide addresses
- Example: "Send welcome email to new customers using template"

#### salesforce_manage_email_templates

Manage email templates:

- List all email templates by type/folder
- Create new email templates (Classic or Lightning)
- Update existing templates
- Get template content and metadata
- Example: "Create welcome email template with dynamic fields"

#### salesforce_file_management

Manage Salesforce Files and Content:

- Upload files to Salesforce (base64 encoded)
- Download file content
- Share files with users or groups
- List and manage files with metadata
- Example: "Upload document and share with sales team"

#### salesforce_chatter_posts

Manage Chatter posts and feeds:

- Create new Chatter posts to feeds
- Comment on existing posts
- Like or unlike posts
- Manage Chatter groups
- Example: "Post to company feed" or "Create team group"

#### salesforce_knowledge_articles

Manage Knowledge articles:

- Create new knowledge articles
- Search articles by keywords or categories
- Update and publish articles
- Manage article categories and versions
- Example: "Create FAQ article" or "Search support articles"

### Analytics & Monitoring

#### salesforce_performance_monitoring

Monitor org performance and system health:

- Check system performance metrics
- Monitor API usage and limits
- Analyze storage usage and processing times
- Monitor concurrent user sessions
- Example: "Check API limits" or "Monitor storage usage"

#### salesforce_error_monitoring

Monitor and analyze errors:

- View recent errors and exceptions
- Analyze debug log errors
- Track error patterns over time
- Monitor system-level problems
- Example: "View recent exceptions" or "Analyze error trends"

#### salesforce_usage_analytics

Analyze user behavior and feature adoption:

- Track user login patterns and activity
- Analyze feature usage across the organization
- Generate adoption reports and insights
- Monitor user engagement metrics
- Example: "Show feature adoption trends" or "Analyze user login patterns"

#### salesforce_audit_trail

Access audit trail data:

- View setup changes and field history
- Track user activities and data changes
- Export audit data for compliance
- Generate compliance reports
- Example: "Show setup changes last month" or "Export audit trail"

#### salesforce_login_forensics

Advanced security investigation:

- Analyze authentication patterns
- Detect security threats and anomalies
- Geographic analysis of logins
- Device tracking and behavior analysis
- Example: "Investigate suspicious login patterns" or "Analyze failed login attempts"

### Territory & Sales Management

#### salesforce_territory_management

Manage Territory Management 2.0:

- View territory hierarchy and structure
- Assign/remove users from territories
- Manage account-territory assignments
- View territory performance metrics
- Example: "View territory structure" or "Assign users to territories"

#### salesforce_forecasting

Handle sales forecasting:

- Manage forecast categories and quotas
- View forecast data and adjustments
- Configure forecasting settings
- Generate forecast reports
- Example: "View quarterly forecast data" or "Update sales quotas"

#### salesforce_price_books

Manage product pricing:

- Create and manage price books
- Add/update price book entries
- Configure product pricing strategies
- Manage standard and custom price books
- Example: "Create regional price book" or "Update product pricing"

### Business Process Management

#### salesforce_case_escalation

Manage case escalation:

- Configure escalation rules and criteria
- Monitor escalated cases
- Manage escalation milestones and actions
- Track escalation performance
- Example: "Configure priority case escalation" or "Monitor escalated cases"

### Integration & External Systems

#### salesforce_rest_callouts

Manage REST API callouts:

- Test REST endpoints from Salesforce
- View callout logs and responses
- Manage named credentials for authentication
- Check rate limits and analyze errors
- Example: "Test external API" or "View callout logs"

#### salesforce_soap_callouts

Manage SOAP web service callouts:

- Generate Apex classes from WSDL
- Make SOAP calls with authentication
- Handle SOAP headers and fault handling
- Parse WSDL and manage certificates
- Example: "Generate classes from WSDL" or "Make authenticated SOAP call"

#### salesforce_platform_events

Manage Platform Events:

- Publish custom platform events
- View event definitions and logs
- Monitor event volume and limits
- Manage Change Data Capture events
- Example: "Publish custom event" or "Monitor event volume"

#### salesforce_streaming_api

Manage Streaming API:

- Create and manage PushTopics
- Subscribe to Change Data Capture
- Handle Platform Events and Generic Events
- Configure replay settings
- Example: "Create PushTopic for Account changes" or "Subscribe to opportunity updates"

#### salesforce_heroku_connect

Manage Heroku Connect integration:

- Set up bi-directional data synchronization
- Configure object mapping between Salesforce and PostgreSQL
- Monitor sync status and performance
- Manage data transformations
- Example: "Set up account sync to PostgreSQL" or "Monitor sync performance"

### DevOps & Environment Management

#### salesforce_package_management

Manage packages and versions:

- List all packages in the org
- Create new package versions
- Install/uninstall packages
- Get detailed package information
- Example: "List all packages" or "Install managed package"

#### salesforce_manage_sandboxes

Manage sandbox environments:

- List all sandboxes with status
- Create new sandboxes
- Refresh existing sandboxes
- Check sandbox creation/refresh status
- Example: "Create developer sandbox" or "Refresh staging environment"

#### salesforce_scratch_orgs

Manage scratch orgs for development:

- Create and delete scratch orgs
- Push/pull source code
- Deploy metadata and run tests
- Manage scratch org users
- Example: "Create scratch org for feature development" or "Deploy code to scratch org"

#### salesforce_deployment_status

Monitor deployment operations:

- Check deployment status and history
- Validate deployments before execution
- Cancel running deployments
- View detailed deployment results
- Example: "Check current deployment status" or "Validate change set"

#### salesforce_change_sets

Manage change sets for deployment:

- Create and configure change sets
- Add/remove components from change sets
- Deploy change sets between orgs
- Monitor change set status
- Example: "Create change set for metadata deployment" or "Deploy to production"

#### salesforce_connected_apps

Manage connected apps:

- List and configure connected apps
- Manage OAuth settings and policies
- Configure IP restrictions and certificates
- View app analytics and refresh tokens
- Example: "Configure OAuth app" or "Set IP restrictions"

### Organization Management

#### salesforce_org_limits

Check organization limits and usage:

- Monitor API call limits and usage
- Check data and file storage limits
- View custom object and field limits
- Monitor user license usage
- Example: "Check API usage" or "Monitor storage consumption"

#### salesforce_manage_dashboards

Manage dashboards and components:

- List available dashboards with details
- View dashboard components and metadata
- Refresh dashboard data
- Manage dashboard sharing and subscriptions
- Example: "List all dashboards" or "Refresh sales dashboard"

#### salesforce_manage_reports

Manage reports:

- List reports by folder/type
- Run reports and get results
- Create basic report structures
- Schedule automated reports
- Example: "Run opportunity pipeline report" or "Schedule weekly sales report"

### Advanced Analytics

#### salesforce_analytics_queries

Execute advanced analytics queries:

- Run complex analytical queries
- Access Einstein Analytics data
- Perform statistical analysis
- Generate business intelligence reports
- Example: "Run advanced sales analytics" or "Generate KPI dashboard data"

### salesforce_execute_anonymous

Execute anonymous Apex code:

- Run Apex code without creating a permanent class
- View debug logs and execution results
- Useful for data operations not directly supported by other tools
- Example: "Execute Apex code to calculate account metrics" or "Run a script to update related records"

### salesforce_manage_debug_logs

Manage debug logs for Salesforce users:

- Enable debug logs for specific users
- Disable active debug log configurations
- Retrieve and view debug logs
- Configure log levels (NONE, ERROR, WARN, INFO, DEBUG, FINE, FINER, FINEST)
- Example: "Enable debug logs for user@example.com" or "Retrieve recent logs for an admin user"

</details>

## Installation

```bash
npm install -g @kirtijha/salesforce-mcp-server
```

### Salesforce Authentication

You can connect to Salesforce using one of two authentication methods:

#### 1. Username/Password Authentication (Default)

1. Set up your Salesforce credentials
2. Get your security token (Reset from Salesforce Settings)

#### 2. OAuth 2.0 Client Credentials Flow

1. Create a Connected App in Salesforce
2. Enable OAuth settings and select "Client Credentials Flow"
3. Set appropriate scopes (typically "api" is sufficient)
4. Save the Client ID and Client Secret
5. **Important**: Note your instance URL (e.g., `https://your-domain.my.salesforce.com`) as it's required for authentication

## 📚 Usage with Popular IDEs

<details>
<summary><b>🔵 IBM Bob IDE</b></summary>

### Configuration

Add to your IBM Bob IDE configuration file:

**Global Configuration** (`~/Library/Application Support/Bob-IDE/User/globalStorage/ibm.bob-code/settings/mcp_settings.json`):

#### For Username/Password Authentication:

```json
{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": ["-y", "@kirtijha/salesforce-mcp-server"],
      "env": {
        "SALESFORCE_CONNECTION_TYPE": "User_Password",
        "SALESFORCE_USERNAME": "your_username",
        "SALESFORCE_PASSWORD": "your_password",
        "SALESFORCE_TOKEN": "your_security_token",
        "SALESFORCE_INSTANCE_URL": "org_url"
      }
    }
  }
}
```

#### For OAuth 2.0 Client Credentials Flow:

```json
{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": ["-y", "@kirtijha/salesforce-mcp-server"],
      "env": {
        "SALESFORCE_CONNECTION_TYPE": "OAuth_2.0_Client_Credentials",
        "SALESFORCE_CLIENT_ID": "your_client_id",
        "SALESFORCE_CLIENT_SECRET": "your_client_secret",
        "SALESFORCE_INSTANCE_URL": "https://your-domain.my.salesforce.com"
      }
    }
  }
}
```

**Project Configuration** (`<project>/.Bob/mcp.json`):

Use the same JSON structure as above in your project's `.Bob/mcp.json` file.

> **Note**: For OAuth 2.0 Client Credentials Flow, the `SALESFORCE_INSTANCE_URL` must be your exact Salesforce instance URL (e.g., `https://your-domain.my.salesforce.com`).

</details>

<details>
<summary><b>🟣 Claude Desktop</b></summary>

### Configuration

Add to your `claude_desktop_config.json` (`~/Library/Application Support/Claude/claude_desktop_config.json`):

#### For Username/Password Authentication:

```json
{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": ["-y", "@kirtijha/salesforce-mcp-server"],
      "env": {
        "SALESFORCE_CONNECTION_TYPE": "User_Password",
        "SALESFORCE_USERNAME": "your_username",
        "SALESFORCE_PASSWORD": "your_password",
        "SALESFORCE_TOKEN": "your_security_token",
        "SALESFORCE_INSTANCE_URL": "org_url"
      }
    }
  }
}
```

#### For OAuth 2.0 Client Credentials Flow:

```json
{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": ["-y", "@kirtijha/salesforce-mcp-server"],
      "env": {
        "SALESFORCE_CONNECTION_TYPE": "OAuth_2.0_Client_Credentials",
        "SALESFORCE_CLIENT_ID": "your_client_id",
        "SALESFORCE_CLIENT_SECRET": "your_client_secret",
        "SALESFORCE_INSTANCE_URL": "https://your-domain.my.salesforce.com"
      }
    }
  }
}
```

> **Note**: For OAuth 2.0 Client Credentials Flow, the `SALESFORCE_INSTANCE_URL` must be your exact Salesforce instance URL (e.g., `https://your-domain.my.salesforce.com`). The token endpoint will be constructed as `<instance_url>/services/oauth2/token`.

</details>

<details>
<summary><b>🤖 GitHub Copilot Chat (VS Code)</b></summary>

### Configuration

**User-wide Configuration** (`~/.config/Code/User/settings.json`):

#### For Username/Password Authentication:

```json
{
  "mcp.servers": {
    "salesforce": {
      "command": "npx",
      "args": ["-y", "@kirtijha/salesforce-mcp-server"],
      "env": {
        "SALESFORCE_CONNECTION_TYPE": "User_Password",
        "SALESFORCE_USERNAME": "your_username",
        "SALESFORCE_PASSWORD": "your_password",
        "SALESFORCE_TOKEN": "your_security_token",
        "SALESFORCE_INSTANCE_URL": "org_url"
      }
    }
  }
}
```

#### For OAuth 2.0 Client Credentials Flow:

```json
{
  "mcp.servers": {
    "salesforce": {
      "command": "npx",
      "args": ["-y", "@kirtijha/salesforce-mcp-server"],
      "env": {
        "SALESFORCE_CONNECTION_TYPE": "OAuth_2.0_Client_Credentials",
        "SALESFORCE_CLIENT_ID": "your_client_id",
        "SALESFORCE_CLIENT_SECRET": "your_client_secret",
        "SALESFORCE_INSTANCE_URL": "https://your-domain.my.salesforce.com"
      }
    }
  }
}
```

**Project Configuration** (`<project>/.vscode/mcp.json`):

```json
{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": ["-y", "@kirtijha/salesforce-mcp-server"],
      "env": {
        "SALESFORCE_CONNECTION_TYPE": "User_Password",
        "SALESFORCE_USERNAME": "your_username",
        "SALESFORCE_PASSWORD": "your_password",
        "SALESFORCE_TOKEN": "your_security_token",
        "SALESFORCE_INSTANCE_URL": "org_url"
      }
    }
  }
}
```

> **Note**: For OAuth 2.0 Client Credentials Flow, the `SALESFORCE_INSTANCE_URL` must be your exact Salesforce instance URL (e.g., `https://your-domain.my.salesforce.com`).

</details>

---

## 🌐 Remote Configuration and Execution

For details on remote deployment and HTTP-based execution, see [REMOTE_CONFIG.md](REMOTE_CONFIG.md).

## Example Usage

### Core Data Operations

#### Searching Objects

```
"Find all objects related to Accounts"
"Show me objects that handle customer service"
"What objects are available for order management?"
```

#### Getting Schema Information

```
"What fields are available in the Account object?"
"Show me the picklist values for Case Status"
"Describe the relationship fields in Opportunity"
```

#### Querying Records

```
"Get all Accounts created this month"
"Show me high-priority Cases with their related Contacts"
"Find all Opportunities over $100k"
```

#### Aggregate Queries

```
"Count opportunities by stage"
"Show me the total revenue by account"
"Find accounts with more than 10 opportunities"
"Calculate average deal size by sales rep and quarter"
"Get the number of cases by priority and status"
```

### Data Management

#### Bulk Operations

```
"Bulk insert 10,000 accounts from CSV data"
"Update all opportunities in California region"
"Export all contacts to Excel with custom fields"
"Import leads from JSON with duplicate detection"
```

#### Data Quality

```
"Find duplicate accounts by name and email"
"Merge duplicate contacts preserving latest data"
"Backup all opportunity data with relationships"
"Schedule weekly backup of critical customer data"
```

### Development & DevOps

#### Apex Code Management

```
"Show me all Apex classes with 'Controller' in the name"
"Get the full code for the AccountService class"
"Create a new Apex utility class for handling date operations"
"Update the LeadConverter class to add a new method"
```

#### Testing & Quality

```
"Run all tests and show coverage for AccountService class"
"Analyze security issues in all Apex classes"
"Check code complexity for triggers"
"Generate test coverage report for custom classes"
```

#### Environment Management

```
"Create developer sandbox for feature testing"
"Deploy change set to staging environment"
"Create scratch org with custom configurations"
"Monitor deployment status and validate changes"
```

### User & Security Management

#### User Administration

```
"Create new sales users with Sales User profile"
"Clone Standard User profile to create custom Sales Manager profile"
"Grant System Administrator access to Custom_Field__c on Account"
"View all permissions for user@example.com"
```

#### Security & Permissions

```
"Create API Access permission set for integration users"
"Assign Sales Manager role to regional managers"
"Revoke field access for specific profiles"
"Audit user permissions across all profiles"
```

### Workflow & Automation

#### Process Management

```
"List all active flows in the organization"
"Activate lead conversion process"
"Monitor failed automation processes today"
"Check approval process configuration for expenses"
```

#### Business Rules

```
"Configure case escalation rules for priority cases"
"Set up territory assignments for new sales regions"
"Create workflow rule for opportunity notifications"
"Manage price book entries for regional pricing"
```

### Analytics & Monitoring

#### Performance & Health

```
"Check API usage and limits for this month"
"Monitor storage consumption across all objects"
"Analyze error trends over the last week"
"View system performance metrics"
```

#### User Analytics

```
"Show feature adoption trends across the organization"
"Analyze user login patterns for security audit"
"Generate compliance report for audit trail"
"Track knowledge article usage statistics"
```

### Communication & Content

#### Email & Templates

```
"Send welcome email to new customers using template"
"Create dynamic email template with merge fields"
"Schedule weekly newsletter to all leads"
"Track email delivery rates and engagement"
```

#### Content Management

```
"Upload product documentation and share with sales team"
"Create FAQ knowledge article for support"
"Post quarterly results to company Chatter feed"
"Manage file permissions for sensitive documents"
```

### Integration & External Systems

#### API Integration

```
"Test external REST API endpoint with authentication"
"Configure SOAP callout for legacy system integration"
"Publish platform event for real-time data sync"
"Set up Heroku Connect for PostgreSQL synchronization"
```

#### Real-time Data

```
"Create PushTopic for Account changes"
"Subscribe to opportunity updates via Streaming API"
"Monitor platform event volume and performance"
"Configure Change Data Capture for critical objects"
```

### Advanced Operations

#### Custom Object Management

```
"Create a Customer Feedback object with rating fields"
"Add a Status picklist field to Custom_Object__c"
"Update sharing settings for the Service Request object"
"Configure field-level security for sensitive data"
```

#### Advanced Analytics

```
"Run advanced sales analytics with forecasting data"
"Generate KPI dashboard data for executive reporting"
"Analyze territory performance with quota attainment"
"Create complex analytical queries for business intelligence"
```

## Comparison with Official Salesforce MCP Server

### How This Differs from [@salesforce/mcp](https://github.com/salesforcecli/mcp)

| Feature                     | Official Salesforce MCP           | This Server                         |
| --------------------------- | --------------------------------- | ----------------------------------- |
| **Tool Count**              | ~40-50 tools (selective)          | **61+ comprehensive tools**         |
| **Scope**                   | DX-focused workflows              | **Full Salesforce ecosystem**       |
| **Architecture**            | CLI-dependent (requires `sf` CLI) | **Direct API (jsforce) - zero CLI** |
| **Setup**                   | Complex (CLI + OAuth flows)       | **Simple (env variables)**          |
| **Authentication**          | Salesforce CLI auth               | **Username/password + token**       |
| **Transport**               | stdio only                        | **stdio + HTTP/REST**               |
| **Remote Deployment**       | ❌ Not supported                  | **✅ HTTP mode ready**              |
| **Agent Framework Support** | ❌ CLI-locked                     | **✅ REST API compatible**          |
| **Watsonx Orchestrate**     | ❌ Not possible                   | **✅ Fully compatible**             |
| **Non-CLI Usage**           | ❌ Requires CLI                   | **✅ Programmatic HTTP API**        |
| **Cloud Deployment**        | ❌ Local only                     | **✅ Container/cloud ready**        |
| **API Gateway Integration** | ❌ Not possible                   | **✅ RESTful endpoints**            |
| **Distribution**            | NPM package                       | **Source + local build**            |
| **Support**                 | Official Salesforce               | **Community/custom**                |

### Why Choose This Server?

#### ✅ **More Comprehensive** (61+ Tools)

Includes advanced features beyond DX workflows:

- Territory Management
- Forecasting
- Static Code Analysis
- Platform Events & Streaming API
- Scratch Org Management
- Change Sets & Deployments
- Debug Logs & Code Coverage

#### ✅ **HTTP/Remote Ready**

- Built-in HTTP server for remote deployment
- RESTful endpoints: `/mcp`, `/tools`, `/tools/{toolName}`
- API key authentication
- CORS support
- Deploy to any cloud platform (IBM Cloud, Heroku, AWS, Azure)

#### ✅ **Agent Framework Compatible**

Works with orchestration platforms that the official server cannot:

- **IBM Watsonx Orchestrate** ✅
- **LangChain** ✅
- **AutoGPT** ✅
- **IBM Concert** ✅
- Custom agent frameworks via REST API

#### ✅ **No CLI Dependency**

- Pure jsforce API integration
- No Salesforce CLI installation required
- Simpler setup and troubleshooting
- Faster startup times

#### ✅ **Enterprise-Ready**

- Container-ready (Dockerfile included)
- Kubernetes/OpenShift compatible
- Load balancer ready
- Multi-instance scalable
- Standard enterprise security patterns

### When to Use Official Salesforce MCP

Consider the official `@salesforce/mcp` if you:

- Already use Salesforce CLI extensively
- Need official Salesforce support and warranty
- Prefer NPM package installation (`npx -y @salesforce/mcp`)
- Only need DX-focused toolsets
- Use OAuth-based authentication flows

### When to Use This Server

This server is ideal if you:

- Need comprehensive Salesforce coverage (61+ tools)
- Want HTTP/REST API access for orchestration platforms
- Need Watsonx Orchestrate or agent framework integration
- Prefer simple setup without CLI dependencies
- Want to deploy remotely to cloud platforms
- Need programmatic API access for custom integrations
- Require features beyond DX workflows (analytics, territories, forecasting)

## Development

### Building from source

```bash
# Clone the repository
git clone https://github.com/kirtijha/salesforce-mcp-server.git

# Navigate to directory
cd salesforce-mcp-server

# Install dependencies
npm install

# Build the project
npm run build
```

### Running as HTTP Server (Remote Mode)

```bash
# Set environment variables
export SF_USERNAME="your-username@company.com"
export SF_PASSWORD="your-password"
export SF_SECURITY_TOKEN="your-security-token"
export MCP_API_KEY="your-secure-api-key"
export PORT=3000

# Start HTTP server
npm run start:http
```

The server will be available at:

- **MCP endpoint**: `http://localhost:3000/mcp`
- **Tools list**: `http://localhost:3000/tools`
- **Direct tool invocation**: `http://localhost:3000/tools/{toolName}`
- **Health check**: `http://localhost:3000/health`

See [REMOTE_CONFIG.md](REMOTE_CONFIG.md) for detailed HTTP configuration examples.

## Contributing

Contributions are welcome! Feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Issues and Support

If you encounter any issues or need support, please file an issue on the [GitHub repository](https://github.com/kirtijha/salesforce-mcp-server/issues).