Skip to main content

Hands-on with MCP Resources in VS Code

In the first post of this series, we explored what MCP resources are and why they're the overlooked piece of the MCP puzzle. Now it's time to get practical—let's dive into using resources in Visual Studio Code.

By the end of this post, you'll know how to discover, browse, attach, and leverage MCP resources to supercharge your AI-powered development workflow.

Understanding resources in VS Code

When an MCP server exposes resources, VS Code makes them accessible in several ways:

  1. Browse all resources across all installed servers
  2. Browse resources per server to see what each provides
  3. Attach resources to chat as context for your conversations with Copilot
  4. View resources directly in the editor
  5. Save resources from tool call results to your workspace

Think of resources as a context menu for your AI—a way to give Copilot exactly the information it needs without copy-pasting or explaining everything manually.

Setting up your first MCP server with resources

Let's start by installing an MCP server that provides resources. We'll use the GitHub MCP Server as our example because it's widely used and demonstrates several resource patterns.

Method 1: Install from the Extensions View

The easiest way to install an MCP server is through VS Code's built-in gallery:

  1. Open the Extensions view (Ctrl+Shift+X or Cmd+Shift+X on Mac)
  2. Type @mcp in the search field
  3. Find "GitHub MCP Server" and click Install
  4. VS Code will prompt you to trust the server—review the configuration and confirm

Method 2: Use the MCP: Add Server Command

Alternatively, you can use the command palette:

  1. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)
  2. Type "MCP: Add Server"
  3. Select your package manager (NPM, PyPI, or Docker)
  4. Enter the server details
  5. VS Code handles the rest!

Method 3: Manual Configuration

For team projects, you can share MCP server configurations using a workspace file:

  1. Create .vscode/mcp.json in your workspace root
  2. Add your server configuration:
  1. Save the file—VS Code will detect it and offer to start the server

Browsing resources: Your first look

Once you have an MCP server installed and running, let's explore its resources.

Browse resources

Open the command palette and run MCP: Browse Resources. This shows resources from all your installed MCP servers in one unified view.

You'll see:

  • Resource names (human-readable descriptions)
  • Resource URIs (unique identifiers like github://repo/owner/name/readme)
  • Server attribution (which MCP server provides each resource)
 

Understanding resource templates

Some resources use templates—URIs with placeholders that let you provide parameters. For example:

  • github://repo/{owner}/{name}/file/{path}
  • database://query/{table_name}

When you select a templated resource, VS Code prompts you for each parameter. This makes resources dynamic and flexible—you're not limited to pre-defined values.

Attaching resources to chat

Here's where resources become truly powerful. Instead of explaining context to Copilot, you attach it directly.

Using the Add Context Button

  1. Open GitHub Copilot Chat
  2. Click the Add Context button (the paperclip icon)
  3. Select MCP Resources…
  4. Choose the resource you want to attach

The resource content is now part of your conversation context. Copilot can reference it when answering questions or generating code.

What’s next?

In the next post, we'll level up by building our own MCP resource server from scratch. You'll learn:

  • The anatomy of a resource server
  • Implementing resources in C#
  • Best practices for resource URIs and metadata
  • Testing and debugging your server

Stay tuned!

    Popular posts from this blog

    Azure DevOps/ GitHub emoji

    I’m really bad at remembering emoji’s. So here is cheat sheet with all emoji’s that can be used in tools that support the github emoji markdown markup: All credits go to rcaviers who created this list.

    .NET 8–Keyed/Named Services

    A feature that a lot of IoC container libraries support but that was missing in the default DI container provided by Microsoft is the support for Keyed or Named Services. This feature allows you to register the same type multiple times using different names, allowing you to resolve a specific instance based on the circumstances. Although there is some controversy if supporting this feature is a good idea or not, it certainly can be handy. To support this feature a new interface IKeyedServiceProvider got introduced in .NET 8 providing 2 new methods on our ServiceProvider instance: object? GetKeyedService(Type serviceType, object? serviceKey); object GetRequiredKeyedService(Type serviceType, object? serviceKey); To use it, we need to register our service using one of the new extension methods: Resolving the service can be done either through the FromKeyedServices attribute: or by injecting the IKeyedServiceProvider interface and calling the GetRequiredKeyedServic...

    Kubernetes–Limit your environmental impact

    Reducing the carbon footprint and CO2 emission of our (cloud) workloads, is a responsibility of all of us. If you are running a Kubernetes cluster, have a look at Kube-Green . kube-green is a simple Kubernetes operator that automatically shuts down (some of) your pods when you don't need them. A single pod produces about 11 Kg CO2eq per year( here the calculation). Reason enough to give it a try! Installing kube-green in your cluster The easiest way to install the operator in your cluster is through kubectl. We first need to install a cert-manager: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.5/cert-manager.yaml Remark: Wait a minute before you continue as it can take some time before the cert-manager is up & running inside your cluster. Now we can install the kube-green operator: kubectl apply -f https://github.com/kube-green/kube-green/releases/latest/download/kube-green.yaml Now in the namespace where we want t...