# GH-700: Connect MCP Tools with Scoped Credentials and Runtime Configuration

Choose an MCP integration, review server trust and credential reach, then connect only needed tools using Copilot CLI settings or GitHub Agentic Workflows configuration.

Author: LearningPathX Editorial Team
Content version: 1.0
Published: 2026-11-17T01:54:27.065141+00:00
HTML: https://learningpathx.com/guide/GH-700/gh-700-connect-mcp-tools-with-scoped-credentials-and-runtime-configuration.html

## GH-700: Connect MCP Tools with Scoped Credentials and Runtime Configuration

Use a Model Context Protocol (MCP) server when the task needs external information or actions that Copilot's existing tools do not provide. First identify that missing capability, review the server and credential scope, select only the required tools, and configure them for the actual runtime. GitHub Copilot CLI settings and GitHub Agentic Workflows configuration are separate contracts; a working local connection is not a workflow deployment recipe.

The procedure below separates integration selection from permission to act. A prompt can describe an intended action, but the configured tools, session permissions and service credentials determine whether it can happen. Product details reflect rolling official documentation checked on November 14, 2026; confirm the selected client, server and organization policy before implementing them.

## 1\. Define the missing capability before adding MCP tools

GitHub distinguishes guidance from capability: custom instructions and skills guide work, while tools let Copilot perform operations. MCP servers add access to external services. If built-in tools already answer the question, another server adds an unnecessary integration to maintain.

Consider an illustrative business task: prepare a weekly summary of unresolved support cases for one product. The team already keeps release decisions in its repository, but current support cases live in a separate service. MCP is a candidate for retrieving those cases. It is unnecessary merely to reformat a supplied, approved case export.

Record three selection criteria before choosing a server:

* The missing input: approved case fields for the selected product and reporting period.
* The permitted operation: retrieve cases and draft a summary for an owner to review.
* The excluded effects: change case status, contact customers or update another product's records.

Enforce these criteria through the selected tools and service permissions. If the available integration cannot separate the required reads from unacceptable access, change the integration design before connecting it.

## 2\. Review the server and the reach of its credentials

Treat the server as a component with its own operator, executable or endpoint, authentication and accessible resources. The gh-aw security architecture explicitly treats externally issued tokens as capabilities: configuration determines which components receive them, while overly broad credentials can permit unintended external effects.

For the support-summary example, ask the integration owner to identify the service account, permitted product or tenant, readable fields and allowed operations. Prefer credentials restricted by the service to the approved reporting scope. If such restrictions are unavailable, record the broader access and obtain a decision from the responsible owner before proceeding. A friendly tool name is insufficient evidence of limited authority.

This boundary matters even in repository-scoped automation. GitHub's Copilot automations documentation says that external MCP tools can access whatever their server configuration and credentials permit, including other repositories and services. Do not infer repository-only reach from the repository where an agent starts. That documented automation behavior is a warning to inspect each integration's real scope, not a claim that every client has identical controls.

Keep credential values out of prompts, committed configuration and review records. For GitHub Actions, use the supported secrets mechanism rather than embedding values in workflow source; review which repositories can access organization secrets. The external service's permissions still determine what the credential can do.

## 3\. Select the transport and execution location

For Copilot CLI, the documented transport choices have different operational dependencies:

| CLI transport | Connection model | Review before configuration |
| --- | --- | --- |
| STDIO | The CLI starts a local process and communicates through standard input and output. | The executable, arguments and required local runtime. |
| HTTP | Connects to a remote server using Streamable HTTP. | The endpoint, service operator and authentication requirements. |
| SSE | Uses the legacy HTTP with Server-Sent Events transport, retained for compatibility. | Whether the selected server actually requires this deprecated transport. |

Choose from the server's supported connection methods. A remote connection removes the local server-launch step; it does not remove server trust or credential review. A local process also needs review before launch, rather than being trusted solely because it runs on the same computer.

## 4\. Configure and inspect the Copilot CLI connection

Use an authorized Copilot CLI session and confirm applicable organization or enterprise MCP policy. Where a server allowlist is configured, only permitted servers can run.

1. Open the interactive MCP dashboard with `/mcp`, then choose its add action.
2. Enter a unique server name and select the transport reviewed above.
3. Supply the approved local command and arguments, or the approved remote endpoint, along with the required environment variables or headers.
4. Set the Tools field to the exact needed tool names. Its default `*` exposes all tools, so leaving that default is not a restrictive choice.
5. Save with Ctrl+S. Saving makes the server available immediately; complete trust and credential review beforehand.

The CLI command reference identifies persistent user configuration at `~/.copilot/mcp-config.json` and a separate option for session-only additions. Inspect the active connection through the MCP dashboard, including its status and available tools. MCP calls remain subject to session permission rules; even external reads can require approval. Availability and execution approval are separate checks.

For the example, select only documented tools that retrieve the approved cases. Do not invent a tool name from the business task, and do not enable every tool simply to make discovery easier. Confirm the names and input schema against the selected server's documentation and observed tool listing before an authorized trial.

## 5\. Rebuild the integration for GitHub Agentic Workflows

GitHub Agentic Workflows, also called gh-aw, runs through GitHub Actions. Its source is Markdown in `.github/workflows/`, combining YAML frontmatter with natural-language instructions; compilation produces a `.lock.yml` file. The documented authoring lifecycle retains both source and compiled output.

The workflow frontmatter's `tools` field selects available capabilities, including MCP servers. Network access is configured separately through `network`. Use the compiler-supported tools configuration for the selected integration. Do not paste a local CLI `mcpServers` JSON object into workflow frontmatter or assume a developer's home-directory configuration will be present on an Actions runner.

Use this integration handoff before the separate workflow-authoring procedure:

1. Name the intended engine, runner environment and supported MCP integration.
2. Map the approved tool selection and credential delivery to the workflow's documented schema.
3. Review necessary network access independently of service authorization.
4. Compile and inspect the generated workflow, including which components receive credentials.

If the integration's workflow configuration is not documented or the compiler rejects it, stop and resolve compatibility. Broadening permissions is not a substitute for matching the runtime schema. Verify server-specific fields and credential wiring against the chosen integration's documentation before authoring its configuration.

The gh-aw architecture combines configuration checks, runtime isolation, tool filtering and permission separation. Its compiler validates configuration, but successful compilation does not prove the business task is authorized or that runtime behavior is correct. Retain review of the server and its external capabilities.

## 6\. Verify the bounded outcome before wider use

The following acceptance criteria are editorial recommendations for the support-summary design, not results of an executed installation or test:

* The intended runtime shows the approved server and required retrieval tools.
* The connection uses the intended identity and approved resource scope.
* An authorized limited trial retrieves the expected product and period, and the owner compares the draft with those records.
* Missing access or an unavailable tool produces a visible exception instead of a fabricated summary.
* Customer communication and case updates remain outside the task's enabled operations.

Record evidence without exposing tokens or sensitive case contents. A connected status establishes a connection; it does not establish complete retrieval or a correct report. If a check fails, retain the diagnostic and return to the specific server, identity, tool or runtime decision before expanding use.

The resulting handoff should let another owner explain why MCP is needed, what the integration can reach, which tools are available and where its configuration belongs. That is the basis for a reviewable workflow implementation.

## Authoritative Sources

* [Comparing Copilot customization features](https://docs.github.com/en/copilot/concepts/customizations/comparing-customizations) — guidance, tools and MCP selection.
* [Adding MCP servers for GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers) — transports, interactive setup, tool selection and policy.
* [GitHub Copilot CLI command reference](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference) — configuration scope, server inspection and session permission rules.
* [Copilot automations](https://docs.github.com/en/copilot/concepts/agent-capabilities/agent-powered-workflows-and-operations/about-automations) — external MCP credential reach.
* [Using secrets in GitHub Actions](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets) — secret delivery and organization access policies.
* [Creating GitHub Agentic Workflows](https://docs.github.com/en/copilot/how-tos/github-agentic-workflows/creating-github-agentic-workflows) — source and compiled workflow lifecycle.
* [Frontmatter](https://github.github.com/gh-aw/reference/frontmatter/) — workflow tools and network configuration fields.
* [Security Architecture](https://github.github.com/gh-aw/introduction/architecture/) — token capabilities, configuration trust, isolation and compiler limits.

## Related Reading

* Prerequisite: [GH-700: Apply Governance Controls to Copilot Business Work](https://learningpathx.com/guide/gh-700/gh-700-apply-governance-controls-to-copilot-business-work.html)
* Prerequisite: [GH-700: Create Custom Agents with Explicit Roles and Tools](https://learningpathx.com/guide/gh-700/gh-700-create-custom-agents-with-explicit-roles-and-tools.html)
* Next: [GH-700: Author and Compile GitHub Agentic Workflows](https://learningpathx.com/guide/gh-700/gh-700-author-and-compile-github-agentic-workflows.html)
