general
4 TopicsPart3: MCP Server 101 for VS Code: Wire Up AI Agents to Live Data in Minutes
🧩 MCP Server 101 for VS Code — Part 3 of 3 (FINAL) 📌3-Part Series Overview Part 1 — Introduction, Prerequisites, and mcp.json deep dive Part 2 — Workspace vs. Global Settings, Local vs. Remote Servers, and npx vs. uvx Part 3 (this post) — Setup Guide, Security & Trust, Troubleshooting, Cheat Sheet, References 🚀Step-by-Step Setup Guide Step 1 — Enable Agent Mode Open VS Code Chat (Ctrl+Alt+I), click the model picker, and switch to Agent mode. MCP tools only fire in Agent mode — not in Ask or Edit modes. Step 2 — Add an MCP Server (3 Options) Option 1 — MCP Marketplace: Open Extensions: Ctrl+Shift+X Search: MCP Click Install (user-wide) or right-click → Install in Workspace Confirm trust when prompted Open Chat and enter a prompt to test 💡Popular picks: GitHub, Azure, Playwright, Filesystem, Fabric RTI MCP. 💡 Select Configure Tools in Chat to toggle specific tools on/off. VS Code MCP servers list window Option 2 — Via mcp.json: stdio — Local Node.js server: json { "servers": { "my-fabric-mcp": { "type": "stdio", "command": "npx", "args": ["-y", "fabric-rti-mcp-server"], "env": { "KQL_CLUSTER": "https://yourcluster.kusto.windows.net", "KQL_DATABASE": "YourDatabase" } } } } HTTP/SSE — Remote or Cloud-hosted: json { "servers": { "remote-api-mcp": { "type": "sse", "url": "https://your-mcp-server.azurewebsites.net/sse", "headers": { "Authorization": "Bearer ${input:apiToken}" } } } } Option 3 — Command Palette: Ctrl+Shift+P → MCP: Add Server Choose type: stdio (local) or HTTP/SSE (remote) Follow prompts → choose Workspace or Global scope Example of mcp.json file that configures a remote MCP server and a local MCP server Step 3 — Start, Stop, and Manage Servers Ctrl+Shift+P → MCP: List Servers — view all servers and their status MCP: Start Server / MCP: Stop Server — control individually Chat → Configure Tools → toggle tools on/off per conversation 3 different way to start and stop the MCP server Step 4 — Use MCP Tools in VS Code Chat Open Chat (Ctrl+Alt+I) in Agent mode and type a natural language prompt: "What were the top 5 equipment downtime events in the last 24 hours?" 📌Example assumes the Fabric Real-Time Intelligence MCP connector is added. Fabric RTI MCP runs the KQL query against your live Eventhouse and returns results — right inside VS Code. No tab switching. No copy-pasting. 🔒Security Best Practices ✅Only install from trusted, verified publishers ✅Use input variables for API keys — never hardcode in mcp.json ✅Add "sandboxEnabled": true for local servers ✅Commit .vscode/mcp.json to Git — but never commit secrets 🔧Troubleshooting & Debugging When VS Code detects a problem, an error indicator appears in the Chat view immediately. Two ways to access server logs: From Chat view: Click the error notification → select "Show Output" From Command Palette: Ctrl+Shift+P → MCP: List Servers → "Show Output" 💡Pro Tip: The output log tells you exactly why a server failed — missing dependency, wrong command path, or invalid environment variable. Always check here first. 🔐MCP Server Trust VS Code requires explicit trust confirmation before any server starts — ensuring nothing runs on your machine without your consent. Review the full server config in the trust dialog before approving Reset trust: Ctrl+Shift+P → MCP: Reset Trust Always review community or third-party server configs before approving ⚠️Warning: Starting a server directly from mcp.json bypasses the trust prompt entirely. Always use the Command Palette or Extensions panel. 5. Quick Reference Cheat Sheet MCP (Model Context Protocol) – Command Reference 🏭 Real World Implementation Follow this practical implementation with Real Time Analytics MCP Server. 🏁Wrapping Up MCP turns VS Code into a true AI agent platform — reasoning over live data, calling real APIs, and acting on your behalf across tools and services. For Microsoft Fabric users, MCP + VS Code Chat means your AI genuinely understands your data in real time — no copy-pasting, no tab switching, no context loss. 🔗 References Add and manage MCP servers in VS Code MCP configuration reference Beyond the tools — adding MCP in VS Code ️⏮ Previous — Part 1: Introduction, Prerequisites, Terms to Know, and a deep dive into mcp.json ⏮️ Previous — Part 2: Workspace vs. Global Settings, Local vs. Remote Servers, and npx vs. uvx Happy Reading!!! Give it a try, and drop your questions or use cases in the comments. Happy to help you connect AI agents to the tools that matter most in your workflow. Let me know which MCP server you connected first! 👇Part2: MCP Server 101 for VS Code: Wire Up AI Agents to Live Data in Minutes
📋This is Part 2 of a 3-part series on MCP Server 101 for VS Code. Part 1 — Introduction, Prerequisites, and mcp.json deep dive Part 1 Article Part 2 (this post) — Workspace vs. Global, Local vs. Remote, npx vs. uvx Part 3 — Step-by-Step Setup, Security, Troubleshooting, Trust & Cheat Sheet 📂Workspace vs. Global Settings Workspace Settings It apply only to the current project you have open in VS Code. They live inside your project directory — if you commit to Git, your whole team gets the same config automatically. When to use: Building a project-specific MCP server (e.g., one connecting to a Fabric KQL database) Sharing MCP config with teammates via Git Different projects need different sets of tools File location: YourProject\.vscode\mcp.json How to open: Ctrl+Shift+P → MCP: Open Workspace Folder MCP Configuration ✅Commit .vscode/mcp.json to Git so your whole team benefits — but never include hardcoded secrets. 🌐Global (User) Settings Global settings apply to every project on your machine. Personal to you, not shared via source control — your toolbox that follows you everywhere. When to use: Always-available tools regardless of which project you open Solo developer with no team sharing needed Tools available even in a fresh, empty workspace File location (Windows): C:\Users\YourName\AppData\Roaming\Code\User\mcp.json File location (Mac): ~/Library/Application Support/Code/User/mcp.json File location (Linux): ~/.config/Code/User/mcp.json How to open: Ctrl+Shift+P → MCP: Open User Configuration ⚖️Workspace vs. Global — At a Glance Feature Workspace Global (User) Scope Current project only All projects File location .vscode/mcp.json User profile folder Shareable via Git ✅Yes ❌No Best for Team setups Personal tools Overrides global? ✅Yes Acts as baseline 🖥️ Local vs. Remote MCP Servers Local Servers (stdio) Runs on your own machine as a Node.js or Python process. VS Code starts and manages it via standard input/output (stdio). No internet required — all processing happens locally. Configuration type: "type": "stdio" json { "servers": { "local-server": { "type": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/your/folder"] } } } Pros: ✅ Offline capable · ✅ Local file access · ✅ Fastest response · ✅ Full code control Cons: ❌ Needs Node.js/Python installed · ❌ Only runs when VS Code is open ☁️Remote Servers (HTTP / SSE) A cloud web service exposing an HTTP or SSE endpoint. VS Code connects over the internet like calling an API. Always running — no local setup needed. Configuration type: "type": "sse" or "type": "http" json { "servers": { "remote-server": { "type": "sse", "url": "https://your-mcp-server.azurewebsites.net/sse", "headers": { "Authorization": "Bearer ${input:azureToken}" } } } } Pros: ✅ No local install · ✅ Always available · ✅ Multi-user · ✅ Enterprise ready Cons: ❌ Needs internet · ❌ Network latency ⚖️Local vs. Remote — At a Glance Feature Local (stdio) Remote (HTTP/SSE) Runs on Your machine Cloud / remote server Requires internet ❌No ✅Yes Local file access ✅Yes ❌No Always available Only when VS Code is open ✅Yes Best for Personal/dev tools Enterprise, SaaS integrations ⚙️npx vs. uvx — What's the Difference? Two executables are used in mcp.json to launch MCP servers: npx — Node Package eXecutor Runs Node.js / JavaScript packages on demand — no global install needed The -y flag skips confirmation prompts Example: npx -y mcp-remote@latest https://mcp.canva.com/mcp uvx — Universal Virtual eXecutor Runs Python packages in isolated environments (like pipx) No system-wide installation required Example: uvx [email protected] npx = JavaScript/Node.js ; uvx = Python/cross-platform Both run tools on-demand without permanent installation — ideal for MCP server management. ⏩ Up next — Part 3: Step-by-Step Setup, Security, Troubleshooting, Trust, Real-World Use Case & Cheat Sheet ⏮️ Previous — Part 1: Introduction, Prerequisites, Terms to Know, and a deep dive into mcp.jsonPart1: MCP Server 101 for VS Code: Wire Up AI Agents to Live Data in Minutes
📋This is a 3-part series on MCP Server 101 for VS Code. This series covers everything you need to configure, manage, and use MCP servers in VS Code — from foundational concepts to real-world usage. Whether you are new to MCP or looking to deepen your understanding, this guide has you covered. Part 1 (this post) — Introduction, Prerequisites, Terms to Know, and a deep dive into mcp.json Part 2 — Workspace vs. Global Settings, Local vs. Remote Servers, and npx vs. uvx Part 3— Step-by-Step Setup, Security, Troubleshooting, Trust & Cheat Sheet 🧠 Introduction Model Context Protocol (MCP) is rapidly changing how AI agents interact with real-world tools and data. With Chat's Agent Mode in VS Code now supporting MCP servers natively, you can connect your AI assistant directly to databases, APIs, and file systems — right from your editor. This guide walks you through everything: how MCP Server configuration works, what options are available, the key differences between settings, and a holistic understanding of the concept — with real examples you can copy and run today. Follow this link for a practical implementation with Real Time Analytics MCP Server ✅Prerequisites Before you begin, make sure you have: VS Code 1.99+ (MCP support is GA from 1.102+; earlier versions have it in preview) VS Code Chat extension installed and active Node.js installed (for npx-based servers) 📝Terms to Know Before Configuration Before configuring, let's align on a few key terms: mcp.json — and why it is important Workspace vs. Global setting of this file Local vs. Remote MCP Servers stdio commands — npx vs uvx 📄What Is mcp.json? mcp.json is the configuration file that tells VS Code which MCP servers to use, how to start or connect to them, what credentials to use, and what scope they apply to. It is a plain JSON file — human-readable, easy to edit, and version-controllable. 💡Think of it as the "wiring diagram" between VS Code's Chat Agent and all the external tools and services it can call. 📁File Locations Scope File Path (Windows) Use When Workspace YourProject\.vscode\mcp.json Sharing config with team via Git Global / User C:\Users\YourName\AppData\Roaming\Code\User\mcp.json Personal tools across all projects 🛠️ How to Create the File Option A — Via Command Palette (Recommended): Press Ctrl+Shift+P Type MCP: Add Server and select it VS Code walks you through a wizard and auto-creates the file with correct syntax Option B — Open existing config: Press Ctrl+Shift+P Type MCP: Open User Configuration (global) or MCP: Open Workspace Folder MCP Configuration (project-specific) VS Code opens the file — if it doesn't exist yet, it creates it automatically Option C — Manually create: In your project root, create folder .vscode if it doesn't exist Inside .vscode, create a file named exactly mcp.json Paste the starter template below and save — VS Code detects it automatically 🔬Anatomy of mcp.json Here is a fully annotated example showing all key fields: json { "servers": { // Root key — always "servers" in VS Code "server-name": { // Friendly name you choose "type": "stdio", // "stdio" (local) or "sse"/"http" (remote) "command": "npx", // Command to start the server (stdio only) "args": ["-y", "package-name"], // Arguments passed to the command "env": { // Environment variables "API_KEY": "${input:myKey}" // Use input variables — never hardcode! } } }, "inputs": [ // Optional: secure prompts for secrets { "id": "myKey", "type": "promptString", "description": "Enter API Key", "password": true } ] } ⚠️Critical: VS Code uses "servers" as the root key. Other tools may use "mcpServers". This is the #1 copy-paste mistake — check this first if nothing works. ⏩Up next — Part 2: Workspace vs. Global Settings, Local vs. Remote Servers, and npx vs. uvxMicrosoft Fabric Real-Time Intelligence (RTI) MCP server in VS Code
What is Fabric MCP? The Microsoft Fabric ecosystem is evolving fast — and one of the most exciting accelerators in this space is the Fabric local MCP (Model Context Protocol) server. It’s opening the door to a new generation of intelligent, automation‑ready apps that blend Fabric’s unified analytics foundation with AI‑driven extensibility. The Fabric local MCP server takes this a step further — it exposes Fabric's patterns, sessions, and utilities as tools that AI assistants (Github Copilot Chat) can call directly via the Model Context Protocol (MCP). This means you can build powerful apps, automations, and workflows where your AI assistant natively understands and runs Fabric patterns — no copy-pasting prompts, no manual switching between tools. Why Build with Fabric MCP? Patterns as tools — Every Fabric pattern becomes a callable tool your AI can use automatically. Local-first — Your data stays on your machine. No cloud dependency for pattern execution. Composable — Chain patterns together inside larger workflows and agents. Fast iteration — Prototype AI-powered tools in minutes using patterns you already have. There are a no. of notable community and official tools/MCP servers available. Let's take an example of one of the important and latest entry in the ecosystem. Setting up the Microsoft Fabric Real-Time Intelligence (RTI) MCP server in VS Code This MCP Server extention turns your editor into a high-octane command center for streaming data. By following these steps, you’ll enable an AI agent (like GitHub Copilot) to query Eventhouses, inspect schemas, and generate KQL queries using natural language. Prerequisites Python 3.10+: Ensure Python is installed and added to your system PATH. VS Code: Version 1.99 or later is recommended. GitHub Copilot Extension: Required if you want to use the "Agent Mode" for natural language data interaction. A Fabric Eventhouse: You’ll need the connection URI (found in the Fabric portal). Step 1: Install the RTI MCP Server The fastest way to get the server onto your machine is via pip. Open your terminal (integrated in VS Code) and run: Bash pip install microsoft-fabric-rti-mcp If you prefer to run it without a permanent installation, you can also use uvx (part of the uv toolchain) which is often the preferred method for MCP servers. Step 2: Configure the MCP Server in VS Code VS Code needs to know how to "talk" to the RTI server. You can configure this globally or per project. Press Ctrl + Shift + P and search for "MCP: Open User Configuration". This opens your mcp.json file. Add the following entry to the mcpServers section: JSON { "mcpServers": { "fabric-rti": { "command": "uvx", "args": ["microsoft-fabric-rti-mcp"], "env": { "KUSTO_SERVICE_URI": "https://your-cluster.kusto.windows.net", "KUSTO_DATABASE_NAME": "YourDatabaseName" } } } } Pro Tip: You can find your KUSTO_SERVICE_URI in the Fabric portal by navigating to your KQL Database and clicking "Copy URI" in the Database details panel. Step 3: Authenticate and Start the Server Once you save the configuration file, VS Code will attempt to initialize the server. In the Extensions view (left sidebar), look for the MCP SERVERS section. You should see fabric-rti. If it isn't running, right-click it and select Start Server. Authentication: The first time it runs, a browser window may pop up asking you to sign in with your Microsoft Entra ID (formerly Azure AD). This allows the MCP server to securely access your Fabric data. Step 4: Using RTI in Copilot Chat Now the fun begins. Open the GitHub Copilot Chat window (Ctrl + Alt + I). Switch to Agent Mode (if applicable) or simply type your request. Verify the tools are active by typing: What tools are available for fabric-rti? Try a real-world query: "List all tables in my Eventhouse." "Show me the schema for the StormEvents table." "Write a KQL query to find the top 10 most expensive storm events in the last 24 hours." Output Snapshot from My Setup Prompt 1: “List all my kusto database” 2. Follow up prompt 2 : “summarize the data in my Samples database” 3. Similar Prompt 3: “now summarize similar way for my contoso db” 4. More Advance prompt 4 : “provide me the best selling product for last 5 years with their revenue and profit margins” Look at the response with the KQL Query provided as it may contains sensitive management specific details, so it provided the KQL syntax only for the user to run based on access. Overall, it provides relevant information with just using the natural language prompt very conveniently without digging down the technical side of it along with keeping the data security in mind. Useful Resources GitHub Repository: microsoft/fabric-rti-mcp Official Documentation: Fabric RTI MCP Overview Chat with your Eventhouse with Microsoft Fabric's MCP Server This video provides a visual walkthrough of the installation process and demonstrates how to interact with real-time data streams using the MCP server. Happy Learning! Thanks GauravLZ888