Getting your APIs to work seamlessly with AI agents doesn’t have to mean hours of coding or complicated configuration. In this guide, I’ll show you how to build a Model Context Protocol (MCP) server directly in VS Code using GitHub Copilot Agent Mode — leveraging entirely free components and a “no-code” workflow.

If you want to expose your local tools or APIs to AI agents, this approach is efficient, scalable, and accessible to any developer.

1. Understanding MCP and Its Benefits

What is MCP? Model Context Protocol (MCP) provides a standardized way for AI agents to access local APIs and tools, extending automation possibilities in your coding environment.

Why does this matter? Makes your APIs accessible to AI agents.

2. Preparing Your Environment

To get started, ensure you have:

– VS Code installed

– GitHub Copilot and Copilot Chat extensions

– Node.js installed – required for running the TypeScript-based server.

3. Building the MCP Server

Using Copilot Agent for a No-Code Workflow:

– Write a clear prompt in natural language describing the MCP server you want.

– Use Copilot’s code agent mode to process the request and generate server code.

– Choose a folder location for your new server files (example: deck_of_cards.mcp).

Tip: Even if you’re new to TypeScript, Copilot Agent manages all code generation, error correction, and setup.  I have never written a single line of TypeScript!  

4. Running and Testing the MCP Server

Start the MCP server from within VS Code.

Ensure your API application (e.g., a .NET deck of cards API) is running.

Open a terminal and use the mcp-inspector tool to connect and verify the exposed operations.

5. Managing and Extending Your Tools

You can test all available operations directly in MCP Inspector.

If needed, move the MCP server’s config file for global use in other projects.

Pro tip: Track your GitHub Copilot usage (free accounts get 50 premium requests/month; pro tier allows 300).  It looks like 1 Agent Mode completion counts as 1 premium request no matter the number of steps.

6. Common Issues and Troubleshooting

– Ensure all required dependencies are installed (VS Code extensions, Node.js).

– Watch for prompts to install missing Java components—approve them as needed.

– Use the outlined steps to restart or relocate your MCP server if problems occur.

 

Below is the prompt I used to run this demo. 

GitHub Copilot Agent Mode Prompt using ChatGPT 4.1

Using the existing DeckOfCards.API application, create a Model Context Protocol (MCP) Server in TypeScript. Before writing any code, outline the tasks required to complete this project for my review and approval.

Project Requirements:

Implement the MCP Server using TypeScript.

When creating the Tool implementations for the three methods, pay special attention to the casing of output JSON messages—ensure they match the DeckOfCards.API contract.

In the project’s tsconfig.json, make sure that allowJs is set to true.

Instructions:

Start by outlining all tasks needed to build the MCP Server in TypeScript, including major steps and dependencies.

Wait for my review and approval of the outline before proceeding.

Once approved, implement the solution according to the outlined steps and requirements.

Take a look at my YouTube Video talking through this demo step-bystep.

YouTube player

Conclusion and Next Steps

With just a few tools and a natural language prompt, you can expose your APIs and automate tasks with AI agents in Visual Studio Code—no manual coding required.

Share your feedback or questions in the comments.