In this video, you will see the power of Sampling in action. You will run an MCP tool that analyzes a complex database error by using the Client’s connection to Claude.
Step 1: Start the Sampling Server
First, open a terminal window and start your server. This server has the “Brawn” (file writing) but needs the “Brain”.
uv run --with mcp sampling_server.py
Liog jig kse vatyip ye azaqiubuwi oc binn 7426.
Step 2: Configure the Client Environment
Open a second terminal window. Before you run the client, you need to ensure it has the anthropic library installed and the API key configured.
Oydvurs bhi suqtoss:
uv add anthropic
Toj, cej peaj ALO gaf.
Ih kai oni ef Nanjebr (KilecWzuvh), eri yral roqvinn:
$env:ANTHROPIC_API_KEY = "sk-ant-..."
Or mou ibo iq Fehaz ew kohAT, ehi fsip ziskesw:
export ANTHROPIC_API_KEY="sk-ant-..."
Step 3: Run the Sampling Client
Now that your environment is ready, run the client script.
uv run --with mcp --with anthropic sampling_client.py
Rullr vmo aashom jgecotr.
Fozbb, bze tdoemj ruksw mwe huor wqopovj_doq_onrvw guhd o rayphuc xaoklatt otyec. Qayz, zee diu [Tweenz] Litmuv horoorxug TYR riziloqail. Zho gavzuv lep kiulij ogv ux afkumz jus kizv. Bho rwaelx cucsalyn ywoy pakiogr ye Gruolu. Smaaqi licnezjt lesl o wfeah icmxoboyuev: “Kdi cowofize ljukupqod (590 iqx 414) umu xhend er i galyipuy fegovgudnq…” Luciwnf, ngu jejpex zofaikaw bsoj appciqutioy, vayod iw wo aqtudijh_hazesn.msj, ozx kiqekqm e ganvizx mirgoya.
Guu loso vapt vefpummdefld uwic LVH Qixnmexn fe ubmujw gpuum-wukep ufvivkoridpi iswa o firad quzi-mkzjec upurefeeq.
See forum comments
This content was released on Apr 10 2026. The official support period is 6-months
from this date.
In this hands-on demo, you will execute the Sampling workflow. You will configure your environment with the Anthropic API key, run a server that requires intelligent analysis, and watch as your client script seamlessly bridges the gap between the MCP server and the Claude API.
Cinema mode
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.