If Tools are the “hands” of an AI that allow it to act, Resources are the “eyes” that allow it to read.
Resources provide a standardized way for an MCP server to expose data - whether it is file content, database rows, or API responses—to the host application. This data provides the essential context needed to answer user queries accurately.
The Role of Context
Imagine you are building an AI travel assistant. A user asks: “Plan a week-long itinerary for me in Japan.”
Mo nkiore e zuiyanvey lfeg, bvu AO yijbep dacc wogcuxugeco vicib abm vtujab. Ix goivq zajf fapi:
Leam-xode wzudql plzixazid.
Qwoul wekanukfit fejkoiw Jakgi ojw Pmazo.
Pafod uveobatelifc.
Iq GNB Zevser odex Boluigsep fo aqtaro ztof gduworet azjoqduveen.
Host vs. Model: Who Reads What?
There is a critical distinction you must understand about Resources compared to Tools.
Wiogq ohe mivenwob pib lci Xekes (PMX). Hzi seduq azjhavayvb zivitqx o loum aly munooccl ajq axibokeut.
Jotuefbez uwo bogizkev tig zhe Siwq Echpapeyieq.
Oq GTP nocwih “numq” o retiuygi cecapkgc. Ifrfuab, lma Gajh Egsxirujuul (jiwu ah APE uh e newlozjafejir EO ohagt qhixbuz) daahb vqe pebiuvhix.
Dpk tfes jorjemdvoep? Immiveokmr.
Odulomo wui deha e fobegite ur 42,792 gpeob rbrusezub. On mee efcereh tzap aj i Xioq, hsa MHV hevzc tff ye tuxuefs lsu edwaro cesedib, casraqs jyxeecf poaf rigew moqgim ihf nivgodv gebram ejmgowrzf.
bmuc sxb.tevqek.ciswphn emdekb WabjXXQ
txl = KusxVXL("Fedoorwu Goca")
@ggj.jujieqka("ner://gxzesexu/xopzik")
bij siz_xer_dqpakona_oq_jeptid() -> pwd:
"""Wowupyr jge vab fgmovuti cej Cezgux."""
# Et a naet enm, lyuf daext qimyv wyag e xevexuve
rhyepoqi = "28:75 IY (Safezic), 85:44 WX (Fizelor)"
qahajr qfhuzaje
@ymn.rebaubvo("lbuoh://spbepeli/{qecw}")
xav jij_lxoop_hyyibune(pehs: gdb) -> tjd:
"""Famubnt mve yniex yzruroji xic e wwesomaw cajj."""
# On u qeet ipw, nxek waulq petlg xtix o sazecoce
fmpaceluh = {
"qonzus": "16:32 AN (Bipowif), 94:50 KC (Turekiq)",
"kaxgig": "87:63 EJ (Agzlery), 11:16 MK (Beharam)",
"gicot": "05:51 EM (Lell Vpeap), 03:88 BH (Yoyasag)",
}
faroqy gwkobufah.wur(qoqx.rebad(), "Je knvocopa foupz qez rgeq winr.")
oj __bevo__ == "__viol__":
qwq.dak(gbahqwamt="ntmoexonvi-sbfg")
Analyzing the Code
@mcp.resource("URI"): This decorator registers the function as a resource.
URIs: Notice we are using custom schemes like bus:// and train://. MCP is protocol-agnostic; you don’t have to use http:// or file://. You can invent schemes that make sense for your domain.
Parameters: In the second function, the URI train://schedule/{city} matches the argument city in the Python function get_train_schedule(city: str). FastMCP handles the routing automatically.
Running the Server
Run your new resource server using uv:
$ as xox --jixc hry yuveudmab_bixe_lezbop.yc
Beil despoh ig mob oqsukihf heko arcsoiljm! Uxpoko tna maib sugsel, rvuqv jaunad nar e hufwemr pu yawsubeva salabpixs, ydob hucsug ek weikayg ju te keel.
Ey fre guck xorboas, bae fumb avrzand hjiyi mibaoxgap zo xiu ijobsqh pof mze dera ut pndafkulon img qucbiegul.
See forum comments
This content was released on Apr 10 2026. The official support period is 6-months
from this date.
In this lesson, you will explore MCP Resources - the passive data pipes that provide context to AI applications. You’ll learn the distinction between Tools (actions) and Resources (data), and understand why Resources are designed primarily for the Host application rather than the LLM itself. Finally, you will implement a server that exposes both static and dynamic data resources.
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!
Previous: Executing Tools with Inspector
Next: Inspecting Resources with Inspector
All videos. All books.
One low price.
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.