Skip to content

Commit 9ab6fdb

Browse files
Add Claude Code Client MCP configuration example (.mcp.json) (#285)
* Add Claude Code Client MCP configuration example for `.mcp.json` * Enhance README with MCP Server configuration examples Added examples and details for configuring Salesforce DX MCP Server with various clients, including VSCode, Claude Code, Cursor, and Cline. Updated reference sections for available flags and MCP client configurations. * Update README links to use relative paths --------- Co-authored-by: Juliet Shackell <63259011+jshackell-sfdc@users.noreply.github.com>
1 parent a2a4632 commit 9ab6fdb

File tree

1 file changed

+79
-8
lines changed

1 file changed

+79
-8
lines changed

README.md

Lines changed: 79 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The Salesforce DX MCP Server is a specialized Model Context Protocol (MCP) imple
2929
3030
## Configure the DX MCP Server
3131

32-
Configure the Salesforce DX MCP Server for your MCP client by updating its associated MCP JSON file; each client is slightly different, so check your MCP client documentation for details.
32+
Configure the Salesforce DX MCP Server for your MCP client by updating its associated MCP JSON file; each client is slightly different, so check your MCP client documentation for details. See [MCP Client Configurations](./README.md#mcp-client-configurations) for more examples.
3333

3434
Here's an example for VS Code with Copilot in which you create and update a `.vscode/mcp.json` file in your project:
3535

@@ -39,32 +39,103 @@ Here's an example for VS Code with Copilot in which you create and update a `.vs
3939
"Salesforce DX": {
4040
"command": "npx",
4141
"args": ["-y", "@salesforce/mcp",
42-
"--orgs", "DEFAULT_TARGET_ORG",
43-
"--toolsets", "orgs,metadata,data,users",
44-
"--tools", "run_apex_test",
45-
"--allow-non-ga-tools"]
42+
"--orgs", "DEFAULT_TARGET_ORG",
43+
"--toolsets", "orgs,metadata,data,users",
44+
"--tools", "run_apex_test",
45+
"--allow-non-ga-tools"]
4646
}
4747
}
4848
}
4949
```
50+
5051
The `args` format shown in the preceding example is the same for all MCP clients; it's how you customize the DX MCP Server for your particular environment. Notes:
5152

5253
- The `"-y", "@salesforce/mcp"` part tells `npx` to automatically install the `@salesforce/mcp` package instead of asking permission. Don't change this.
5354
- See the *Reference* sections below for the possible flags you can pass the `args` option, and possible values you can pass to the `--orgs`, `--toolsets`, and `--tools` flags.
5455
- When writing the `args` option, surround both the flag names and their values in double quotes, and separate all flags and values with commas. Some flags are Boolean and don't take a value.
5556
- The preceding example shows three flags that take a string value (`--orgs`, `--toolsets`, and `--tools`) and one Boolean flag (`--allow-non-ga-tools`). This configuration starts a DX MCP Server that enables all the MCP tools in the `orgs`, `metadata`, `data`, and `users` toolsets and a specific tool called `run_apex_tests`. It also enables tools in these configured toolsets that aren't yet generally available.
5657

58+
<details>
59+
<summary>Reference: MCP Client Configurations</summary>
60+
61+
## MCP Client Configurations
62+
63+
Here are examples of configuring the Salesforce DX MCP Server in various MCP clients.
64+
65+
### Claude Code
66+
67+
To configure [Claude Code](https://www.claude.com/product/claude-code) to work with Salesforce DX MCP Server, add this snippet to the `.mcp.json` file in your project:
68+
```
69+
{
70+
"mcpServers": {
71+
"Salesforce DX": {
72+
"command": "npx",
73+
"args": ["-y", "@salesforce/mcp",
74+
"--orgs", "DEFAULT_TARGET_ORG",
75+
"--toolsets", "orgs,metadata,data,users",
76+
"--tools", "run_apex_test",
77+
"--allow-non-ga-tools" ]
78+
}
79+
}
80+
}
81+
```
82+
### Cursor
83+
84+
To configure [Cursor](https://cursor.com/docs/context/mcp) to work with Salesforce DX MCP Server, add this snippet to your Cursor `mcp.json` file:
85+
86+
```json
87+
{
88+
"mcpServers": {
89+
"Salesforce DX": {
90+
"command": "npx",
91+
"args": ["-y", "@salesforce/mcp@latest",
92+
"--orgs", "DEFAULT_TARGET_ORG",
93+
"--toolsets", "orgs,metadata,data,users",
94+
"--tools", "run_apex_test",
95+
"--allow-non-ga-tools" ]
96+
}
97+
}
98+
}
99+
```
100+
101+
### Cline
102+
103+
To configure [Cline](https://docs.cline.bot/mcp/mcp-overview) to work with Salesforce DX MCP Server, add this snippet to your Cline `cline_mcp_settings.json` file:
104+
```json
105+
{
106+
"mcpServers": {
107+
"Salesforce DX": {
108+
"command": "npx",
109+
"args": ["-y", "@salesforce/mcp@latest",
110+
"--orgs", "DEFAULT_TARGET_ORG",
111+
"--toolsets", "orgs,metadata,data,users",
112+
"--tools", "run_apex_test",
113+
"--allow-non-ga-tools" ]
114+
}
115+
}
116+
}
117+
```
118+
119+
### Other MCP Clients
120+
121+
For these other clients, refer to their documentation for adding MCP servers and follow the same pattern as in the preceding examples to configure the Salesforce DX MCP Server:
122+
123+
- [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp)
124+
- [Zed](https://github.com/zed-industries/zed)
125+
- [Trae](https://docs.trae.ai/ide/model-context-protocol?_lang=en)
126+
127+
</details>
57128
<details>
58129
<summary>Reference: Available Flags for the `args` Option</summary>
59130

60-
## Reference: Available Flags for the "args" Option
131+
## Available Flags for the "args" Option
61132

62133
These are the flags that you can pass to the `args` option.
63134

64135
| Flag Name | Description | Required? |Notes |
65136
| -----------------| -------| ------- | ----- |
66-
| `--orgs` | One or more orgs that you've locally authorized. | Yes | You must specify at least one org. <br/> <br/>See [Configure Orgs](README.md#configure-orgs) for the values you can pass to this flag. |
67-
| `--toolsets` | Sets of tools, based on functionality, that you want to enable. | No | Set to "all" to enable every tool in every toolset. <br/> <br/>See [Configure Toolsets](README.md#configure-toolsets) for the values you can pass to this flag.|
137+
| `--orgs` | One or more orgs that you've locally authorized. | Yes | You must specify at least one org. <br/> <br/>See [Configure Orgs](./README.md#configure-orgs) for the values you can pass to this flag. |
138+
| `--toolsets` | Sets of tools, based on functionality, that you want to enable. | No | Set to "all" to enable every tool in every toolset. <br/> <br/>See [Configure Toolsets](./README.md#configure-toolsets) for the values you can pass to this flag.|
68139
| `--tools` | Individual tool names that you want to enable. | No | You can use this flag in combination with the `--toolsets` flag. For example, you can enable all tools in one toolset, and just one tool in a different toolset. |
69140
| `--no-telemetry` | Boolean flag to disable telemetry, the automatic collection of data for monitoring and analysis. | No | Telemetry is enabled by default, so specify this flag to disable it. |
70141
| `--debug` | Boolean flag that requests that the DX MCP Server print debug logs. | No | Debug mode is disabled by default. <br/> <br/>**NOTE:** Not all MCP clients expose MCP logs, so this flag might not work for all IDEs. |

0 commit comments

Comments
 (0)