ibm-salesforce-context

trevSmart/ibm-salesforce-context

3.2

If you are the rightful owner of ibm-salesforce-context and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

IBM Salesforce Context is an MCP server by IBM that provides Salesforce org context to your IDE AI agent, enhancing development with AI-powered tools and seamless Salesforce integration.

IBM Salesforce Context

An MCP server by IBM that provides super-fast Salesforce org context and actions to your IDE AI agent

Table of contents

  1. Key features
  2. Requirements
  3. Getting started
  4. Command Line Interface
  5. Toolset overview
  6. License

Key features

  • Salesforce Integration: Seamless connection to Salesforce orgs for AI-powered development
  • Built on Model Context Protocol
  • Supports stdio and HTTP transport
  • Comprehensive use of Model Context Protocol features: tools, resources, roots, prompts, elicitation, completion, sampling, progress notifications, logging, etc.

Toolset overview

ToolDescription
apex_debug_logsInspect, activate, deactivate, or fetch Apex debug logs with enforced output formatting so you can keep traceability during troubleshooting sessions without ever touching the CLI.
chat_with_agentforceSend curated prompts to Agentforce and receive structured responses that help coordinate guided automations or conversational assistance directly from the MCP client.
deploy_metadataDeploy only the exact Apex classes, triggers, or Lightning bundles you list, guaranteeing atomic deployments and avoiding the risk of pushing entire folders by mistake.
describe_objectRetrieve complete schema details, including permissions, data types, picklist values, and relationship metadata for any sObject so tools can reliably map field API names.
execute_queries_and_dmlBatch multiple SOQL queries plus DML operations in one composite call, referencing earlier results to build transactional workflows with minimal round-trips.
generate_metadataScaffold Apex classes, test classes, triggers, or LWC/Aura bundles with best-practice boilerplate so you can start coding immediately while keeping folder structure consistent.
get_apex_class_code_coverageReport coverage percentages, covered/uncovered line counts, and the exact test methods contributing to each class, making it easy to focus on the biggest gaps.
get_recently_viewed_recordsSurface the most recently accessed records for the authenticated user, including links, so you can quickly jump back into active work without crafting SOQL.
get_recordFetch a single record by Id with all requested fields plus formatted lookup references, ensuring MCP clients can present friendly names and deep links at once.
get_setup_audit_trailDownload filtered Setup Audit Trail entries with user, action, and timestamp data to trace admin changes or validate compliance requirements in seconds.
invoke_apex_rest_resourceCall any registered Apex REST resource in the org using GET/POST/PUT/PATCH/DELETE along with custom bodies and headers, then receive a structured response body.
run_anonymous_apexExecute ad-hoc Apex snippets that skip DML/SOQL, perfect for utility code, logging, or feature toggles when you just need quick logic to run inside the org.
run_apex_testTrigger test classes, suites, or selected methods, receive per-method runtime and status tables, and optionally fetch coverage for the classes impacted by the run.
utilsRetrieve org/user metadata, current datetime, record prefixes, or request cache resets so both humans and agents can understand the environment before issuing tool calls.

Requirements


Getting started

Install in your IDE

Install MCP Server

Manual installation

Add this configuration to your client:

{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": [
        "-y",
        "test_research4@latest"
      ]
    }
  }
}

Command Line Interface

IBM Salesforce Context supports comprehensive CLI arguments for configuration:

Basic Usage
# Use stdio transport (default)
test_research4

# Use HTTP transport
test_research4 --transport http

# Use HTTP transport with custom port
test_research4 --transport http --port 8080

# HTTP transport automatically finds available port if default is occupied
test_research4 --transport http  # Will use 3001, 3002, etc. if 3000 is busy

# Set log level
test_research4 --transport stdio --log-level debug

# Set workspace paths
test_research4 --transport http --workspace /path/to/project

# Show help
test_research4 --help

# Show version
test_research4 --version
CLI Arguments
ArgumentDescriptionDefaultExample
--transport TYPETransport type: stdio or httpstdio--transport http
--log-level LEVELSet log levelinfo--log-level debug
--port PORTHTTP port for http transport (auto-finds available if occupied)3000--port 8080
--workspace PATHSWorkspace paths (comma-separated)---workspace /path/to/project
--helpShow help message---help
--versionShow version information---version
Environment Variables

Environment variables can be used for default configuration (overridden by CLI arguments):

VariableDescriptionDefaultExample
MCP_TRANSPORTTransport type: stdio or httpstdioMCP_TRANSPORT=http
LOG_LEVELLog levelinfoLOG_LEVEL=debug
MCP_HTTP_PORTHTTP port for http transport (auto-finds available if occupied)3000MCP_HTTP_PORT=8080
WORKSPACE_FOLDER_PATHSWorkspace paths (comma-separated)-WORKSPACE_FOLDER_PATHS=/path/to/project
Automatic Port Management

When using HTTP transport, the server automatically handles port conflicts:

  • Default Behavior: Starts on port 3000 (or specified port)
  • Port Conflict Detection: If the requested port is occupied, automatically finds the next available port
  • User Notification: Displays a warning message when using an alternative port
  • Port Range: Checks up to 10 consecutive ports starting from the requested port
  • Error Handling: Clear error messages if no ports are available

Example output when port 3000 is occupied:

⚠️  Port 3000 is occupied. Using port 3001 instead.
🚀 MCP HTTP server running on port 3001
HTTP Endpoints

When running in HTTP mode, the server provides several useful endpoints:

Root Status Page
# Open in browser or use curl
curl http://localhost:3000/

Returns a beautiful HTML dashboard showing:

  • Server status and uptime
  • Salesforce CLI version and org connection status
  • Available MCP tools and resources
  • Environment information
  • Real-time status updates

The root page serves as the default landing page when accessing the server in a web browser.

Health Check Endpoint
curl http://localhost:3000/healthz

Returns basic health information:

{
  "status": "healthy",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "activeSessions": 2,
  "serverType": "MCP HTTP Server",
  "version": "1.0.0"
}
Detailed Status Endpoint
curl http://localhost:3000/status

Returns comprehensive server information including:

  • Server details (name, version, uptime)
  • Active MCP sessions
  • Salesforce CLI version and org connection status
  • Available MCP tools and resources
  • Environment information
Priority Order

Configuration values are applied in the following priority order:

  1. CLI Arguments (highest priority)
  2. Environment Variables (medium priority)
  3. Defaults (lowest priority)
Examples
# CLI argument overrides environment variable
MCP_TRANSPORT=http test_research4 --transport stdio  # Result: stdio

# Environment variable when no CLI argument
MCP_TRANSPORT=http test_research4  # Result: http

# Default when no CLI or environment variable
test_research4  # Result: stdio

# Complex configuration
test_research4 --transport http --port 3001 --log-level debug --workspace /path/to/project

License

See the LICENSE file for details.