AI & Agents

How to Configure and Use MCP Servers in GitHub Copilot

Integrating the Model Context Protocol (MCP) with GitHub Copilot allows developers to connect their AI assistant directly to external tools, databases, and APIs. This guide explains how to establish workspace settings in VS Code, manage repository settings on GitHub.com, and securely route persistent files through Fastio workspaces.

Fast.io Editorial Team 8 min read
Diagram of a developer workflow connecting GitHub Copilot to a remote Model Context Protocol server and workspace database.

Why AI Code Assistants Need Context

A coding assistant confined to the local filesystem will inevitably lose context during multi-session workflows or database-driven operations. The limitation is not the model’s reasoning capability, but the boundaries of the local IDE environment. Model Context Protocol (MCP) integration in GitHub Copilot resolves this by directly linking your editor assistant to external database schemas, APIs, and cloud workspaces like Fastio.

This integration is critical for teams working on complex repositories. Without external context, an assistant cannot verify database queries, check third-party API payloads, or access documentation stored in cloud environments. It is forced to make assumptions, leading to syntax errors and integration failures. The Model Context Protocol provides a standard way to expose these external resources to the model, turning a local code completion tool into an active participant in your team's development stack.

GitHub Copilot supports MCP in VS Code and repository settings. The protocol is now generally available for Copilot Pro, Business, and Enterprise users. This update allows developers to configure custom MCP servers that connect their AI assistant to external tools, databases, and APIs directly from the Copilot Chat interface. By defining local or remote servers, teams can build customized developer environments where Copilot accesses real-time data and specialized toolsets.

To use these capabilities, developers must configure the integration within their local workspace or through organization-level repository settings. Doing so enables Copilot to query databases, call external APIs, and read documentation dynamically as you write code. Establishing this persistent context layer ensures that Copilot remains aligned with your team's code standards and development progress.

How to Configure a GitHub Copilot MCP Server Locally in VS Code

Local configuration is the fast way to extend GitHub Copilot for a single user or a specific workspace. In VS Code, Copilot reads server definitions from a dedicated JSON configuration file. This allows developers to run command-line tools or connect to local scripts that communicate with the assistant.

To configure a custom MCP server in your local editor, you must define the server in a file named mcp.json inside the .vscode directory at the root of your project. Alternatively, you can configure global servers that persist across all projects by running a command in your editor.

Here is the step-by-step procedure to add a custom server:

  1. Create a directory named .vscode at the root of your repository if it does not already exist.

  2. In the .vscode folder, create a file named mcp.json.

  3. Add your JSON configuration to specify the execution command, arguments, and environment variables.

  4. Open the Command Palette using Cmd+Shift+P on macOS or Ctrl+Shift+P on Windows.

  5. Run the command MCP: Open User Configuration or MCP: List Servers to verify that the editor detects your configuration.

  6. Switch the Copilot Chat panel mode dropdown to Agent mode.

  7. Approve the prompt asking you to trust the new server.

Once trusted, the tools exposed by your custom server will be visible in the tool picker. The following JSON example illustrates a workspace-level configuration that runs a local node process or commands via npx:

{
  "servers": {
    "fastio-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@fastio/mcp-server"
      ],
      "env": {
        "FASTIO_API_KEY": "your_api_key_here"
      }
    }
  }
}

VS Code runs these servers as background processes. The editor communicates with the server using standard input and output streams. When you ask a question in Copilot Chat that requires external data, the assistant executes the corresponding tool and returns the response. This setup is ideal for local automation, database query validation, and accessing local documentation directories. You can manage multiple servers in the same file, giving Copilot access to different tools based on the active project.

Configuring MCP at the Repository Level on GitHub.com

For teams and organizations, configuring MCP servers locally for every developer is inefficient. GitHub Copilot allows administrators to define MCP servers at the repository level on GitHub.com. This configuration is shared across the Copilot cloud agent and Copilot code review features, ensuring all developers in the organization use the same tool definitions.

To configure a repository-level server, you must have admin permissions for the repository. The setup involves entering the server configuration on the repository settings page and storing the required credentials as Agents secrets.

The repository-level configuration flow requires these steps:

  1. Navigate to the main page of your repository on GitHub.com.

  2. Click Settings under the repository name to open the configuration panel.

  3. In the left sidebar under the Code, planning, and automation section, click Copilot.

  4. Select MCP servers to open the server management interface.

  5. Paste your JSON configuration defining the remote server URL and headers.

  6. Navigate to Settings, then Secrets and variables, and click Agents.

  7. Save your API tokens as secrets using the COPILOT_MCP_ prefix.

Secrets prefixed with COPILOT_MCP_ are exclusively exposed to MCP servers. This prevents general scripts or unauthorized agents from reading sensitive credentials. For example, if your remote server requires an API token to access external databases, save the secret as COPILOT_MCP_DATABASE_KEY. During execution, the Copilot cloud agent injects these variables securely into the server environment.

Using remote MCP servers allows organization agents to interact with hosted APIs. However, because remote servers can access sensitive code, organizations should enforce strict access policies. Administrators can restrict which repositories use specific MCP servers, ensuring data isolation across different projects.

Fastio workspace showing active developer tools and file storage lists.
Fastio features

Connect GitHub Copilot to your workspace via Fastio MCP

Deploy a persistent, shared workspace for your development team with built-in semantic search, automated file indexing, and an MCP server. Starts with a 14-day free trial.

How to Bridge GitHub Copilot and Fastio Workspace Storage

Many development workflows require accessing shared resources that lie outside the immediate git repository. Designing a bridge between GitHub Copilot and cloud workspaces allows developers to reference project specs, API documentation, and asset assets during code sessions. While several storage alternatives exist, they present specific constraints. For example, local storage isolates project files on individual machines, preventing team collaboration. Basic object storage in public clouds keeps files in the cloud but lacks semantic indexing or user-friendly notes. Standard cloud folders require manual setup and do not expose clean API endpoints for coding agents. Fastio resolves these problems by providing shared workspaces where developers and software agents collaborate on the same files. Fastio workspaces are intelligent, meaning files are automatically indexed for semantic search and AI chat once Intelligence Mode is enabled. The entry Starter plan starts at $29/month, the Business plan is $99/month, and the Growth plan is $299/month, each beginning with a 14-day free trial. Connecting GitHub Copilot to your Fastio workspace is straightforward. Fastio exposes a consolidated MCP toolset. The server is accessible via Streamable HTTP at the /mcp endpoint and legacy SSE at /sse. When you configure the Fastio MCP server in Copilot, the assistant gains the ability to query documents, search folders, and read Collaborative Notes. You can connect Fastio to your agent setup by reviewing the Fastio storage for agents documentation and comparing pricing options. The integration details are covered in the Fastio documentation and the Fastio LLM onboarding guidelines. For example, if your team stores database schemas and API design documents in a shared Fastio workspace, you can configure Copilot to fetch them dynamically. When you ask Copilot Chat to write a new API endpoint, the assistant queries the Fastio workspace using semantic search, retrieves the relevant design doc, and writes code that aligns perfectly with your team's specifications.

Security Scoping and Troubleshooting Copilot MCP Connections

Deploying MCP servers in a production development team requires proper security boundaries and logging. Because Copilot can execute tools autonomously, developers must ensure that the assistant operates within safe limits. This involves scoping API keys and validating server configurations.

If Copilot Chat fails to connect to your MCP server, verify the connection status using the Command Palette. Run the command MCP: List Servers to inspect active registrations. If the server status displays an error, check the VS Code output panel for Copilot logs. Common connection failures occur due to incorrect node paths, syntax errors in the mcp.json file, or missing environment variables.

To maintain secure environments, organizations should use scoped access. Instead of granting global permissions, generate API keys that restrict Copilot to specific workspaces or folders. Fastio supports scoped API access, allowing you to limit the assistant's reach. Also, browser-based PKCE login lets agents authenticate securely without exposing user passwords to the runtime environment.

For audit compliance, administrators should monitor agent actions. Fastio maintains an append-only audit log that records all file operations, access changes, and metadata extraction triggers. Because every file in a Fastio workspace retains a complete version history, team members can verify what modifications Copilot made and restore previous file versions if an automated edit introduces bugs.

By combining the tool execution capabilities of GitHub Copilot with the persistent context of Fastio workspaces, teams can build automated development workflows. Developers write code with real-time access to shared resources, while managers maintain visibility through immutable logs and granular access controls.

Frequently Asked Questions

Does GitHub Copilot support MCP?

Yes. GitHub Copilot supports the Model Context Protocol (MCP) in VS Code, JetBrains IDEs, and at the repository settings level for organization and enterprise users.

How do I add custom tools to GitHub Copilot?

You can add custom tools to GitHub Copilot by defining your custom MCP servers in a .vscode/mcp.json file for local workspaces, or by registering remote servers on GitHub.com under repository settings.

What is the GitHub MCP server registry?

The GitHub MCP server registry is a central hub where developers can discover, share, and manage pre-built MCP servers, allowing Copilot to connect to popular developer tools and databases.

Related Resources

Fastio features

Connect GitHub Copilot to your workspace via Fastio MCP

Deploy a persistent, shared workspace for your development team with built-in semantic search, automated file indexing, and an MCP server. Starts with a 14-day free trial.