Skip to content
Index Ai Academy

Build and Deploy MCP Integrations

Build a Model Context Protocol client and server, then verify the integration with a compatible host.

Already have an account? Sign in

First principles

How can a host discover a capability and still control what gets used?

MCP exposes descriptions and schemas for capabilities through a common protocol. A host and server still need to validate arguments, enforce authorization, and obtain confirmation for consequential writes.

  1. Starting point

    A fresh client discovers the campaign tools, resource, and prompt.

  2. What changes

    A report read uses caller scope. A note asks the host for explicit confirmation.

  3. Result

    An accepted authorized note appears once. A denied note leaves no new state.

Compare all three steps
  1. Starting point

    A fresh client discovers the campaign tools, resource, and prompt.

  2. What changes

    A report read uses caller scope. A note asks the host for explicit confirmation.

  3. Result

    An accepted authorized note appears once. A denied note leaves no new state.

Complete and reverse the trace

Given A fresh client discovers the campaign tools, resource, and prompt. and An accepted authorized note appears once. A denied note leaves no new state., write down the missing step that connects them.

Compare with the worked step

A report read uses caller scope. A note asks the host for explicit confirmation.

Now take A report read uses caller scope. A note asks the host for explicit confirmation. and the result above. Write an input and an implementation that could produce this trace.

Check one starting point

A fresh client discovers the campaign tools, resource, and prompt.. Check that your implementation produces the result shown above.

Try it on a new case

A reviewer can read reports and the write tool is listed. What should happen when they request a review note?

Show worked reasoning

The server should deny the write before asking for confirmation. Discovering that a capability exists gives the reviewer no additional permissions.

Confirmation precedes a scoped write

  1. Discovery

    The client finds read_report and add_review_note.

  2. Read

    The client reads report R with a user who can review only R.

  3. Write proposal

    The model asks to add a review note to report S.

Which check matters even after the human taps Confirm? Name the state observation you would capture.

Compare your reasoning

The server still checks authorization for report S. Compare S’s note list before and after the denied call and retain the decision trace independently of the model response.

Trace a scoped read and a confirmed write

Discovery tells the host what the server offers. Caller permissions determine which effects may happen. Confirmation records an explicit choice on one consequential action.

  1. Start with a small case

    Use the starter client on local stdio and Streamable HTTP. Compare a successful report read, an authorized note without confirmation, and a confirmed note with the right role.

  2. Produce evidence

    Record request IDs, identity source, policy decisions, and the count of stored notes. A denied or unconfirmed write leaves the count unchanged. A replay of the confirmed operation adds no duplicate.

  3. Try a changed brief

    Turn off the campaign API while leaving MCP connected. Capture the precise failure the client observes and a clean recovery trace after the API returns.

Plan your practice and handover
  1. Start with the first lesson . Check the prerequisites under Before you start.
  2. Write a prediction for the small case above and record the result. Keep the fixture and the steps someone else needs to reproduce it.
  3. Use the changed brief to solve a case independently. Show what you changed, the output or test that supports your decision, and one condition that would make it fail.
  4. Open the final lesson . Give a reader the artifact described above and ask them to reproduce one result from your notes.
Between lessons

Carry the request ID through version negotiation

Pass an initialize request with a JSON-RPC ID to a toy version negotiation. Preserve the ID, then let the client decide whether it supports the server's chosen version.

Run the starter, predict the changed result, and then edit and run it again.

Set the client's only supported version to academy-v1. Predict whether it now continues and whether the response ID changes.

client_version = "academy-v0"
request = {"jsonrpc": "2.0", "id": 9, "method": "initialize",
           "params": {"protocolVersion": client_version}}
response = {"id": request["id"], "result": {"protocolVersion": "academy-v1"}}
chosen = response["result"]["protocolVersion"]
state = "continue on" if chosen == client_version else "stopped at"
print(f"ID {response['id']} | {state} {chosen}")
Compare against the expected output

Starter output

ID 9 | stopped at academy-v1

Changed output

ID 9 | continue on academy-v1
Common failure to check

A well-formed response with the matching ID still cannot make an unsupported protocol version usable. End the handshake in the unsupported case.

Take the changed output into the next lesson and explain which part of the handoff the next lesson needs.

Choose how to practice

Begin with Model Context Protocol. Each lesson offers these practice modes and a saved handoff.

Work on the campaign checker

Connect an MCP server to the campaign API and exercise its report tool using a fresh client.

Project workshop

Build it and prove each change

Use the campaign service starter from Software Lab. Follow each stage, collect the evidence, then move to the independent brief.

  1. 1

    Map one request across the stack

    Trace a local read from the CLI through the MCP server to the campaign HTTP API and back. Label the transport, schema, identity, and upstream job ID.Evidence to collect. Point to the message that describes the capability and the separate message that invokes it. Explain how you matched the response with the request.Open the lesson
  2. 2

    Expose a tool, a resource, and a prompt

    Expose a scoped report lookup, data dictionary, and review template. Keep the upstream job schema visible in the tool description and return useful errors.Evidence to collect. Use Inspector and the starter client to discover all three capabilities. Show the report call on an ID the caller owns.Open the lesson
  3. 3

    Connect a small host over both transports

    Launch the server from the Python client over local stdio. Then run the HTTP profile and connect the same CLI to the Streamable HTTP endpoint with its practice credentials.Evidence to collect. Repeat one discovery and one report read over each connection. Explain where the caller identity came from in each case.Open the lesson
  4. 4

    Authorize and confirm a durable write

    Add the notes capability with an analyst scope, a separate confirmation form, and an operation ID. Compare no confirmation, confirmed analyst write, and reviewer denial.Evidence to collect. Read notes from the HTTP service after each case. Retry the authorized write with the original operation ID and show the note count remains one.Open the lesson
  5. 5

    Make the failure visible and recover

    Start the API and MCP services with the container profile. Make the upstream API unavailable during a practice run, then restore it.Evidence to collect. Record the client and service evidence that identifies the upstream failure. Reproduce the successful read and denied write from a fresh client after recovery.Open the lesson
What you'll learn

What you'll be able to do.

MCP clients, servers, tools, resources, prompts, transports, authorization, and testing.

In order

The 15 lessons.

One is free with no account, and a free account opens the rest.

  1. Model Context ProtocolA standard way to plug tools and data into any AI app.30 min
  2. JSON-RPC 2.0 in depth FreeRequests, notifications, errors and a dispatcher built from scratch.35 min
  3. Versions and stateless requestsRevisions by date, the legacy handshake, per-request _meta and version negotiation.30 min
  4. Discovery, capabilities and the two erasserver/discover, declared capabilities, and talking to legacy and modern software alike.30 min
  5. Transports I: stdioNewline-delimited JSON over a subprocess's standard streams.30 min
  6. Transports II: Streamable HTTPOne endpoint, required headers, JSON or event-stream replies.40 min
  7. Build a server: toolsTool definitions, schemas from type hints, results and two kinds of error.45 min
  8. Resources and promptsReadable data, URI templates and reusable prompt templates.40 min
  9. Build a clientMetadata on every request, version fallback, paging and caching.40 min
  10. The same server with the official SDKsYour registry and dispatcher on the SDK's decorator shape, in Python and TypeScript.40 min
  11. Hosts: connecting servers to a modelMany servers, one agent: namespacing, routing and approvals.40 min
  12. Securing remote servers with OAuthProtected resource metadata, PKCE, audiences and scope challenges.45 min
  13. MCP securityTool poisoning, rug pulls, confused deputies and local-server risks.40 min
  14. Testing, designing and shipping serversConformance checks, tool design for models, SDKs and deployment.40 min
  15. Capstone: a production MCP serverA complete, tested server for the practice shop.45 min
Before and after

Where it starts, and what you earn.

When you finish

Finish every lesson and get staff approval on “Connect a scoped support integration” in My projects to earn the course certificate. The course ends with its own checkpoint, 12 questions the academy's server draws and marks itself. Pass it to verify the certificate and count lessons you skipped in the placement test.

Questions

Before you sign up.

Is it really free?

Yes. There's nothing to pay, here or anywhere in the academy. A free account saves your progress and issues your certificate.

Do I need to install anything?

The lessons run in your browser. The downloadable service project uses a local Python environment.

How long does it take?

About 11.5 hours in all, at your own pace. Your progress stays where you left it.

What does the certificate show?

You completed the course and passed a staff-reviewed independent project, “Connect a scoped support integration”. See My projects for the brief, evidence requirements, and submission.

Keep learning

Other free courses.

Or take the whole course: 575 lessons, from your first line of Python to production AI.

32 lessons about 21.5 hours

Free Python for AI course

Learn Python from your first line of code to your first call to a language model, with nothing to install.

15 lessons about 9.5 hours

Free prompt engineering course

Learn to write prompts that work reliably, then test them like an engineer: clear instructions, examples, structured output, chains, evals and defenses against prompt injection.

14 lessons about 9 hours

Free RAG course

Build retrieval-augmented generation step by step: embeddings, chunking, vector search, grounded answers with sources, and the measurements that tell you whether it works.

29 lessons about 22.5 hours

Free AI agents course

Learn how to build AI agents by building one: tools, the agent loop, MCP, permissions, context management and evals, ending with a coding agent that stops when its tests pass.

22 lessons about 16 hours

Build an LLM from scratch: a free course

Go from counting letter pairs to a small GPT you train yourself: tokenizers, attention, transformer blocks and the GPT architecture, written line by line.

127 lessons about 101.5 hours

Free Python developer course

Go from your first line of code to working as a Python developer: projects, testing, data, databases, web apps and APIs, all in your browser.

5 lessons about 3.5 hours

How Transformers Think: an interactive inference walkthrough

Follow one prompt, "The cat sat", through a language model with every number shown: tokens to IDs, embeddings and positional waves, the attention matrix, the feed-forward layer, and the probability over the next word.

6 lessons about 3 hours

Why Models Do That: six behaviors, traced to the mechanism

Confident wrong answers, miscounted letters, copying from the prompt, temperature, long prompts that dilute, and a model that never says "I don't know": each behavior reproduced on a tiny GPT with every number printed by code, then the mechanism behind it and the Phase 1 technique it justifies.

17 lessons about 13.5 hours

Creating Custom LLMs: Editing Open Weights Using Weight-Space Programming

Read a model's weights, change them by hand and judge an edit someone else made: deltas, merging, low-rank edits, directions and fact edits on a tiny GPT in your browser. Then replay recorded sessions of an LLM reading, fixing and writing weights, check the published edit of a real open model, and ship a model of your own with its patch, verdict and card. Every number is printed by the lesson's own code, and the method's limits are taught with it.

11 lessons about 9 hours

Free MLOps course: running machine learning in production

Take a model from a notebook to a system that stays right: track and reproduce every run, search settings honestly, version data and models, promote through gates, keep training and serving in step, choose batch or online, catch drift, and retrain through a pipeline. Every number is measured by the lesson's own code.

118 lessons about 95.5 hours

The Foundation Math For Ai & ML: from arithmetic to attention

Learn the math behind AI from arithmetic up: numbers, algebra, vectors and matrices, calculus, probability and statistics, each shown as numbers moving and checked in Python, ending with a network you build and train from the formulas.

19 lessons about 15 hours

Transposition of Formulas: algebraic manipulation in every topic

Learn to make any letter of any formula the subject: layers undone in reverse order, fractions, a letter that appears twice, powers, roots, quadratics, logs, inequalities, trigonometry, vectors, matrices, calculus, probability, statistics and the formulas inside AI models, each checked in Python.

20 lessons about 16.5 hours

Build and Operate HTTP APIs

Design, test, deploy, and operate an HTTP API that another engineer can use.

13 lessons about 11 hours

LLM Harness

Build a bounded run loop, test it with scripted model responses, and recover interrupted work from an event log.

Never trained an AI? Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account. Teach it to write

Free, with a certificate

Start the course.

A free account saves your progress across devices and issues your certificate when you finish.