Building Custom MCP Tools for Azure AI Foundry Agents (with Cosmos DB GraphRAG)
In this video we build a complete flow for using custom MCP tools with an Azure AI Foundry Agent. We’ll start by designing and implementing a Python-based MCP server that exposes GraphRAG tools over HTTP, then deploy it as an Azure Function and wire it into an Azure AI Foundry Agent so the agent can query a Cosmos DB Gremlin graph without knowing anything about the underlying data source. What we cover • How the MCP server is designed and how it hosts custom tools • The HTTP endpoints behind the server: • A typical MCP request/response flow between an agent and the server • How the MCP tools encapsulate all the GraphRAG / Cosmos DB Gremlin logic • Creating an Azure AI Foundry Agent, attaching the MCP server as a tool, and testing end-to-end By the end, you’ll see how to: • Wrap your own Python logic as MCP tools • Host those tools in a lightweight cloud service (Azure Functions) • Let Azure AI Foundry agents call into your GraphRAG backend via MCP instead of bespoke REST endpoints Code & related resources • ✅ GitHub repo (MCP server + sample tools): https://github.com/robkerr/robkerrai-... • ▶️ Related video – GraphRAG with Neo4j in a Docker stack: • Building a GraphRAG App: Concepts, Code, a... If you’re already using RAG and want a cleaner, more standard way for agents to call your tools and data sources, this walk-through should give you a concrete pattern to reuse. Chapters 0:00 Introduction 0:38 MCP Architecture 1:43 What's MCP? 2:49 Implementation Plan 5:03 MCP Flow 6:13 Code Walk-Through 13:49 Create AI Foundry Agent 20:03 Test AI Foundry Agent

Model Context Protocol (MCP) Explained for Beginners: AI Flight Booking Demo!

Python + MCP: Building MCP servers with FastMCP

How to setup a custom MCP Server for Azure AI Agents | Microsoft Foundry

MCP vs API: Simplifying AI Agent Integration with External Data

Implement Azure AI Foundry with MCP Servers for D365 ERP

Host your agents on Foundry: Microsoft Agent Framework

Build a Pizza Ordering Agent with Microsoft Foundry and MCP

Foundry IQ: the future of RAG with knowledge retrieval and AI Search | BRK196

Andrej Karpathy: From Vibe Coding to Agentic Engineering w/ Stephanie Zhan

Securing and Scaling AI Workloads with AI Gateway in Azure API Management

Multi-Agent AI on Azure | From Beginner to Pro with AI Foundry & Agent Service (No Code Demo)

Harnesses in AI: A Deep Dive — Tejas Kumar, IBM

Knowledge Retrieval: RAG for enterprise agents with Azure AI Search | BRK141

Build an Agentic RAG with Azure AI Search & Microsoft Foundry

How Instagram Scaled Postgres to 2 Billion Users

Simplest MCP Explanation | Need for Tools, MCP | Multi-Agent Stock Recommendation Project with Code

Building a GraphRAG App: Concepts, Code, and Demo

Running LLMs Locally Just Got Way Better - Ollama + MCP

How to Build a Local AI Agent With Python (Ollama, LangChain & RAG)

