Skip to content

Commit 40cc528

Browse files
belaltaher8Copilot
andauthored
Clarify MCP server configuration instructions (#59412)
Co-authored-by: Copilot <[email protected]>
1 parent bef8231 commit 40cc528

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

content/copilot/how-tos/use-copilot-agents/coding-agent/extend-coding-agent-with-mcp.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Repository administrators can configure MCP servers by following these steps:
5050

5151
Your configuration will be validated to ensure proper syntax.
5252

53-
1. If your MCP server requires a key or secret, add a secret to your {% data variables.product.prodname_copilot_short %} environment. Only secrets with names prefixed with `COPILOT_MCP_` will be available to your MCP configuration. See [Setting up a {% data variables.product.prodname_copilot_short %} environment for {% data variables.copilot.copilot_coding_agent %}](#setting-up-a-copilot-environment-for-copilot-coding-agent).
53+
1. If your MCP server requires a variable, key, or secret, add a variable or secret to your {% data variables.product.prodname_copilot_short %} environment. Only variables and secrets with names prefixed with `COPILOT_MCP_` will be available to your MCP configuration. See [Setting up a {% data variables.product.prodname_copilot_short %} environment for {% data variables.copilot.copilot_coding_agent %}](#setting-up-a-copilot-environment-for-copilot-coding-agent).
5454

5555
## Writing a JSON configuration for MCP servers
5656

@@ -78,20 +78,23 @@ The configuration object can contain the following keys:
7878

7979
**Required keys for local and remote MCP servers**
8080
* `tools` (`string[]`): The tools from the MCP server to enable. You may be able to find a list of tools in the server's documentation, or in its code. We strongly recommend that you allowlist specific read-only tools, since the agent will be able to use these tools autonomously and will not ask you for approval first. You can also enable all tools by including `*` in the array.
81-
* `type` (`string`): {% data variables.copilot.copilot_coding_agent %} accepts `"local"`, `"http"`, or `"sse"`.
81+
* `type` (`string`): {% data variables.copilot.copilot_coding_agent %} accepts `"local"`, `"stdio"`, `"http"`, or `"sse"`.
8282

8383
**Local MCP specific keys**
8484
* `command` (`string`): Required. The command to run to start the MCP server.
8585
* `args` (`string[]`): Required. The arguments to pass to the `command`.
8686
* `env` (`object`): Optional. The environment variables to pass to the server. This object should map the name of the environment variable that should be exposed to your MCP server to either of the following:
87-
* The name of a {% data variables.product.prodname_actions %} secret you have configured, beginning with `COPILOT_MCP_`.
88-
* A string value.
87+
* The name of a secret you have configured in your {% data variables.product.prodname_copilot_short %} environment, beginning with `COPILOT_MCP_`.
88+
* The name of a variable you have configured in your {% data variables.product.prodname_copilot_short %} environment, beginning with `COPILOT_MCP_`.
8989

9090
**Remote MCP specific keys**
9191
* `url` (`string`): Required. The MCP server's URL.
9292
* `headers` (`object`): Optional. The headers to attach to requests to the server. This object should map the name of header keys to either of the following:
93-
* The name of a {% data variables.product.prodname_actions %} secret you have configured, beginning with `COPILOT_MCP_` preceded by a `$`
94-
* A string value
93+
* The name of a secret you have configured in your {% data variables.product.prodname_copilot_short %} environment, beginning with `COPILOT_MCP_` preceded by a `$`.
94+
* The name of a variable you have configured in your {% data variables.product.prodname_copilot_short %} environment, beginning with `COPILOT_MCP_` preceded by a `$`.
95+
* A string value.
96+
97+
Note that all `string` and `string[]` fields besides `tools` & `type` support substitution with a variable or secret you have configured in your {% data variables.product.prodname_copilot_short %} environment, beginning with `COPILOT_MCP_` preceded by a `$`.
9598

9699
## Example configurations
97100

@@ -111,10 +114,12 @@ The [Sentry MCP server](https://github.com/getsentry/sentry-mcp) gives {% data v
111114
"args": ["@sentry/mcp-server@latest", "--host=$SENTRY_HOST"],
112115
"tools": ["get_issue_details", "get_issue_summary"],
113116
"env": {
114-
// We can specify an environment variable value as a string...
115-
"SENTRY_HOST": "https://contoso.sentry.io",
116-
// or refer to a {% data variables.product.prodname_actions %} secret with a name starting with
117-
// `COPILOT_MCP_`
117+
// We can specify an environment variable value as
118+
// a variable in your {% data variables.product.prodname_copilot_short %} environment
119+
// where `COPILOT_MCP_SENTRY_HOST` = "https://contoso.sentry.io"...
120+
"SENTRY_HOST": "COPILOT_MCP_SENTRY_HOST",
121+
// or refer to a secret with a name starting with
122+
// `COPILOT_MCP_`.
118123
"SENTRY_ACCESS_TOKEN": "COPILOT_MCP_SENTRY_ACCESS_TOKEN"
119124
}
120125
}

0 commit comments

Comments
 (0)