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: src/core/prompts/__tests__/__snapshots__/system.test.ts.snap
+94-9Lines changed: 94 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -2827,7 +2827,10 @@ By waiting for and carefully considering the user's response after each tool use
2827
2827
2828
2828
MCP SERVERS
2829
2829
2830
-
The Model Context Protocol (MCP) enables communication between the system and locally running MCP servers that provide additional tools and resources to extend your capabilities.
2830
+
The Model Context Protocol (MCP) enables communication between the system and MCP servers that provide additional tools and resources to extend your capabilities. MCP servers can be one of two types:
2831
+
2832
+
1. Local (Stdio-based) servers: These run locally on the user's machine and communicate via standard input/output
2833
+
2. Remote (SSE-based) servers: These run on remote machines and communicate via Server-Sent Events (SSE) over HTTP/HTTPS
2831
2834
2832
2835
# Connected MCP Servers
2833
2836
@@ -2841,13 +2844,51 @@ The user may ask you something along the lines of "add a tool" that does some fu
2841
2844
2842
2845
When creating MCP servers, it's important to understand that they operate in a non-interactive environment. The server cannot initiate OAuth flows, open browser windows, or prompt for user input during runtime. All credentials and authentication tokens must be provided upfront through environment variables in the MCP settings configuration. For example, Spotify's API uses OAuth to get a refresh token for the user, but the MCP server cannot initiate this flow. While you can walk the user through obtaining an application client ID and secret, you may have to create a separate one-time setup script (like get-refresh-token.js) that captures and logs the final piece of the puzzle: the user's refresh token (i.e. you might run the script using execute_command which would open a browser for authentication, and then log the refresh token so that you can see it in the command output for you to use in the MCP settings configuration).
2843
2846
2844
-
Unless the user specifies otherwise, new MCP servers should be created in: /mock/mcp/path
2847
+
Unless the user specifies otherwise, new local MCP servers should be created in: /mock/mcp/path
2848
+
2849
+
### MCP Server Types and Configuration
2850
+
2851
+
MCP servers can be configured in two ways in the MCP settings file:
- \`disabled\`: (optional) Set to true to temporarily disable the server
2884
+
- \`timeout\`: (optional) Maximum time in seconds to wait for server responses (default: 60)
2885
+
- \`alwaysAllow\`: (optional) Array of tool names that don't require user confirmation
2845
2886
2846
-
### Example MCP Server
2887
+
### Example Local MCP Server
2847
2888
2848
2889
For example, if the user wanted to give you the ability to retrieve weather information, you could create an MCP server that uses the OpenWeather API to get weather information, add it to the MCP settings configuration file, and then notice that you now have access to new tools and resources in the system prompt that you might use to show the user your new capabilities.
2849
2890
2850
-
The following example demonstrates how to build an MCP server that provides weather data functionality. While this example shows how to implement resources, resource templates, and tools, in practice you should prefer using tools since they are more flexible and can handle dynamic parameters. The resource and resource template implementations are included here mainly for demonstration purposes of the different MCP capabilities, but a real weather server would likely just expose tools for fetching weather data. (The following steps are for macOS)
2891
+
The following example demonstrates how to build a local MCP server that provides weather data functionality using the Stdio transport. While this example shows how to implement resources, resource templates, and tools, in practice you should prefer using tools since they are more flexible and can handle dynamic parameters. The resource and resource template implementations are included here mainly for demonstration purposes of the different MCP capabilities, but a real weather server would likely just expose tools for fetching weather data. (The following steps are for macOS)
2851
2892
2852
2893
1. Use the \`create-typescript-server\` tool to bootstrap a new project in the default MCP servers directory:
2853
2894
@@ -4814,7 +4855,10 @@ By waiting for and carefully considering the user's response after each tool use
4814
4855
4815
4856
MCP SERVERS
4816
4857
4817
-
The Model Context Protocol (MCP) enables communication between the system and locally running MCP servers that provide additional tools and resources to extend your capabilities.
4858
+
The Model Context Protocol (MCP) enables communication between the system and MCP servers that provide additional tools and resources to extend your capabilities. MCP servers can be one of two types:
4859
+
4860
+
1. Local (Stdio-based) servers: These run locally on the user's machine and communicate via standard input/output
4861
+
2. Remote (SSE-based) servers: These run on remote machines and communicate via Server-Sent Events (SSE) over HTTP/HTTPS
4818
4862
4819
4863
# Connected MCP Servers
4820
4864
@@ -6025,7 +6069,10 @@ By waiting for and carefully considering the user's response after each tool use
6025
6069
6026
6070
MCP SERVERS
6027
6071
6028
-
The Model Context Protocol (MCP) enables communication between the system and locally running MCP servers that provide additional tools and resources to extend your capabilities.
6072
+
The Model Context Protocol (MCP) enables communication between the system and MCP servers that provide additional tools and resources to extend your capabilities. MCP servers can be one of two types:
6073
+
6074
+
1. Local (Stdio-based) servers: These run locally on the user's machine and communicate via standard input/output
6075
+
2. Remote (SSE-based) servers: These run on remote machines and communicate via Server-Sent Events (SSE) over HTTP/HTTPS
6029
6076
6030
6077
# Connected MCP Servers
6031
6078
@@ -6039,13 +6086,51 @@ The user may ask you something along the lines of "add a tool" that does some fu
6039
6086
6040
6087
When creating MCP servers, it's important to understand that they operate in a non-interactive environment. The server cannot initiate OAuth flows, open browser windows, or prompt for user input during runtime. All credentials and authentication tokens must be provided upfront through environment variables in the MCP settings configuration. For example, Spotify's API uses OAuth to get a refresh token for the user, but the MCP server cannot initiate this flow. While you can walk the user through obtaining an application client ID and secret, you may have to create a separate one-time setup script (like get-refresh-token.js) that captures and logs the final piece of the puzzle: the user's refresh token (i.e. you might run the script using execute_command which would open a browser for authentication, and then log the refresh token so that you can see it in the command output for you to use in the MCP settings configuration).
6041
6088
6042
-
Unless the user specifies otherwise, new MCP servers should be created in: /mock/mcp/path
6089
+
Unless the user specifies otherwise, new local MCP servers should be created in: /mock/mcp/path
6090
+
6091
+
### MCP Server Types and Configuration
6092
+
6093
+
MCP servers can be configured in two ways in the MCP settings file:
- \`disabled\`: (optional) Set to true to temporarily disable the server
6126
+
- \`timeout\`: (optional) Maximum time in seconds to wait for server responses (default: 60)
6127
+
- \`alwaysAllow\`: (optional) Array of tool names that don't require user confirmation
6043
6128
6044
-
### Example MCP Server
6129
+
### Example Local MCP Server
6045
6130
6046
6131
For example, if the user wanted to give you the ability to retrieve weather information, you could create an MCP server that uses the OpenWeather API to get weather information, add it to the MCP settings configuration file, and then notice that you now have access to new tools and resources in the system prompt that you might use to show the user your new capabilities.
6047
6132
6048
-
The following example demonstrates how to build an MCP server that provides weather data functionality. While this example shows how to implement resources, resource templates, and tools, in practice you should prefer using tools since they are more flexible and can handle dynamic parameters. The resource and resource template implementations are included here mainly for demonstration purposes of the different MCP capabilities, but a real weather server would likely just expose tools for fetching weather data. (The following steps are for macOS)
6133
+
The following example demonstrates how to build a local MCP server that provides weather data functionality using the Stdio transport. While this example shows how to implement resources, resource templates, and tools, in practice you should prefer using tools since they are more flexible and can handle dynamic parameters. The resource and resource template implementations are included here mainly for demonstration purposes of the different MCP capabilities, but a real weather server would likely just expose tools for fetching weather data. (The following steps are for macOS)
6049
6134
6050
6135
1. Use the \`create-typescript-server\` tool to bootstrap a new project in the default MCP servers directory:
0 commit comments