A tiny, self-contained project that teaches how MCP works, end to end, with no database, no API keys, and no internet.
Meera runs the motor-claims desk at a general insurer. All day, agents and customers ask her team the same thing: "What's the status of my claim? Is it approved? How much will I get?" She wants an AI assistant that answers instantly. But the AI has no idea whether claim CLM-4471 is approved — that lives only in the claims system. So she gives the AI a tool to look it up. That tool is the MCP server we build here.
A claim's status is a fact the AI cannot guess — it exists only in our records. So the AI has no choice but to call our tool. That is the real reason MCP exists: to connect a model to knowledge it could never have on its own.
| File | What it is | The lesson |
|---|---|---|
claims_data.py |
A plain Python "claims system" + a lookup function. No MCP. | An MCP tool is, at heart, just a function. |
server.py |
The MCP server that exposes that function as a tool. | MCP is the bridge that lets an AI call your function. |
Keeping them separate is deliberate: the data (the concept) is one file, the MCP wrapping (the application) is another.
Follow these steps in order. Each one confirms the layer beneath it before adding the next — so if something breaks, you know exactly where.
Python 3.10 or newer is required.
pip install "mcp[cli]"Run the plain lookup on its own first. This proves the claims data is correct before we involve any AI.
python3 claims_data.pyYou should see records printed for CLM-4471 (Approved), CLM-5522 (Under Review), CLM-6033 (Rejected), and CLM-9999 (not found). If this fails, it is a plain Python problem — fix it before touching MCP.
The Inspector is a small web tool that connects to your server exactly like a real AI app would — but shows you everything happening underneath. It IS a client (the same role VS Code or Claude Desktop plays), just without an AI model. Using it, you play the part of the AI: you pick the tool and type the input by hand.
Run this from inside the project folder (where server.py lives):
npx @modelcontextprotocol/inspector python3 claims_server.py
⚠️ Do not usemcp dev server.pyunless you haveuvinstalled. On a plainpipsetup,mcp devtries to launch throughuvand fails with aSyntaxError: Unexpected token 'E'error. Thenpxcommand above launches your server withpython3directly and avoids this.
The terminal prints something like:
MCP Inspector is up and running at:
http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=...
A browser tab opens automatically. If it does not, open the full URL,
including the ?MCP_PROXY_AUTH_TOKEN=... part — that token is what lets
the page talk to the server. Leave the terminal running; that IS your server.
- On the left, confirm Transport Type = STDIO, Command =
python3, Arguments =claims_server.py. (Thenpxcommand fills these in for you.) - Click Connect.
- The dot at the bottom-left should turn green and say Connected.
- Click the Tools tab in the top bar (the crossed-hammers icon).
- Click List Tools. Your tool
get_claim_statusappears, with its description. This is the client asking the server "what can you do?" - Click the
get_claim_statusrow (the one with the>arrow). An input box opens. - In
claim_id, type:CLM-4471 - Click Run Tool.
A green Tool Result: Success with output like:
{
"found": true,
"claim_id": "CLM-4471",
"policy_holder": "Rahul Deshpande",
"claim_type": "Motor - Accident",
"status": "Approved",
"claim_amount": 85000,
"approved_amount": 72000,
"note": "Approved after garage inspection. Policy excess of Rs.13,000 applied."
}This should match what python3 claims_data.py printed in Step 2. Same
data — now reachable over MCP. Your server is verified.
| Type this claim_id | What it shows | Why it matters |
|---|---|---|
CLM-5522 |
Status "Under Review",approved_amount is null |
A tool can honestly say "not decided yet" |
CLM-6033 |
Status "Rejected", with a reason innote |
Structured data carries context, not just a status |
CLM-9999 |
found: false |
A good tool admits what it doesn't know instead of inventing an answer |
Note on the Resources / Prompts tabs: they will be empty. That is correct — this server exposes only a tool, not resources or prompts.
Everything you just did is MCP in three moves. Say it to students like this:
- "What can you do?" — clicking List Tools is the client asking the server for its list of tools. Nobody hardcoded it; the client discovered it by asking.
- "Please do it." — typing the claim ID and clicking Run Tool sends that input to the server and says "run your tool with this."
- "Here's the result." — the green Success and the JSON is the server handing back an exact, trustworthy answer, because real data produced it.
- A tool is a function. Step 2 runs the exact same lookup with no AI involved. The tool is just that function, made reachable.
- The AI cannot cheat here. Unlike a maths question, the AI cannot guess a claim's status — so it is forced to use the tool. This is the clearest way to show why MCP matters: access to private knowledge.
- The description is the interface. The text under
get_claim_statusin the Inspector is the docstring fromserver.py— the exact words the AI reads to decide when to use the tool. Change it to something vague, restart, and tool selection gets worse. In MCP the description is not a comment; it is instructions the model reads. - A good tool tells the truth. The
found: falseand thenullapproved amount show the tool being honest about what it doesn't know or hasn't decided — so the AI can say so instead of hallucinating.
| Symptom | Almost always means |
|---|---|
python3 claims_data.py errors |
Python issue — fix before touching MCP |
mcp dev fails with Unexpected token 'E' |
It launched viauv; use the npx ... python3 server.py command instead |
| InspectorConnect does nothing | Opened the URL without the?MCP_PROXY_AUTH_TOKEN=... token — reopen the full URL from the terminal |
No module named 'mcp' on launch |
Themcp package is in a different Python — run python3 -m pip install "mcp[cli]" |
| Tools tab empty after Connect | Server didn't start — check the terminal for a Python error inserver.py |
In Project 1 we built an MCP server (the claims assistant).
In Project 2 we do the opposite and more powerful thing: we consume a server that a company (Alpha Vantage) built and runs for us. We write no server code and no client code — we just connect the hosts we already know to their server and watch it work.
This is the other half of the whole reason MCP exists. Project 1 showed "anyone can build a server." Project 2 shows "any MCP host can use a server someone else built, over one shared standard" — without writing a single line of integration code. That is the M + N payoff made real.
It also introduces one genuinely new idea:
- Project 1 transport = stdio — a local server we launched on our own machine.
- Project 2 transport = HTTP — a remote server running on Alpha Vantage's machines, reached over a URL.
Same MCP, different transport. The tools, the "list tools", the "call tool" — all identical. Only where the server lives changes.
Meera's claims desk is one thing. But her colleague Ravi runs an equity research desk, and his team constantly needs live market data — quotes, company fundamentals, currency rates. Ravi is NOT going to build and maintain a server for all of that. Someone already did: Alpha Vantage publishes an MCP server covering stocks, forex, crypto, fundamentals, and economic indicators. Ravi just connects to it. That is when you consume instead of build: when a good server already exists.
Alpha Vantage's server needs a free key (a ~30-second signup):
https://www.alphavantage.co/support/#api-key
Keep the key handy. The remote server is reached at this URL, with your key in it:
https://mcp.alphavantage.co/mcp?apikey=YOUR_API_KEY
Free tier: about 500 standard requests/day (plenty for a workshop). A few premium endpoints are limited to ~25/day.
Here we answer the question "what tools did they define?" the right way: we don't read their docs — we let the client ask the server directly.
npx @modelcontextprotocol/inspector(No python3 claims_server.py this time — there is no local server. We are
connecting to a remote one.)
In the Inspector's left panel:
- Transport Type: change from STDIO to Streamable HTTP (or "HTTP").
- URL: paste
https://mcp.alphavantage.co/mcp?apikey=YOUR_API_KEY(with your real key). - Click Connect. The dot should turn green / Connected.
- Open the Tools tab.
- Click List Tools.
- Watch their whole catalogue appear — stock quotes, time series, company fundamentals, forex, crypto, economic indicators, and their consolidated technical-indicator tools.
This is the moment of the project. Nobody in the room wrote any of this. The client simply asked the server "what can you do?" and the server answered. That is exactly how an AI would discover these tools too.
- Find a quote tool (e.g. the global quote /
GLOBAL_QUOTEtool). - Click it, enter a symbol like
IBM, and Run Tool. - You get back live market data — from a server running somewhere else entirely, through the same MCP mechanics you learned in Project 1.
Now we hand the "asking" job to a real AI, so the full loop runs against someone else's server.
Add this to .vscode/mcp.json (note type: "http" and the URL — this is
how a remote server is configured, versus the local command/args
style from Project 1):
{
"servers": {
"alphavantage": {
"type": "http",
"url": "https://mcp.alphavantage.co/mcp?apikey=YOUR_API_KEY"
}
}
}Then:
- Click Start on the server entry (or Command Palette ->
MCP: List Servers). - Open Copilot Chat, switch the dropdown to Agent.
- Click the Tools icon and confirm the Alpha Vantage tools are listed.
In Agent mode:
Get me the latest stock quote for IBM.
What was IBM's OHLCV data for the last week?
Copilot will pick the right Alpha Vantage tool, call it, show an Allow dialog, and answer using live data. The AI did the asking; their server did the answering; you wrote nothing.
This is the most important part for a financial-services audience. With the remote server connected, ask the room:
- Where does the API key live? It sits in a config file / URL. Who can see it? What happens if that file is committed to git? How is it rotated?
- What leaves our building? Every query — which stocks our desk is researching — travels to Alpha Vantage's servers. For a bank, that research interest is itself sensitive signal. Are we comfortable sending it to a third party?
- Whose source of truth is it? If their data is wrong, stale, or the service is down, our AI confidently repeats the error. We inherit their reliability.
- When is consuming right, and when should we build our own? Alpha Vantage is a fine choice for public US market data. But for our own internal, confidential data (like the claims system in Project 1), we build and host the server ourselves — inside our network — so nothing leaves and we control the key.
The takeaway: consuming a third-party MCP server is not just a config step — it is a trust decision. That judgement is the real skill.
| Idea | How it showed up |
|---|---|
| Consuming vs building a server | We used Alpha Vantage's server; wrote no server code |
| Remote (HTTP) vs local (stdio) transport | A URL instead ofpython3 server.py |
| Tool discovery on a server you didn't write | List Tools revealed their whole catalogue |
| The AI as client, against a real server | VS Code Agent mode called their tools |
| Third-party trust & data residency | The Part 3 discussion — the banker's real question |