You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: package.json
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,16 @@
46
46
"activationEvents": [],
47
47
"main": "./dist/extension.js",
48
48
"contributes": {
49
+
"configuration": {
50
+
"title": "Cline",
51
+
"properties": {
52
+
"cline.mcp.includeInPrompt": {
53
+
"type": "boolean",
54
+
"default": true,
55
+
"description": "Include MCP server functionality in AI prompts. When disabled, the AI will not be aware of MCP capabilities. This saves context window tokens."
Copy file name to clipboardExpand all lines: src/core/prompts/system.ts
+57-29Lines changed: 57 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -177,6 +177,9 @@ Usage:
177
177
: ""
178
178
}
179
179
180
+
${
181
+
mcpHub.shouldIncludeInPrompt()
182
+
? `
180
183
## use_mcp_tool
181
184
Description: Request to use a tool provided by a connected MCP server. Each MCP server can provide multiple tools with different capabilities. Tools have defined input schemas that specify required and optional parameters.
182
185
Parameters:
@@ -205,6 +208,9 @@ Usage:
205
208
<server_name>server name here</server_name>
206
209
<uri>resource URI here</uri>
207
210
</access_mcp_resource>
211
+
`
212
+
: ""
213
+
}
208
214
209
215
## ask_followup_question
210
216
Description: Ask the user a question to gather additional information needed to complete the task. This tool should be used when you encounter ambiguities, need clarification, or require more details to proceed effectively. It allows for interactive problem-solving by enabling direct communication with the user. Use this tool judiciously to maintain a balance between gathering necessary information and avoiding excessive back-and-forth.
@@ -238,27 +244,7 @@ Your final result description here
238
244
<requires_approval>false</requires_approval>
239
245
</execute_command>
240
246
241
-
## Example 2: Requesting to use an MCP tool
242
-
243
-
<use_mcp_tool>
244
-
<server_name>weather-server</server_name>
245
-
<tool_name>get_forecast</tool_name>
246
-
<arguments>
247
-
{
248
-
"city": "San Francisco",
249
-
"days": 5
250
-
}
251
-
</arguments>
252
-
</use_mcp_tool>
253
-
254
-
## Example 3: Requesting to access an MCP resource
255
-
256
-
<access_mcp_resource>
257
-
<server_name>weather-server</server_name>
258
-
<uri>weather://san-francisco/current</uri>
259
-
</access_mcp_resource>
260
-
261
-
## Example 4: Requesting to create a new file
247
+
## Example 2: Requesting to create a new file
262
248
263
249
<write_to_file>
264
250
<path>src/frontend-config.json</path>
@@ -280,7 +266,7 @@ Your final result description here
280
266
</content>
281
267
</write_to_file>
282
268
283
-
## Example 6: Requesting to make targeted edits to a file
269
+
## Example 3: Requesting to make targeted edits to a file
284
270
285
271
<replace_in_file>
286
272
<path>src/components/App.tsx</path>
@@ -314,6 +300,31 @@ return (
314
300
>>>>>>> REPLACE
315
301
</diff>
316
302
</replace_in_file>
303
+
${
304
+
mcpHub.shouldIncludeInPrompt()
305
+
? `
306
+
307
+
## Example 4: Requesting to use an MCP tool
308
+
309
+
<use_mcp_tool>
310
+
<server_name>weather-server</server_name>
311
+
<tool_name>get_forecast</tool_name>
312
+
<arguments>
313
+
{
314
+
"city": "San Francisco",
315
+
"days": 5
316
+
}
317
+
</arguments>
318
+
</use_mcp_tool>
319
+
320
+
## Example 5: Requesting to access an MCP resource
321
+
322
+
<access_mcp_resource>
323
+
<server_name>weather-server</server_name>
324
+
<uri>weather://san-francisco/current</uri>
325
+
</access_mcp_resource>`
326
+
: ""
327
+
}
317
328
318
329
# Tool Use Guidelines
319
330
@@ -336,6 +347,9 @@ It is crucial to proceed step-by-step, waiting for the user's message after each
336
347
337
348
By waiting for and carefully considering the user's response after each tool use, you can react accordingly and make informed decisions about how to proceed with the task. This iterative process helps ensure the overall success and accuracy of your work.
338
349
350
+
${
351
+
mcpHub.shouldIncludeInPrompt()
352
+
? `
339
353
====
340
354
341
355
MCP SERVERS
@@ -727,11 +741,11 @@ npm run build
727
741
## Editing MCP Servers
728
742
729
743
The user may ask to add tools or resources that may make sense to add to an existing MCP server (listed under 'Connected MCP Servers' above: ${
730
-
mcpHub
731
-
.getServers()
732
-
.map((server)=>server.name)
733
-
.join(", ")||"(None running currently)"
734
-
}, e.g. if it would use the same API. This would be possible if you can locate the MCP server repository on the user's system by looking at the server arguments for a filepath. You might then use list_files and read_file to explore the files in the repository, and use replace_in_file to make changes to the files.
744
+
mcpHub
745
+
.getServers()
746
+
.map((server)=>server.name)
747
+
.join(", ")||"(None running currently)"
748
+
}, e.g. if it would use the same API. This would be possible if you can locate the MCP server repository on the user's system by looking at the server arguments for a filepath. You might then use list_files and read_file to explore the files in the repository, and use replace_in_file to make changes to the files.
735
749
736
750
However some MCP servers may be running from installed packages rather than a local repository, in which case it may make more sense to create a new MCP server.
737
751
@@ -740,7 +754,9 @@ However some MCP servers may be running from installed packages rather than a lo
740
754
The user may not always request the use or creation of MCP servers. Instead, they might provide tasks that can be completed with existing tools. While using the MCP SDK to extend your capabilities can be useful, it's important to understand that this is just one specialized type of task you can accomplish. You should only implement MCP servers when the user explicitly requests it (e.g., "add a tool that...").
741
755
742
756
Remember: The MCP documentation and example provided above are to help you understand and work with existing MCP servers or create new ones when requested by the user. You already have access to tools and capabilities that can be used to accomplish a wide range of tasks.
743
-
757
+
`
758
+
: ""
759
+
}
744
760
====
745
761
746
762
EDITING FILES
@@ -832,7 +848,13 @@ CAPABILITIES
832
848
? "\n- You can use the browser_action tool to interact with websites (including html files and locally running development servers) through a Puppeteer-controlled browser when you feel it is necessary in accomplishing the user's task. This tool is particularly useful for web development tasks as it allows you to launch a browser, navigate to pages, interact with elements through clicks and keyboard input, and capture the results through screenshots and console logs. This tool may be useful at key stages of web development tasks-such as after implementing new features, making substantial changes, when troubleshooting issues, or to verify the result of your work. You can analyze the provided screenshots to ensure correct rendering or identify errors, and review console logs for runtime issues.\n - For example, if asked to add a component to a react website, you might create the necessary files, use execute_command to run the site locally, then use browser_action to launch the browser, navigate to the local server, and verify the component renders & functions correctly before closing the browser."
833
849
: ""
834
850
}
851
+
${
852
+
mcpHub.shouldIncludeInPrompt()
853
+
? `
835
854
- You have access to MCP servers that may provide additional tools and resources. Each server may provide different capabilities that you can use to accomplish tasks more effectively.
855
+
`
856
+
: ""
857
+
}
836
858
837
859
====
838
860
@@ -861,14 +883,20 @@ RULES
861
883
- When presented with images, utilize your vision capabilities to thoroughly examine them and extract meaningful information. Incorporate these insights into your thought process as you accomplish the user's task.
862
884
- At the end of each user message, you will automatically receive environment_details. This information is not written by the user themselves, but is auto-generated to provide potentially relevant context about the project structure and environment. While this information can be valuable for understanding the project context, do not treat it as a direct part of the user's request or response. Use it to inform your actions and decisions, but don't assume the user is explicitly asking about or referring to this information unless they clearly do so in their message. When using environment_details, explain your actions clearly to ensure the user understands, as they may not be aware of these details.
863
885
- Before executing commands, check the "Actively Running Terminals" section in environment_details. If present, consider how these active processes might impact your task. For example, if a local development server is already running, you wouldn't need to start it again. If no active terminals are listed, proceed with command execution as normal.
864
-
- MCP operations should be used one at a time, similar to other tool usage. Wait for confirmation of success before proceeding with additional operations.
865
886
- When using the replace_in_file tool, you must include complete lines in your SEARCH blocks, not partial lines. The system requires exact line matches and cannot match partial lines. For example, if you want to match a line containing "const x = 5;", your SEARCH block must include the entire line, not just "x = 5" or other fragments.
866
887
- When using the replace_in_file tool, if you use multiple SEARCH/REPLACE blocks, list them in the order they appear in the file. For example if you need to make changes to both line 10 and line 50, first include the SEARCH/REPLACE block for line 10, followed by the SEARCH/REPLACE block for line 50.
867
888
- It is critical you wait for the user's response after each tool use, in order to confirm the success of the tool use. For example, if asked to make a todo app, you would create a file, wait for the user's response it was created successfully, then create another file if needed, wait for the user's response it was created successfully, etc.${
868
889
supportsComputerUse
869
890
? " Then if you want to test your work, you might use browser_action to launch the site, wait for the user's response confirming the site was launched along with a screenshot, then perhaps e.g., click a button to test functionality if needed, wait for the user's response confirming the button was clicked along with a screenshot of the new state, before finally closing the browser."
870
891
: ""
871
892
}
893
+
${
894
+
mcpHub.shouldIncludeInPrompt()
895
+
? `
896
+
- MCP operations should be used one at a time, similar to other tool usage. Wait for confirmation of success before proceeding with additional operations.
0 commit comments