A while back, Microsoft Reactor had a three-part series called "Python and MCP from local to production." The first session, presented live by Pamela Fox (a Python Cloud Advocate at Microsoft) in [MONTH YEAR], runs about an hour. It takes you from "what even is MCP?" all the way to a working, debuggable, observable server that AI agents can use. Here's a walkthrough of what she covered and the advice she shared along the way.
The series at a glance
The three sessions run Tuesday through Thursday:
- Day one (this session): building MCP servers with FastMCP.
- Day two: deploying to Azure with private networking.
- Day three: authentication, including key-based, OAuth and Entra.
Everything is recorded on YouTube, the slides are free to reuse or even teach from, and there is a follow-along repo that you can open in Codespaces, fork or clone.
Why MCP exists
Pamela starts with the problem. Before the Model Context Protocol, every integration (a database, Slack, GitHub) needed custom code in every AI application. MCP is a protocol that standardizes how a model gets context to answer questions and complete tasks. Now a service exposes itself once as an MCP server, and any MCP client can connect to it.
A bit of history from the session: Anthropic created MCP just over a year earlier, originally for Claude Desktop. As Pamela put it, "MCP just had its birthday." It has since become part of the Agentic AI Foundation under the Linux Foundation, which happened roughly two weeks before the session. She called MCP the biggest thing in the industry over the last six months.
The architecture has three parts. Hosts (like Claude Desktop, GitHub Copilot or ChatGPT) contain clients, and clients talk to servers. Servers expose three kinds of things:
- Tools: callable functions. "Tools is what most people think of when they think of MCP servers."
- Resources: static context that needs no argument.
- Prompts: reusable user prompts.
She also took a moment for the security caveat. Giving an agent more functionality, especially through authenticated servers that can reach your own data, brings a huge benefit and a real risk, and you should keep both in mind.
Why VS Code with GitHub Copilot
The MCP site has a client feature matrix that keeps growing. Every client supports tools, but support for resources, prompts, discovery, sampling, roots, elicitation and instructions varies. VS Code with GitHub Copilot has a full row of green checks, meaning it's fully compliant with the spec. Pamela noted that fast-agent also has all checks, and that Microsoft Copilot Studio is an MCP client too (a viewer asked). Because VS Code is often first to adopt new features, it makes a great developer playground for testing what your server can do.
Try someone else's server first
Before building anything, Pamela installed the Microsoft Learn MCP server from the VS Code extensions gallery (searching @mcp). She also mentioned Context7 for open-source project docs. Gallery servers are vetted, and can be removed if security problems turn up.
She then asked Copilot, "Does Azure Container Apps support serverless GPUs? What does Learn say?" The agent called the Microsoft Docs server's search tool and returned up-to-date results. The point of the demo: the LLM chooses tools based on their names, descriptions and arguments. With dozens of servers and hundreds of tools, it can pick the wrong one or miss the right one, which she called one of the tricky things about MCP servers. Her tips:
- Name the server explicitly in your prompt.
- Untick the other servers.
- Try a different model. She alternated between Opus 4.5 and GPT-5.
Choosing a Python SDK
You could build a server from scratch by reading the spec, but Pamela doesn't recommend it. There's the official python-sdk in the Model Context Protocol GitHub org, which stays close to the spec. Then there's FastMCP, a framework built on top of that SDK, which she recommends. It adds Entra integration, about 15 other auth providers, FastAPI integration, easier production deployment, logging and OpenTelemetry. It also lets you write servers in a Pythonic way, with decorators, type hints and async.
The running example: an expense tracker
The whole session builds on one server: an expense tracker that writes to a CSV file locally (and to Cosmos DB in production, which comes in later sessions). Keeping one example throughout makes each demo comparable.
She first runs it over stdio, configured in .vscode/mcp.json and launched with uv. A stdio server is just a shell command. Python servers typically use uv run, while JavaScript or TypeScript ones use npx, as with the Playwright server.
Tools: types and descriptions matter
The add_expense function is decorated with @mcp.tool. Its arguments are date, amount (a positive float), category (an enum), description and payment method (also an enum). Pamela's key point is that all of this information gets sent to the LLM:
"It really helps to get very specific in your function [signature] here because all of this information is going to get sent to whatever application is using this MCP server."
Enums restrict arguments to a fixed set of values, and she recommends Annotated types to attach descriptions. And importantly, "It only sees the description of the function, not how it's implemented."
She tested it with a prompt about a $222 purchase on a corporate Amex for a conference. VS Code asks permission before running MCP tool actions by default, with options to allow for the session, the workspace, always, or per server. The expense showed up as a new row in the CSV. A follow-up ("I also bought a $20 pizza") was logged against Amex again without the agent asking, a good reminder that you can tune behavior through descriptions and annotations, and that monitoring requests helps you see what the model gets wrong.
Resources and prompts
A resource, declared with @mcp.resource and a URI, returns the whole CSV. In VS Code you attach it through Add Context, then MCP Resources. Prompts, declared with @mcp.prompt, are reusable and can be templatized; you trigger them by typing a slash.
Here Pamela offered some candid advice. An expense list feels more like a tool than a resource. Most people and agents don't know about resources, so her default is:
"I would tend to always expose everything at least as a tool and then maybe add on some resources as well."
In answer to a viewer question, she said she later converted this resource into a tool for the authenticated sessions, because the data needed to be user-specific.
stdio versus streamable HTTP
The downside of stdio is that your local environment has to work. Pamela shared that she'd hit PATH problems with uv in VS Code Insiders and npx install issues the week before. Her preference:
"Generally I prefer HTTP servers and definitely for production I would recommend an HTTP server."
The code change is tiny: the last line, mcp.run , uses a different transport. The options are stdio, SSE and streamable HTTP, and SSE is deprecated in favor of streamable HTTP. She runs the file with uv run servers/basic_mcp_ http.py , and it starts on port 8000 at localhost:8000/mcp. Visiting that URL in a browser gives an error because it expects a properly formatted MCP request, but at least it proves something is running. In mcp.json, VS Code only needs the type and the URL: "It doesn't know how that server got started. This server could be written in JavaScript, C, Python, whatever." The next two sessions build on this HTTP server.
Three tools for developing and debugging
- Breakpoint debugging. Configure it with a launch.json and a debug entry in mcp.json that runs the server under debugpy. She set breakpoints in add_expense, sent a pizza expense from Copilot, and VS Code stopped at the breakpoint showing the variables. Her advice: set this up when you're in a good mood, because "when you actually run into a bug, you're going to be like too frustrated to be able to set up breakpoint debugging at that point."
- MCP Inspector. A UI for talking to your server directly, with no agent or LLM in the way. Run it with npx, connect to your HTTP server, and use its tabs (resources, prompts, tools, sampling, elicitations, roots, auth, metadata). She filled in the add_expense form by hand and got a success result plus a history of calls.
- Observability with OpenTelemetry and Aspire. Observability is usually a combination of logs, traces and metrics. She ran the Aspire dashboard (from the .NET community) as a Docker container, added the OTEL endpoint to her .env file, and restarted the server. After asking Copilot to log a tutu purchase on her Visa, the dashboard showed the log entry with an attached OpenTelemetry trace. A deeper dive was promised for the next session.
Pointing agents at the same server
Finally, Pamela used two agent frameworks as MCP clients against the very same HTTP server. First, Microsoft Agent Framework, which she called the newest AI agent framework and the successor to AutoGen and Semantic Kernel (if you're using either, "you should move on over"). It has built-in MCP support. The agent needs an LLM that supports tool calling: Azure OpenAI (her choice), GitHub Models, Ollama (she suggested Qwen or Gemma) or openai.com .
The live run produced a nice teaching moment. The agent was unsure how to categorize a $1,200 laptop purchase, so it didn't log it and instead asked, "Would you like me to log it this way?" Pamela noted it had worked the last time, but used the moment to make a point about design: normally with agents you want some sort of human in the loop. She edited the query to add "Log it under gadgets," and the second run logged it correctly, which she confirmed in the CSV.
Then she ran the LangChain example, which follows the same pattern: connect to the MCP server, pass the tools to the agent, run the same query. It logged successfully too. Her takeaway: "all the modern agent frameworks have built-in support for MCP where they basically they're acting as an MCP client."
On a viewer's question about many tools or servers: you can send hundreds of tool definitions, but "the more tool call definitions you send, the more likely an LLM is to get confused," so keep descriptions unambiguous.
A refreshingly unpolished demo
One thing I enjoyed: this is a live, unedited session, and the small slips were left in. The amounts on screen (300000 and 363) didn't always match what she said out loud (300 and 365), and she joked about never wanting to see pizza again. It makes the demos feel real, and it's a good reminder that models don't always behave the same way twice.
No comments yet