MCP (Model Context Protocol)
- MCP Official Docs β Spec, tutorials, and guides
- MCP-UI β Official standard for interactive UI in MCP
- MCP Auth Guide (Auth0) β Deep dive into MCP auth spec updates
A2A (Agent-to-Agent Protocol)
- A2A Official Docs β Spec and guides
- A2A GitHub Repo β Protocol spec and implementations
- Announcing A2A (Google Blog) β Protocol vision and motivation
MCP vs A2A
- A2A and MCP (Official) β How they complement each other
uv syncCopy the example env file and fill in your OpenAI API key:
cp .env.example .envuv run server.pyThe server will start on http://localhost:8000.
ngrok creates a public URL that tunnels to your local server. This is required for Claude Desktop and remote MCP clients.
- Sign up at https://dashboard.ngrok.com/signup
- Copy your authtoken from https://dashboard.ngrok.com/get-started/your-authtoken
Option A β apt (requires sudo):
curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc \
| sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null
echo "deb https://ngrok-agent.s3.amazonaws.com buster main" \
| sudo tee /etc/apt/sources.list.d/ngrok.list
sudo apt-get update && sudo apt-get install -y ngrokOption B β direct download (no sudo, recommended for WSL2):
mkdir -p ~/.local/bin
curl -sSL https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz \
| tar xz -C ~/.local/bin
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrcWarning: Do NOT use
snap install ngrokon WSL2 β snap does not work reliably in WSL.
ngrok config add-authtoken <YOUR_TOKEN>In a separate terminal:
ngrok http 8000Note the Forwarding URL (e.g. https://xxxx.ngrok-free.app).
ISSUER_URL=https://xxxx.ngrok-free.app uv run server.pyImportant: The
ISSUER_URLmust match the ngrok forwarding URL exactly, or OAuth authentication will fail.
Create a .mcp.json file in the project root:
{
"mcpServers": {
"cat-shop": {
"type": "streamable-http",
"url": "https://xxxx.ngrok-free.app/mcp"
}
}
}Replace xxxx.ngrok-free.app with your actual ngrok URL.
Add the following to your Claude Desktop MCP config:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"cat-shop": {
"type": "streamable-http",
"url": "https://xxxx.ngrok-free.app/mcp"
}
}
}curl -s -X POST https://xxxx.ngrok-free.app/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'A 401 response (authentication required) means the server is reachable and OAuth is working.
| Problem | Solution |
|---|---|
ngrok: command not found |
PATH issue β run export PATH="$HOME/.local/bin:$PATH" |
ERR_NGROK_* errors |
Authtoken not configured β run ngrok config add-authtoken <TOKEN> |
| OAuth failures after connecting client | ISSUER_URL doesn't match the current ngrok URL |
| Free tier: URL changes on every restart | Must update ISSUER_URL, .mcp.json, and Claude Desktop config each time you restart ngrok |
In today's assignment, we'll be building an MCP server with OAuth authentication β a cat shop application that exposes tools for browsing products, managing a cart, and checking out.
-
π€ Breakout Room #1
- Set up the MCP server with OAuth and the product database
- Explore the MCP tools:
list_products,get_product,add_to_cart,view_cart,remove_from_cart,checkout
-
π€ Breakout Room #2
- Connect an MCP client to the server
- Build an end-to-end interaction flow using the MCP tools
The completed MCP server and client integration!
- A short Loom of either:
- the MCP server you built and a demo of the client interacting with it; or
- the notebook you created for the Advanced Build
Make a social media post about your final application!
- Make a post on any social media platform about what you built!
Here's a template to get you started:
π Exciting News! π
I am thrilled to announce that I have just built and shipped an MCP server with OAuth authentication! ππ€
π Three Key Takeaways:
1οΈβ£
2οΈβ£
3οΈβ£
Let's continue pushing the boundaries of what's possible in the world of AI and tool integration. Here's to many more innovations! π
Shout out to @AIMakerspace !
#MCP #ModelContextProtocol #OAuth #Innovation #AI #TechMilestone
Feel free to reach out if you're curious or would like to collaborate on similar projects! π€π₯
Follow these steps to prepare and submit your homework assignment:
- Review the MCP server code in
server.pyand theapp/directory - Run the MCP server locally using
uv run server.py - Connect to the server using an MCP client (e.g., Claude Desktop, or a custom client)
- Test all available tools: browsing products, adding to cart, viewing cart, removing items, and checkout
- Record a Loom video reviewing what you have learned from this session
Why is OAuth important for MCP servers, and what security considerations should you keep in mind when exposing tools to AI clients?
What is the Agent-to-Agent (A2A) protocol, and how does it differ from MCP in terms of purpose and architecture? When would you choose A2A over MCP?
Add at least one new tool to the cat shop MCP server (e.g., search_products, update_cart_quantity, or get_order_history). Ensure the new tool integrates properly with the existing database and OAuth authentication. Demo the new tool through an MCP client and include it in your Loom video.
Build a custom MCP client that connects to the cat shop server over Streamable HTTP, authenticates via OAuth, and orchestrates a multi-step shopping flow (browse β add to cart β checkout). Compare the developer experience of MCP-based tool integration vs. traditional REST API calls.
Include your findings and a demo in your Loom video.