configuring-mcp-servers.mdx 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. ---
  2. title: "Configuring MCP Servers"
  3. ---
  4. ## Global MCP Server Inclusion Mode
  5. Utilizing MCP servers will increase your token usage. Cline offers the ability to restrict or disable MCP server functionality as desired.
  6. 1. Click the "MCP Servers" icon in the top navigation bar of the Cline extension.
  7. 2. Select the "Configure" tab, and then Click the "Advanced MCP Settings" link at the bottom of that pane.
  8. 3. Cline will open a new settings window. find `Cline>Mcp:Mode` and make your selection from the dropdown menu.
  9. <Frame>
  10. <img
  11. src="https://storage.googleapis.com/cline_public_images/docs/assets/MCP-settings-edit%20(1).png"
  12. alt="MCP settings edit"
  13. />
  14. </Frame>
  15. ## Managing Individual MCP Servers
  16. Each MCP server has its own configuration panel where you can modify settings, manage tools, and control its operation. To access these settings:
  17. 1. Click the "MCP Servers" icon in the top navigation bar of the Cline extension.
  18. 2. Locate the MCP server you want to manage in the list, and open it by clicking on its name.
  19. <Frame>
  20. <img
  21. src="https://storage.googleapis.com/cline_public_images/docs/assets/MCP-settings-individual.png"
  22. alt="MCP settings individual"
  23. />
  24. </Frame>
  25. ### Deleting a Server
  26. 1. Click the Trash icon next to the MCP server you would like to delete, or the red Delete Server button at the bottom of the MCP server config box.
  27. **NOTE:** There is no delete confirmation dialog box
  28. ### Restarting a Server
  29. 1. Click the Restart button next to the MCP server you would like to restart, or the gray Restart Server button at the bottom of the MCP server config box.
  30. ### Enabling or Disabling a Server
  31. 1. Click the toggle switch next to the MCP server to enable/disable servers individually.
  32. ### Network Timeout
  33. To set the maximum time to wait for a response after a tool call to the MCP server:
  34. 1. Click the `Network Timeout` dropdown at the bottom of the individual MCP server's config box and change the time. Default is 1 minute but it can be set between 30 seconds and 1 hour.
  35. ## Editing MCP Settings Files
  36. Settings for all installed MCP servers are located in the `cline_mcp_settings.json` file:
  37. 1. Click the MCP Servers icon at the top navigation bar of the Cline pane.
  38. 2. Select the "Configure" tab.
  39. 3. Click the "Configure MCP Servers" button at the bottom of the pane.
  40. The file uses a JSON format with a `mcpServers` object containing named server configurations:
  41. ```json
  42. {
  43. "mcpServers": {
  44. "server1": {
  45. "command": "python",
  46. "args": ["/path/to/server.py"],
  47. "env": {
  48. "API_KEY": "your_api_key"
  49. },
  50. "alwaysAllow": ["tool1", "tool2"],
  51. "disabled": false
  52. }
  53. }
  54. }
  55. ```
  56. _Example of MCP Server config in Cline (STDIO Transport)_
  57. ---
  58. ## Understanding Transport Types
  59. MCP supports two transport types for server communication:
  60. ### STDIO Transport
  61. Used for local servers running on your machine:
  62. - Communicates via standard input/output streams
  63. - Lower latency (no network overhead)
  64. - Better security (no network exposure)
  65. - Simpler setup (no HTTP server needed)
  66. - Runs as a child process on your machine
  67. For more in-depth information about how STDIO transport works, see [MCP Transport Mechanisms](/mcp/mcp-transport-mechanisms).
  68. STDIO configuration example:
  69. ```json
  70. {
  71. "mcpServers": {
  72. "local-server": {
  73. "command": "node",
  74. "args": ["/path/to/server.js"],
  75. "env": {
  76. "API_KEY": "your_api_key"
  77. },
  78. "alwaysAllow": ["tool1", "tool2"],
  79. "disabled": false
  80. }
  81. }
  82. }
  83. ```
  84. ### SSE Transport
  85. Used for remote servers accessed over HTTP/HTTPS:
  86. - Communicates via Server-Sent Events protocol
  87. - Can be hosted on a different machine
  88. - Supports multiple client connections
  89. - Requires network access
  90. - Allows centralized deployment and management
  91. For more in-depth information about how SSE transport works, see [MCP Transport Mechanisms](/mcp/mcp-transport-mechanisms).
  92. SSE configuration example:
  93. ```json
  94. {
  95. "mcpServers": {
  96. "remote-server": {
  97. "url": "https://your-server-url.com/mcp",
  98. "headers": {
  99. "Authorization": "Bearer your-token"
  100. },
  101. "alwaysAllow": ["tool3"],
  102. "disabled": false
  103. }
  104. }
  105. }
  106. ```
  107. ---
  108. ## Using MCP Tools in Your Workflow
  109. After configuring an MCP server, Cline will automatically detect available tools and resources. To use them:
  110. 1. Type your request in Cline's conversation window
  111. 2. Cline will identify when an MCP tool can help with your task
  112. 3. Approve the tool use when prompted (or use auto-approval)
  113. Example: "Analyze the performance of my API" might use an MCP tool that tests API endpoints.
  114. ## Troubleshooting MCP Servers
  115. Common issues and solutions:
  116. - **Server Not Responding:** Check if the server process is running and verify network connectivity
  117. - **Permission Errors:** Ensure proper API keys and credentials are configured in your `mcp_settings.json` file
  118. - **Tool Not Available:** Confirm the server is properly implementing the tool and it's not disabled in settings
  119. - **Slow Performance:** Try adjusting the network timeout value for the specific MCP server