GitHub Stars
133
User Rating
Not Rated
Favorites
0
Views
7
Forks
36
Issues
25
Installation
Difficulty
IntermediateEstimated Time
10-20 minutes
Requirements
Node.js: 18.0.0以上
npm: 8.0.0以上
+1 more
Installation
Installation
Prerequisites
Node.js: 18.0.0 or higher
npm: 8.0.0 or higher
Claude Desktop: Latest version
Installation Steps
1. Clone Repository
bash
git clone https://github.com/salesforcecli/mcp.git
cd mcp
2. Install Dependencies
bash
npm install
3. Configure Claude Desktop
Editclaude_desktop_config.json
to add the MCP server:
json
{
"mcpServers": {
"server-name": {
"command": "node",
"args": ["path/to/server.js"]
}
}
}
4. Start Server
bash
npm start
Troubleshooting
Common Issues
Issue: Server won't start Solution: Check Node.js version and reinstall dependencies. Issue: Not recognized by Claude Desktop Solution: Verify configuration file path and syntax.Configuration
Configuration
Basic Configuration
Claude Desktop Setup
Edit~/.config/claude-desktop/claude_desktop_config.json
(macOS/Linux) or
%APPDATA%\Claude\claude_desktop_config.json
(Windows):
json
{
"mcpServers": {
"tool-name": {
"command": "npx",
"args": ["-y", "package-name"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
Environment Variables
Set the following environment variables as needed:bash
export API_KEY="your-api-key"
export DEBUG="true"
Configuration Examples
Basic Configuration
json
{
"mcpServers": {
"example-mcp": {
"command": "node",
"args": ["server.js"],
"env": {
"PORT": "3000",
"LOG_LEVEL": "info"
}
}
}
}
Examples
Examples
Basic Usage
Here are basic usage examples for the MCP server:Using with Claude Desktop
1Verify MCP Server Startup
Open Claude Desktop and confirm that the configuration has been loaded correctly.
2Execute Basic Commands
Available tools from this MCP server:
- tool1: Description of tool1
- tool2: Description of tool2
Programmatic Usage
javascript
// JavaScript example (Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');
const client = new MCPClient();
await client.connect();
// Execute tool
const result = await client.callTool('toolName', {
parameter1: 'value1',
parameter2: 'value2'
});
console.log(result);
Advanced Examples
Automation Script
bash
#!/bin/bash
Batch processing example
for file in *.txt; do
mcp-tool process "$file"
done
Use Cases
Execute commands to list authorized Salesforce orgs.
Use tools to view Salesforce records.
Run natural language commands to deploy or retrieve metadata.
Create automation scripts to batch process multiple Salesforce resources.
Additional Resources
Author Information
The Salesforce CLI is a powerful command line interface that simplifies development and build automation when working with your Salesforce org.
157
Followers
67
Repositories
0
Gists
0
Total Contributions