We’re excited to announce that Visual Studio now supports MCP prompts, resources, and sampling (with even more coming soon!) to enhance your Copilot experience by bringing in more context from your engineering stack. These powerful new features unlock deeper integrations with your favorite tools and services, making your development workflow more intelligent and context aware.
Let’s dive into each of these features and discuss some examples with specific MCP servers that can truly level up your AI-coding experience.
MCP Resources and Resource Templates: Access External Data Seamlessly
Model Context Protocol also provides a standardized way for servers to expose resources to clients. Resources allow servers to share data that provides context to language models, such as files, database schemas, or application-specific information. Each resource is uniquely identified by a URI, allowing you to get even more out of your MCP servers and pull in context directly in the IDE.
Example: Azure DevOps Work Items
When working with Azure DevOps, you can now reference work items, user stories, and project data directly in your chat conversations. The Azure DevOps MCP server exposes resources like work item templates, sprint information, and team capacity data that Copilot can use to provide more contextual suggestions about your project planning and development tasks.
Using MCP Resources
To use any MCP resources available to you, reference them in Copilot chat the same way you would reference any other piece of context – with a hashtag (#) followed by the resource URI.
Resource Templates for Dynamic Content
Just like with prompts, MCP resources can have arguments that you can fill in to customize the resource for your specific needs. These are called resource templates. To configure them:
- Use the + Reference button in chat
- Select the MCP resource option from the menu
- Choose your resource template and fill in any required arguments
- Click Add Resource to make this MCP resource referenceable in chat
Example: Figma Design Context
For teams working closely with design systems, the Figma MCP server allows you to reference design components, style guides, and design specifications directly in your development conversations. This bridges the gap between design and development by making design context readily available to Copilot.
MCP Prompts and Prompt Templates: Get Better Responses with Specialized Instructions
MCP Prompts allow servers to provide structured messages and instructions for interacting with language models that are catered to the use case and content of the server in question, ensuring that you will get the best responses for a certain task.
How to Use MCP Prompts
Visual Studio now allows you to discover available prompts, retrieve their contents, and provide arguments to customize them. To reference any prompts that may come from an MCP server:
- Click the + Reference button in chat
- Select the Prompts option
- Choose MCP prompts from the flyout
You’ll see a pop-up where you can select the prompt you’d like to use, then click Insert Prompt to include the text from this prompt in chat.
Prompt Templates with Custom Arguments
Some MCP prompts will have arguments that you can fill in to customize the prompt for your specific needs – these are known as prompt templates. If you select a prompt in the modal dialog that contains arguments, you’ll be able to specify those values before inserting the prompt into chat.
Example: GitHub Integration
Imagine you’re working on code reviews and want to leverage GitHub’s specialized prompts. With the GitHub MCP server, you can access prompts specifically designed for analyzing pull requests, generating commit messages, or reviewing code changes. These prompts understand GitHub’s context and can provide more targeted assistance than generic prompts.
MCP Sampling: Enabling Advanced Agentic Behaviors
Sampling in MCP allows servers to implement agentic behaviors by enabling LLM calls to occur nested inside other MCP server features. This powerful feature allows an MCP server to make requests of an LLM, rather than the typical workflow of an LLM requesting content from an MCP server. Visual Studio now supports this advanced capability, allowing your MCP servers to perform more complex, multi-step tasks on your behalf.
How Sampling works
There’s nothing to configure to take advantage of sampling – as long as your MCP server supports it, Visual Studio will too. When Copilot determines that a request would benefit from a sampling call, you’ll see a dialog containing all details of the request, asking you to confirm the sampling call before anything happens behind the scenes. This ensures you maintain full control over any automated actions.
Example: Playwright testing scenariosÂ
The Playwright MCP server can use sampling to automatically generate comprehensive test scenarios based on your application’s current state. When you ask for help with testing, it might sample your application’s DOM structure, analyze user flows, and then generate targeted test scripts that cover critical user paths – all through intelligent sampling calls that you approve.
Getting Started
These new MCP capabilities are available now in Visual Studio. To get the most out of these features, we recommend exploring the MCP servers that align with your development workflow. Each server brings unique prompts, resources, and potentially sampling capabilities that can significantly enhance your Copilot experience.
Try out some other popular MCP servers in Visual Studio with one-click:
– Discover and install custom prompts and instructions for GitHub Copilot.
– Convert various file formats (PDF, Word, Excel, images, audio) to Markdown.
– Query and analyze data in DuckDB databases locally and in the cloud.
– Database operations and management. Execute queries, manage collections, aggregation pipelines, and document operations.
– Access models, datasets, and Spaces on the Hugging Face Hub.
The seamless integration of external tools and services through MCP represents a major step forward in creating a truly connected development environment. By bringing context from your entire engineering stack directly into your IDE, these features help Copilot provide more accurate, relevant, and actionable assistance for your daily development tasks.
Give us your feedback!
We’re excited to continue evolving the MCP experience in VS, and your input plays a big role—please give us your feedback here, and let us know what you’d like to see next!
The integration of MCP prompts, resources, and sampling in Visual Studio really enhances the Copilot experience.