content
large_stringlengths
3
20.5k
url
large_stringlengths
53
192
branch
large_stringclasses
4 values
source
large_stringclasses
51 values
embeddings
listlengths
384
384
score
float64
-0.21
0.65
Server", auth=auth) ```
https://github.com/jlowin/fastmcp/blob/main/docs/integrations/propelauth.mdx
main
model-context-protocol-fastmcp
[ -0.008381428197026253, 0.029094472527503967, -0.0998743325471878, -0.04048847779631615, -0.08743961900472641, -0.07817810028791428, 0.07949455827474594, -0.032025933265686035, 0.025810884311795235, -0.027069920673966408, 0.026043685153126717, 0.008557372726500034, 0.09481648355722427, 0.03...
0.057192
import { VersionBadge } from "/snippets/version-badge.mdx" import { LocalFocusTip } from "/snippets/local-focus.mdx" [Gemini CLI](https://geminicli.com/) supports MCP servers through multiple transport methods including STDIO, SSE, and HTTP, allowing you to extend Gemini's capabilities with custom tools, resources, and...
https://github.com/jlowin/fastmcp/blob/main/docs/integrations/gemini-cli.mdx
main
model-context-protocol-fastmcp
[ -0.062487199902534485, -0.02855508029460907, -0.02080462872982025, -0.07358071208000183, -0.03190361335873604, -0.05671520158648491, 0.023371977731585503, -0.013294026255607605, -0.03524656593799591, -0.04020392522215843, 0.025019869208335876, 0.052246615290641785, 0.05577578395605087, -0....
-0.01946
use Gemini CLI's built-in MCP management commands. This gives you direct control over how your server is launched: ```bash # Add a server with custom configuration gemini mcp add dice-roller uv -- run --with fastmcp fastmcp run server.py # Add with environment variables gemini mcp add weather-server -e API\_KEY=secret ...
https://github.com/jlowin/fastmcp/blob/main/docs/integrations/gemini-cli.mdx
main
model-context-protocol-fastmcp
[ -0.06235929951071739, -0.0075197964906692505, 0.008128142915666103, -0.03913788124918938, -0.038658756762742996, -0.08102557808160782, -0.04441104084253311, 0.0518377348780632, -0.07598526030778885, 0.004954992327839136, -0.006978985853493214, -0.0041045849211514, 0.04956752434372902, 0.00...
-0.05662
import { VersionBadge } from "/snippets/version-badge.mdx" This guide shows you how to secure your FastMCP server using \*\*Discord OAuth\*\*. Since Discord doesn't support Dynamic Client Registration, this integration uses the [\*\*OAuth Proxy\*\*](/servers/auth/oauth-proxy) pattern to bridge Discord's traditional OAu...
https://github.com/jlowin/fastmcp/blob/main/docs/integrations/discord.mdx
main
model-context-protocol-fastmcp
[ -0.07356926798820496, 0.002378246746957302, 0.06408944725990295, -0.053513120859861374, 0.009097601287066936, 0.020737674087285995, 0.020074136555194855, 0.001926229684613645, -0.005578635260462761, -0.03439944237470627, 0.019336700439453125, -0.03933607041835785, 0.09155010432004929, -0.0...
-0.031192
restarts, configure `jwt\_signing\_key` and `client\_storage`: ```python server.py import os from fastmcp import FastMCP from fastmcp.server.auth.providers.discord import DiscordProvider from key\_value.aio.stores.redis import RedisStore from key\_value.aio.wrappers.encryption import FernetEncryptionWrapper from crypto...
https://github.com/jlowin/fastmcp/blob/main/docs/integrations/discord.mdx
main
model-context-protocol-fastmcp
[ -0.061426084488630295, -0.029072020202875137, -0.01575823500752449, 0.00734232971444726, 0.0169681366533041, -0.06572598218917847, 0.008736667223274708, 0.020040687173604965, 0.06137070432305336, -0.03428502008318901, 0.022288832813501358, -0.035380441695451736, 0.007114009466022253, 0.008...
0.058755
Add \*\*policy-based authorization\*\* to your FastMCP servers with one-line code addition with the \*\*[Permit.io][permit-github] authorization middleware\*\*. Control which tools, resources and prompts MCP clients can view and execute on your server. Define dynamic policies using Permit.io's powerful RBAC, ABAC, and ...
https://github.com/jlowin/fastmcp/blob/main/docs/integrations/permit.mdx
main
model-context-protocol-fastmcp
[ -0.04950364679098129, 0.002910463372245431, 0.008594529703259468, -0.006132316309958696, 0.061328038573265076, -0.04671787470579147, 0.03444542735815048, -0.03543761745095253, -0.026357850059866905, 0.0555938258767128, 0.012069997377693653, -0.02277158573269844, 0.06519144028425217, -0.006...
0.13065
`permit-fastmcp` package: ```bash # Using UV (recommended) uv add permit-fastmcp # Using pip pip install permit-fastmcp ``` Then create a FastMCP server and add the Permit.io middleware: ```python server.py from fastmcp import FastMCP from permit\_fastmcp.middleware.middleware import PermitMcpMiddleware mcp = FastMCP("...
https://github.com/jlowin/fastmcp/blob/main/docs/integrations/permit.mdx
main
model-context-protocol-fastmcp
[ -0.06305070966482162, 0.04802664741873741, -0.003827183274552226, -0.05420619994401932, -0.025193823501467705, -0.04274526983499527, 0.04461561143398285, 0.01230109017342329, -0.044382091611623764, 0.007953723892569542, 0.04031066223978996, -0.07636989653110504, 0.09025393426418304, 0.0559...
-0.021888
The middleware will now intercept all MCP requests and check them against your Permit.io policies. Requests include user identification through the configured identity mode and automatic mapping of MCP methods to authorization resources and actions. ## Advanced Configuration ### Environment Variables Configure the midd...
https://github.com/jlowin/fastmcp/blob/main/docs/integrations/permit.mdx
main
model-context-protocol-fastmcp
[ -0.06334678083658218, 0.001671645906753838, 0.05597968399524689, -0.06219692528247833, 0.15264762938022614, -0.06825004518032074, 0.02933407947421074, 0.007874388247728348, -0.09418362379074097, 0.04797826707363129, -0.030010558664798737, -0.051258835941553116, 0.042818766087293625, 0.0222...
0.140193
import { VersionBadge } from "/snippets/version-badge.mdx" import { LocalFocusTip } from "/snippets/local-focus.mdx" [Goose](https://block.github.io/goose/) is an open-source AI agent from Block that supports MCP servers as extensions. FastMCP can install your server directly into Goose using its deeplink protocol — on...
https://github.com/jlowin/fastmcp/blob/main/docs/integrations/goose.mdx
main
model-context-protocol-fastmcp
[ -0.071774423122406, -0.08237367123365402, -0.002094205003231764, -0.04155963659286499, -0.015535992570221424, -0.06003335490822792, -0.04138932749629021, 0.0016324184834957123, 0.01071999128907919, -0.015994977205991745, 0.027250897139310837, 0.0384691096842289, 0.035670988261699677, -0.04...
0.029726
300 ``` #### Environment Variables Environment variables can be specified in the `envs` field: ```yaml extensions: weather-server: name: Weather Server cmd: uvx args: [fastmcp, run, /path/to/weather\_server.py] enabled: true envs: API\_KEY: your-api-key DEBUG: "true" type: stdio timeout: 300 ``` You can also use `goose...
https://github.com/jlowin/fastmcp/blob/main/docs/integrations/goose.mdx
main
model-context-protocol-fastmcp
[ -0.05982068181037903, -0.025119071826338768, -0.0064344340935349464, 0.002252238802611828, -0.017862925305962563, -0.10646069794893265, -0.013419671915471554, 0.009694475680589676, -0.0016765189357101917, -0.029820706695318222, 0.03405855968594551, -0.06452850997447968, 0.03618311136960983, ...
-0.036451
import { VersionBadge } from "/snippets/version-badge.mdx" This guide shows you how to secure your FastMCP server using \*\*AWS Cognito user pools\*\*. Since AWS Cognito doesn't support Dynamic Client Registration, this integration uses the [\*\*OAuth Proxy\*\*](/servers/auth/oauth-proxy) pattern to bridge AWS Cognito'...
https://github.com/jlowin/fastmcp/blob/main/docs/integrations/aws-cognito.mdx
main
model-context-protocol-fastmcp
[ -0.053435977548360825, 0.038789089769124985, -0.014670881442725658, -0.07466224581003189, 0.0027417242527008057, 0.022054776549339294, 0.012654551304876804, -0.04857904464006424, -0.005011004861444235, 0.0065270219929516315, 0.037667132914066315, -0.10110121965408325, 0.06271414458751678, ...
-0.031208
identifier must exactly match your `base\_url + mcp\_path`. For the default configuration with `base\_url="http://localhost:8000"` and `path="/mcp"`, use `http://localhost:8000/mcp`. After setup, you'll have: - \*\*User Pool ID\*\*: Format like `eu-central-1\_XXXXXXXXX` - \*\*Client ID\*\*: Your application's client id...
https://github.com/jlowin/fastmcp/blob/main/docs/integrations/aws-cognito.mdx
main
model-context-protocol-fastmcp
[ -0.04710047319531441, 0.020974861457943916, -0.02579946257174015, -0.06371928751468658, -0.028516540303826332, -0.02850538119673729, -0.01110608596354723, 0.00440021650865674, 0.028831837698817253, 0.041836731135845184, 0.02386457845568657, -0.12701429426670074, 0.06830272078514099, -0.016...
-0.024082
the [OAuth Proxy documentation](/servers/auth/oauth-proxy#configuration-parameters). ## Features ### JWT Token Validation The AWS Cognito provider includes robust JWT token validation: - \*\*Signature Verification\*\*: Validates tokens against AWS Cognito's public keys (JWKS) - \*\*Expiration Checking\*\*: Automaticall...
https://github.com/jlowin/fastmcp/blob/main/docs/integrations/aws-cognito.mdx
main
model-context-protocol-fastmcp
[ -0.09078705310821533, 0.03785005956888199, -0.026286235079169273, -0.011870861053466797, 0.03045940399169922, -0.06810667365789413, 0.04417812079191208, -0.03617962449789047, 0.01130767073482275, -0.02097412757575512, 0.02220418117940426, -0.05338292196393013, 0.058771297335624695, -0.0595...
0.017146
{/\* \*/} \*\*FastMCP is the standard framework for building MCP applications.\*\* The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) connects LLMs to tools and data. FastMCP gives you everything you need to go from prototype to production — build servers that expose capabilities, connect clients to a...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/welcome.mdx
main
model-context-protocol-fastmcp
[ -0.07720254361629486, -0.05044650658965111, -0.022319283336400986, -0.00841929018497467, -0.08759985119104385, -0.05279907211661339, 0.015080335550010204, 0.04078768193721771, -0.010634697042405605, -0.006762420292943716, 0.03894883394241333, -0.07317414879798889, 0.10245060920715332, 0.02...
0.118204
windows) Any page can be accessed as markdown by appending `.md` to the URL. For example, this page becomes `https://gofastmcp.com/getting-started/welcome.md`. You can also copy any page as markdown by pressing "Cmd+C" (or "Ctrl+C" on Windows) on your keyboard.
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/welcome.mdx
main
model-context-protocol-fastmcp
[ -0.035207949578762054, 0.05713266506791115, -0.032730646431446075, -0.02241377905011177, 0.03746473044157028, 0.0468536838889122, -0.07076303660869598, -0.04848514124751091, 0.0043745264410972595, 0.014922771602869034, 0.0007054097950458527, 0.13911044597625732, 0.05840156972408295, 0.0003...
-0.026931
Welcome! This guide will help you quickly set up FastMCP, run your first MCP server, give it a visual UI, and deploy it to Prefect Horizon. If you haven't already installed FastMCP, follow the [installation instructions](/getting-started/installation). ## Create a FastMCP Server A FastMCP server is a collection of tool...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/quickstart.mdx
main
model-context-protocol-fastmcp
[ -0.06407687067985535, -0.04215484857559204, 0.011927672661840916, 0.0068851038813591, -0.07990915328264236, -0.07328174263238907, -0.04109812155365944, 0.03395457565784454, -0.059302181005477905, -0.003653167514130473, 0.06031504645943642, -0.012305687181651592, 0.061798498034477234, -0.01...
0.034337
interactive UI instead. Add `app=True` to your tool decorator and return a [Prefab](https://prefab.prefect.io) component — the host renders it as a chart, table, form, or any other visual element right in the conversation. This requires the `apps` extra (`pip install "fastmcp[apps]"`). The `app=True` flag tells FastMCP...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/quickstart.mdx
main
model-context-protocol-fastmcp
[ -0.05056256800889969, 0.05654635652899742, 0.02581034041941166, 0.059940796345472336, -0.016434524208307266, -0.03143962100148201, -0.021231938153505325, 0.03153608739376068, 0.03757072612643242, -0.025657184422016144, 0.02502831071615219, -0.11476154625415802, 0.035914018750190735, -0.005...
-0.013563
## Install FastMCP We recommend using [uv](https://docs.astral.sh/uv/getting-started/installation/) to install and manage FastMCP. ```bash pip install fastmcp ``` Or with uv: ```bash uv add fastmcp ``` ### Optional Dependencies FastMCP provides optional extras for specific features. For example, to install the backgrou...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/installation.mdx
main
model-context-protocol-fastmcp
[ -0.03455979377031326, -0.021975066512823105, 0.022706208750605583, -0.03420949727296829, 0.00663183955475688, -0.0413699708878994, -0.0500166155397892, 0.03690674528479576, -0.019523266702890396, 0.00787124503403902, 0.03021102584898472, -0.04840685799717903, 0.01895684003829956, 0.0876053...
-0.010101
If your server starts with `from mcp.server.fastmcp import FastMCP`, you're using FastMCP 1.0 — the version bundled with v1 of the `mcp` package. Upgrading to the standalone FastMCP framework is easy. \*\*For most servers, it's a single import change.\*\* ```python # Before from mcp.server.fastmcp import FastMCP # Afte...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/upgrading/from-mcp-sdk.mdx
main
model-context-protocol-fastmcp
[ -0.09392755478620529, -0.05282644182443619, 0.05319871008396149, -0.001971235265955329, 0.010601597838103771, -0.11820448935031891, -0.042087338864803314, -0.025125207379460335, -0.009515490382909775, 0.016106456518173218, 0.028839636594057083, 0.03088952600955963, 0.048719778656959534, -0...
0.00863
= FastMCP("my-server") mcp.run(transport="http", host="0.0.0.0", port=8080) ``` If you pass the old kwargs, you'll get a clear `TypeError` with a migration hint. ### Prompts If your prompt functions return `mcp.types.PromptMessage` objects or raw dicts with `role`/`content` keys, you'll need to upgrade to FastMCP's `Me...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/upgrading/from-mcp-sdk.mdx
main
model-context-protocol-fastmcp
[ -0.03852800652384758, 0.02686288394033909, 0.05968331918120384, -0.0010605149436742067, -0.017873385921120644, -0.08513297140598297, 0.006658976431936026, 0.00324247102253139, 0.002853760961443186, -0.01693783886730671, 0.06411690264940262, -0.08617278933525085, 0.09975647926330566, -0.044...
-0.028644
This guide covers breaking changes and migration steps when upgrading FastMCP. ## v3.0.0 For most servers, upgrading to v3 is straightforward. The breaking changes below affect deprecated constructor kwargs, sync-to-async shifts, a few renamed methods, and some less commonly used features. ### Install Since you already...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/upgrading/from-fastmcp-2.mdx
main
model-context-protocol-fastmcp
[ -0.05634257197380066, -0.0433238223195076, 0.04672190919518471, -0.060208067297935486, 0.03698944300413132, -0.054388031363487244, -0.11835022270679474, -0.07253186404705048, -0.04439054802060127, -0.030083797872066498, 0.08834618330001831, -0.02201017178595066, -0.04595445469021797, -0.04...
-0.113657
12. REPO MOVE: GitHub repository moved from jlowin/fastmcp to PrefectHQ/fastmcp. Update git remotes and dependency URLs that reference the old location. 13. BACKGROUND TASKS: FastMCP's background task system (SEP-1686) is now an optional dependency. If the code uses task=True or TaskConfig, add pip install "fastmcp[tas...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/upgrading/from-fastmcp-2.mdx
main
model-context-protocol-fastmcp
[ -0.0846337303519249, -0.022980529814958572, 0.026286015287041664, -0.04724828526377678, -0.018805744126439095, -0.029949650168418884, -0.047848720103502274, -0.0012803822755813599, 0.0037086266092956066, -0.03284839168190956, 0.08029250800609589, -0.0126067278906703, 0.0157452505081892, 0....
-0.024753
server.get\_tools() tool = tools["my\_tool"] # After tools = await server.list\_tools() tool = next((t for t in tools if t.name == "my\_tool"), None) ``` \*\*Prompts use Message class\*\* Prompt functions now use FastMCP's `Message` class instead of `mcp.types.PromptMessage`. The new class is simpler — it accepts a pla...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/upgrading/from-fastmcp-2.mdx
main
model-context-protocol-fastmcp
[ 0.01979786902666092, -0.009742172434926033, 0.07589922100305557, 0.024548809975385666, -0.035463035106658936, -0.03735417500138283, 0.1105489507317543, 0.026523848995566368, -0.044274814426898956, -0.03375621512532234, 0.04458318278193474, -0.0855848491191864, 0.09125255793333054, -0.01394...
-0.00662
[]) # After tags = tool.meta.get("fastmcp", {}).get("tags", []) ``` Metadata is now always included — the `include\_fastmcp\_meta` parameter has been removed from `FastMCP()` and `to\_mcp\_tool()`, so there is no way to suppress it. \*\*Server banner environment variable renamed\*\* `FASTMCP\_SHOW\_CLI\_BANNER` is now ...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/upgrading/from-fastmcp-2.mdx
main
model-context-protocol-fastmcp
[ -0.05986141040921211, 0.1490216851234436, 0.03208678960800171, 0.061124227941036224, 0.023984704166650772, -0.09121805429458618, 0.02204986661672592, -0.08138178288936615, 0.007652341853827238, -0.08573196828365326, 0.05095300078392029, -0.05761018395423889, 0.015879841521382332, -0.034865...
-0.015001
If you've been building MCP servers directly on the `mcp` package's `Server` class — writing `list\_tools()` and `call\_tool()` handlers, hand-crafting JSON Schema dicts, and wiring up transport boilerplate — this guide is for you. FastMCP replaces all of that machinery with a declarative, Pythonic API where your funct...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/upgrading/from-low-level-sdk.mdx
main
model-context-protocol-fastmcp
[ -0.08698225021362305, 0.02027825079858303, 0.07602734118700027, -0.013244805857539177, -0.023776305839419365, -0.06919517368078232, -0.022290565073490143, 0.027446571737527847, -0.06968138366937637, -0.04419539496302605, 0.03928002342581749, -0.06074533984065056, 0.024322424083948135, -0.0...
0.029798
server.run(r, w, ...)` → `mcp.run()` (`stdio` is the default) - SSE/Starlette setup → `mcp.run(transport="sse", host="...", port=...)` - Streamable HTTP setup → `mcp.run(transport="http", host="...", port=...)` - Delete asyncio.run(main()) boilerplate — use `if \_\_name\_\_ == "\_\_main\_\_": mcp.run()` 7. CONTEXT: Rep...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/upgrading/from-low-level-sdk.mdx
main
model-context-protocol-fastmcp
[ -0.0467141754925251, -0.0025564704556018114, -0.05545186623930931, 0.09892215579748154, -0.031306199729442596, -0.09769658744335175, -0.029922477900981903, 0.034247636795043945, -0.05834992229938507, -0.04113886505365372, 0.009851672686636448, -0.08716936409473419, -0.007515190169215202, -...
0.062846
types.ImageContent | ...]`. In FastMCP, return plain Python values — strings, numbers, dicts, lists, dataclasses, Pydantic models — and serialization is handled for you. For images or other non-text content, FastMCP provides helpers: ```python from fastmcp import FastMCP from fastmcp.utilities.types import Image mcp = ...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/upgrading/from-low-level-sdk.mdx
main
model-context-protocol-fastmcp
[ -0.030645223334431648, 0.0029567116871476173, -0.003431636141613126, 0.020061153918504715, -0.00876801647245884, -0.06718375533819199, -0.002941621234640479, 0.07626742869615555, 0.0162773746997118, -0.010233148001134396, 0.04800010472536087, -0.0034658669028431177, 0.08884874731302261, 0....
0.035386
you share the relevant code?", role="assistant"), ] ``` ## Request Context The `Server` class exposes request context through `server.request\_context`, which gives you the raw `ServerSession` for sending notifications. FastMCP replaces this with a typed `Context` object injected into any function that declares it. ```...
https://github.com/jlowin/fastmcp/blob/main/docs/getting-started/upgrading/from-low-level-sdk.mdx
main
model-context-protocol-fastmcp
[ -0.08215413242578506, 0.007259448524564505, 0.018598798662424088, 0.07278908044099808, -0.05532057210803032, -0.14524003863334656, 0.09779180586338043, 0.0017985221929848194, 0.03004811890423298, -0.0405023917555809, 0.012944779358804226, -0.045480284839868546, 0.023960445076227188, 0.0261...
0.095381
import { VersionBadge } from "/snippets/version-badge.mdx"; STDIO transport is perfect for local development and desktop applications. But to unlock the full potential of MCP—centralized services, multi-client access, and network availability—you need remote HTTP deployment. This guide walks you through deploying your ...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/http.mdx
main
model-context-protocol-fastmcp
[ 0.005806921981275082, -0.01955162174999714, 0.023493608459830284, -0.08680209517478943, -0.02045101672410965, -0.007018705829977989, -0.07434887439012527, 0.02404419519007206, -0.05403222143650055, 0.019284140318632126, 0.012059430591762066, -0.029033679515123367, 0.05088772252202034, -0.0...
0.010805
By default, your MCP server is accessible at `/mcp/` on your domain. You can customize this path to fit your URL structure or avoid conflicts with existing endpoints. This is particularly useful when integrating MCP into an existing application or following specific API conventions. ```python # Option 1: With mcp.run()...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.0720977932214737, -0.044498100876808167, 0.0223538875579834, -0.020805099979043007, 0.00168619432952255, -0.09259023517370224, -0.10559988766908646, 0.04762157425284386, 0.0019655984360724688, -0.0034816234838217497, -0.0005853884504176676, 0.027972321957349777, 0.03624521195888519, -0....
-0.025622
(e.g., `["http://localhost:3000"]`) rather than `["\*"]` for production deployments - \*\*`allow\_headers`\*\*: Must include `mcp-protocol-version`, `mcp-session-id`, and `Authorization` (for authenticated servers) - \*\*`expose\_headers`\*\*: Must include `mcp-session-id` so JavaScript can read the session ID from res...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.07206091284751892, 0.09661664068698883, 0.03508138656616211, -0.005021095275878906, 0.01782696321606636, -0.06975935399532318, 0.015218384563922882, 0.008022375404834747, -0.035256173461675644, -0.008452855050563812, -0.03224853426218033, -0.019541192799806595, 0.034800224006175995, 0.0...
0.087937
server app = Starlette( routes=[ Mount("/mcp-server", app=mcp\_app), # Add other routes as needed ], lifespan=mcp\_app.lifespan, ) ``` The MCP endpoint will be available at `/mcp-server/mcp/` of the resulting Starlette app. For Streamable HTTP transport, you \*\*must\*\* pass the lifespan context from the FastMCP app t...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.07580269128084183, -0.030521932989358902, 0.0003006045881193131, 0.02542819455265999, -0.05378543213009834, -0.0759027749300003, -0.031040243804454803, 0.052068907767534256, -0.04463217779994011, 0.017105869948863983, 0.018392445519566536, -0.0220036618411541, 0.03141563758254051, 0.006...
0.00889
FastMCP and the MCP SDK already handle CORS for OAuth routes. If you need CORS on your own application routes, consider using the sub-app pattern: mount FastMCP and your routes as separate apps, each with their own middleware, rather than adding application-wide CORS middleware. ### Route Types OAuth-protected MCP serv...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.08381399512290955, -0.03655647113919258, 0.03883558139204979, -0.05258709937334061, 0.015701917931437492, -0.0673651397228241, -0.0795564278960228, 0.06969548761844635, -0.029258374124765396, -0.016345134004950523, 0.011740691028535366, -0.045061931014060974, 0.013529998250305653, 0.006...
0.007016
pieces together: ```python from fastmcp import FastMCP from fastmcp.server.auth.providers.github import GitHubProvider from starlette.applications import Starlette from starlette.routing import Mount import uvicorn # Define routing structure ROOT\_URL = "http://localhost:8000" MOUNT\_PREFIX = "/api" MCP\_PATH = "/mcp" ...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.06116403266787529, 0.00034847346250899136, -0.005204708781093359, 0.021301114931702614, 0.008140947669744492, -0.09895908832550049, -0.028372835367918015, 0.013832738623023033, 0.0017292031552642584, 0.0027498030103743076, 0.06967870891094208, -0.023900412023067474, 0.08284210413694382, ...
-0.018578
import StaticTokenVerifier # Read configuration from environment auth\_token = os.environ.get("MCP\_AUTH\_TOKEN") if auth\_token: auth = StaticTokenVerifier(tokens={auth\_token: {"sub": "admin", "client\_id": "cli"}}) mcp = FastMCP("Production Server", auth=auth) else: mcp = FastMCP("Production Server") app = mcp.http\...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.09058435261249542, 0.0215380247682333, 0.00224081939086318, -0.005628054495900869, 0.018088947981595993, -0.11064894497394562, -0.031352441757917404, 0.03348992392420769, -0.014245199039578438, -0.02423686534166336, 0.04736317694187164, -0.036580003798007965, 0.07035333663225174, -0.025...
0.009599
proxy\_cache off; # Allow long-lived connections for streaming responses proxy\_read\_timeout 300s; proxy\_send\_timeout 300s; } } ``` Enable the site and reload nginx: ```bash sudo ln -s /etc/nginx/sites-available/fastmcp /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl reload nginx ``` Your FastMCP server is no...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.047747716307640076, -0.02033274993300438, 0.058596253395080566, 0.01994502730667591, -0.04404883831739426, -0.047855038195848465, -0.06251373887062073, -0.04939562454819679, -0.004854937084019184, 0.013300984166562557, -0.04238493740558624, 0.03553236648440361, -0.020423542708158493, -0...
-0.043789
import { VersionBadge } from '/snippets/version-badge.mdx' FastMCP servers can be run in different ways depending on your needs. This guide focuses on running servers locally for development and testing. For production deployment to a URL, see the [HTTP Deployment](/deployment/http) guide. ## The `run()` Method Every F...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/running-server.mdx
main
model-context-protocol-fastmcp
[ -0.04679770767688751, 0.0005410125013440847, 0.009891824796795845, -0.02249356359243393, -0.011893928982317448, -0.06240193173289299, -0.06552588939666748, -0.0352945439517498, -0.0643470510840416, -0.033520832657814026, 0.05525048449635506, 0.02042601816356182, 0.09828843176364899, -0.048...
-0.069586
SSE Transport (Legacy) Server-Sent Events (SSE) transport was the original HTTP-based transport for MCP. While still supported for backward compatibility, it has limitations compared to the newer Streamable HTTP transport. SSE only supports server-to-client streaming, making it less efficient for bidirectional communic...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/running-server.mdx
main
model-context-protocol-fastmcp
[ -0.034386683255434036, -0.03610168397426605, 0.007414419203996658, 0.023392805829644203, -0.04483618587255478, -0.07700341194868088, -0.04394128918647766, 0.08261242508888245, -0.03573164716362953, -0.015235011465847492, -0.07674303650856018, -0.007293364964425564, -0.003212394192814827, 0...
0.101879
does not support auto-reload due to session limitations. Use HTTP transport instead if you need both network access and auto-reload. ### Async Usage FastMCP servers are built on async Python, but the framework provides both synchronous and asynchronous APIs to fit your application's needs. The `run()` method we've been...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/running-server.mdx
main
model-context-protocol-fastmcp
[ -0.06501339375972748, 0.009452844969928265, -0.01583275757730007, 0.0629606619477272, -0.12717115879058838, -0.06740931421518326, -0.029510008171200752, -0.01658945530653, -0.02812887541949749, -0.056246306747198105, -0.013340217061340809, 0.018675079569220543, 0.0011720909969881177, -0.01...
0.020914
[Prefect Horizon](https://www.prefect.io/horizon) is a platform for deploying and managing MCP servers. Built by the FastMCP team at [Prefect](https://www.prefect.io), Horizon provides managed hosting, authentication, access control, and a registry of MCP capabilities. Horizon includes a \*\*free personal tier for Fast...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/prefect-horizon.mdx
main
model-context-protocol-fastmcp
[ 0.007290421519428492, -0.012060856446623802, -0.02182963117957115, -0.06854763627052307, 0.04632595553994179, -0.038523685187101364, -0.010834850370883942, -0.020759493112564087, 0.05956970155239105, 0.060121241956949234, -0.03775511682033539, -0.010705167427659035, 0.03566964343190193, -0...
0.164279
so you can test changes before they go live. ## Testing Your Server Horizon provides two ways to verify your server is working before connecting external clients. ### Inspector The Inspector gives you a structured view of everything your server exposes—tools, resources, and prompts. You can click any tool, fill in the ...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/prefect-horizon.mdx
main
model-context-protocol-fastmcp
[ -0.039462752640247345, -0.04630874842405319, 0.0366988331079483, -0.010664108209311962, 0.00805103499442339, -0.09854196012020111, -0.035229649394750595, -0.03892376646399498, 0.04709417745471001, 0.04836145043373108, -0.019576560705900192, -0.02111678756773472, -0.07354480773210526, -0.00...
0.080267
This guide is for deployments where an agent runs inside an isolated container, subprocess, or remote worker and still needs MCP access. In that setup, the sandbox itself becomes part of your trust boundary. The core recommendation is simple: use FastMCP as the capability boundary. Run a remote FastMCP server, authenti...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/sandboxed-agents.mdx
main
model-context-protocol-fastmcp
[ 0.044775694608688354, -0.015001286752521992, 0.005783937871456146, -0.05595110356807709, -0.0281626358628273, 0.012413320131599903, -0.048798177391290665, 0.01564820483326912, -0.029695086181163788, -0.0370512455701828, 0.013209664262831211, -0.05541929230093956, 0.06729704886674881, -0.03...
0.028921
Tools") if \_\_name\_\_ == "\_\_main\_\_": mcp.run(transport="http", host="0.0.0.0", port=8000) ``` For production transport setup, see [HTTP Deployment](/deployment/http). ## Use Short-Lived, Scoped Credentials For sandboxed agents, it is usually cleaner to issue credentials for the sandbox session than to place long-...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/sandboxed-agents.mdx
main
model-context-protocol-fastmcp
[ -0.030118949711322784, 0.035708073526620865, 0.0044628530740737915, -0.034631598740816116, -0.007707866840064526, -0.05024159327149391, -0.02659437246620655, -0.023734305053949356, -0.00918140821158886, -0.04455634579062462, 0.018394816666841507, -0.06363474577665329, 0.05910540372133255, ...
-0.014859
Typical examples: - a sandbox-safe MCP gateway in front of internal MCP servers - a FastMCP layer in front of internal HTTP APIs - a job-scoped server that fronts a Git provider, issue tracker, or storage system If the upstream system is itself an MCP server, FastMCP's proxy support is a natural fit. See [MCP Proxy](/s...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/sandboxed-agents.mdx
main
model-context-protocol-fastmcp
[ -0.04125503823161125, 0.03345579281449318, 0.03939810395240784, -0.01163917500525713, -0.03194441273808479, 0.0092071034014225, -0.03059348650276661, 0.0008934541256166995, 0.002859251108020544, 7.543885089944524e-7, -0.0020494700875133276, 0.008038981817662716, 0.05540682002902031, -0.013...
0.032502
import { VersionBadge } from "/snippets/version-badge.mdx" FastMCP supports declarative configuration through `fastmcp.json` files. This is the canonical and preferred way to configure FastMCP projects, providing a single source of truth for server settings, dependencies, and deployment options that replaces complex co...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/server-configuration.mdx
main
model-context-protocol-fastmcp
[ -0.05678883567452431, 0.04244085028767586, 0.013446448370814323, -0.08198447525501251, 0.03140777349472046, -0.018232671543955803, -0.06788891553878784, -0.0036320944782346487, -0.023261046037077904, -0.06757824122905731, 0.04910632222890854, 0.027776487171649933, 0.0604514554142952, -0.02...
0.000132
`mcp`, `server`, or `app` \*\*Example:\*\* ```json "source": { "type": "filesystem", "path": "src/server.py", "entrypoint": "mcp" } ``` Note: File paths are resolved relative to the configuration file's location. \*\*Future Source Types\*\* Future releases will support additional source types: - \*\*Git repositories\*\...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/server-configuration.mdx
main
model-context-protocol-fastmcp
[ -0.08908572047948837, -0.048047471791505814, 0.017633624374866486, 0.006328991148620844, 0.0044464245438575745, -0.10222548246383667, -0.06916215270757675, 0.06582919508218765, 0.0008135121897794306, 0.03270470350980759, 0.0061912741512060165, 0.023600826039910316, 0.04947283864021301, -0....
0.05412
number for HTTP transport. URL path for the MCP endpoint when using HTTP transport. Server logging verbosity. Options: - `"DEBUG"`: Detailed debugging information - `"INFO"`: General informational messages - `"WARNING"`: Warning messages - `"ERROR"`: Error messages only - `"CRITICAL"`: Critical errors only Environment ...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/server-configuration.mdx
main
model-context-protocol-fastmcp
[ 0.020929740741848946, -0.04095714911818504, -0.05733116343617439, 0.023609044030308723, -0.03676458075642586, -0.05087124556303024, 0.015138981863856316, 0.05960429087281227, 0.0038100627716630697, 0.025503549724817276, -0.05146811157464981, -0.008866687305271626, -0.03769814223051071, -0....
0.021306
run fastmcp.json --skip-source ``` \*\*When you already have the source:\*\* - You've previously cloned a git repository and don't need to re-fetch - You have a cached copy of a cloud-hosted server - You're in a CI/CD pipeline where source checkout is a separate step - You're iterating locally on already-downloaded cod...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/server-configuration.mdx
main
model-context-protocol-fastmcp
[ -0.07021865993738174, -0.017290962859988213, 0.02182278409600258, -0.0012929548975080252, 0.03738640621304512, -0.08124610036611557, -0.0526689775288105, -0.039491456001996994, 0.0210234634578228, 0.023764800280332565, 0.11002086848020554, -0.021961720660328865, 0.029634995386004448, -0.10...
-0.106412
"source": { "path": "server.py", "entrypoint": "mcp" }, "deployment": { "transport": "http", "log\_level": "DEBUG" } } ``` \*\*prod.fastmcp.json\*\*: ```json { "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json", "source": { "path": "server.py", "entrypoint": "mcp" }, "environment": { "requirements":...
https://github.com/jlowin/fastmcp/blob/main/docs/deployment/server-configuration.mdx
main
model-context-protocol-fastmcp
[ -0.014473510906100273, 0.027951207011938095, -0.022812068462371826, -0.05454987287521362, 0.05341954901814461, -0.05534542351961136, -0.02562348172068596, 0.02825453318655491, -0.009542207233607769, -0.003727075643837452, 0.09926677495241165, -0.08910824358463287, 0.023693140596151352, 0.0...
-0.055315
You've built a powerful REST API, and now you want your LLM to be able to use it. Manually writing a wrapper function for every single endpoint is tedious, error-prone, and hard to maintain. This is where \*\*FastMCP\*\* shines. If your API has an OpenAPI (or Swagger) specification, FastMCP can automatically convert yo...
https://github.com/jlowin/fastmcp/blob/main/docs/tutorials/rest-api.mdx
main
model-context-protocol-fastmcp
[ -0.024709336459636688, -0.03489954024553299, 0.016149315983057022, -0.005340689793229103, -0.01208984199911356, -0.03131586313247681, -0.11730093508958817, 0.041040100157260895, -0.061338990926742554, 0.022948164492845535, -0.012868515215814114, -0.05577535554766655, 0.06865940243005753, -...
0.109255
python api\_server.py ``` Then, in another terminal, run the client: ```bash python api\_client.py ``` You should see a list of generated tools (`get\_users`, `get\_user\_by\_id`) and the result of calling the `get\_user\_by\_id` tool, which fetches data from the live JSONPlaceholder API. ![](/assets/images/tutorial-re...
https://github.com/jlowin/fastmcp/blob/main/docs/tutorials/rest-api.mdx
main
model-context-protocol-fastmcp
[ -0.05248037725687027, 0.03894644230604172, -0.01682472974061966, 0.01042888406664133, -0.026890819892287254, -0.0830707848072052, -0.015624302439391613, 0.035753123462200165, -0.03049125149846077, -0.030782543122768402, 0.024991650134325027, 0.045939862728118896, 0.05193803459405899, -0.01...
0.047659
So you want to build a Model Context Protocol (MCP) server in Python. The goal is to create a service that can provide tools and data to AI models like Claude, Gemini, or others that support the protocol. While the [MCP specification](https://modelcontextprotocol.io/specification/) is powerful, implementing it from scr...
https://github.com/jlowin/fastmcp/blob/main/docs/tutorials/create-mcp-server.mdx
main
model-context-protocol-fastmcp
[ -0.07321492582559586, -0.0333697572350502, -0.003843924030661583, 0.005192381329834461, -0.07036164402961731, -0.07807992398738861, -0.016776002943515778, 0.029269812628626823, -0.04862270876765251, -0.01884356141090393, -0.04070906713604927, 0.007867416366934776, 0.05017644166946411, -0.0...
0.132252
MCP Server") @mcp.tool def add(a: int, b: int) -> int: """Adds two integer numbers together.""" return a + b @mcp.resource("resource://config") def get\_config() -> dict: """Provides the application's configuration.""" return {"version": "1.0", "author": "MyTeam"} @mcp.resource("greetings://{name}") def personalized\_g...
https://github.com/jlowin/fastmcp/blob/main/docs/tutorials/create-mcp-server.mdx
main
model-context-protocol-fastmcp
[ -0.08402327448129654, 0.06588264554738998, 0.035610198974609375, 0.012119506485760212, -0.10635723173618317, -0.06369150429964066, 0.06930767744779587, 0.025383276864886284, 0.000606238900218159, -0.0852569192647934, -0.017099158838391304, -0.019595513120293617, 0.10997587442398071, -0.021...
0.048675
The Model Context Protocol (MCP) is an open standard designed to solve a fundamental problem in AI development: how can Large Language Models (LLMs) reliably and securely interact with external tools, data, and services? It's the \*\*bridge between the probabilistic, non-deterministic world of AI and the deterministic,...
https://github.com/jlowin/fastmcp/blob/main/docs/tutorials/mcp.mdx
main
model-context-protocol-fastmcp
[ -0.06676430255174637, -0.06035556644201279, 0.04411671310663223, -0.02895773947238922, 0.039173293858766556, -0.016467895358800888, -0.042370788753032684, 0.026535069569945335, 0.045362405478954315, -0.01896033249795437, -0.04815435782074928, -0.056112855672836304, 0.06059947609901428, 0.0...
0.274206
dict: """Returns the current operational status of the service.""" return {"status": "all systems normal"} ``` #### Resource Templates You can also create \*\*Resource Templates\*\* for dynamic data. A client could request `users://42/profile` to get the profile for a specific user. ```python from fastmcp import FastMC...
https://github.com/jlowin/fastmcp/blob/main/docs/tutorials/mcp.mdx
main
model-context-protocol-fastmcp
[ -0.038910675793886185, 0.061905842274427414, -0.03061450645327568, 0.02058812417089939, -0.056387972086668015, -0.09974107891321182, 0.1329231858253479, 0.08268451690673828, -0.04510919749736786, -0.06702225655317307, 0.02841925621032715, -0.0235909316688776, 0.09435894340276718, 0.0057501...
0.020735
import { YouTubeEmbed } from '/snippets/youtube-embed.mdx' ## Join the Community Connect with other FastMCP developers, share your projects, and discuss ideas. ## Featured Projects Discover exemplary MCP servers and implementations created by our community. These projects demonstrate best practices and innovative uses ...
https://github.com/jlowin/fastmcp/blob/main/docs/community/showcase.mdx
main
model-context-protocol-fastmcp
[ -0.08926297724246979, -0.09396620839834213, 0.017036456614732742, -0.04383215308189392, 0.005501429084688425, -0.02955957129597664, -0.03355134278535843, -0.01973174884915352, -0.05511759966611862, -0.0048024277202785015, 0.00588754890486598, 0.036754921078681946, 0.048115216195583344, 0.0...
0.031294
import { VersionBadge } from '/snippets/version-badge.mdx' Each tile below is a working FastMCP server you can run with `fastmcp dev apps` or connect to from any MCP host. Source lives in `examples/apps/` in the repository. ## Running the examples Preview any example in your browser with the dev server: ```bash pip ins...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/examples.mdx
main
model-context-protocol-fastmcp
[ -0.015681089833378792, -0.017038144171237946, -0.011377527378499508, -0.05403648316860199, 0.01684122160077095, -0.021252112463116646, -0.02367245964705944, 0.03368352726101875, -0.0024808200541883707, -0.017584720626473427, -0.0037920286413282156, -0.051571909338235855, 0.08206778764724731,...
-0.003336
import { VersionBadge } from '/snippets/version-badge.mdx' import PrefabPinWarning from '/snippets/prefab-pin-warning.mdx' import { PrefabDemoFrame } from '/snippets/prefab-demo-frame.mdx' Believe it or not, that dashboard is a FastMCP tool. The chart has tooltips. The table is sortable. The badges are styled by deal s...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/prefab.mdx
main
model-context-protocol-fastmcp
[ -0.08501047641038895, 0.04086276516318321, -0.006311880424618721, -0.024143502116203308, 0.05223963409662247, 0.01628265157341957, -0.0013635122450068593, 0.025726620107889175, 0.008393415249884129, -0.04581526294350624, -0.011355288326740265, 0.023464394733309746, 0.08409542590379715, -0....
0.019921
"$52,000", "stage": "Negotiation"}, {"account": "Initech", "value": "$31,500", "stage": "Proposal"}, {"account": "Wayne Enterprises", "value": "$45,000", "stage": "Lost"}, ] rows = [ { "account": d["account"], "value": d["value"], "stage": Badge( d["stage"], variant="success" if d["stage"] == "Won" else "destructive" i...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/prefab.mdx
main
model-context-protocol-fastmcp
[ 0.016693251207470894, 0.1078907921910286, -0.035074640065431595, -0.03271089866757393, -0.0692080557346344, 0.11334434151649475, 0.01936877891421318, 0.03289292752742767, 0.06760454922914505, 0.06202378496527672, -0.017317673191428185, -0.12055357545614243, 0.009883041493594646, -0.0368204...
0.006552
series=[ChartSeries(data\_key="revenue")]) return ToolResult( content=f"Total revenue for {year}: ${total:,} across {len(data)} quarters", structured\_content=view, ) ``` The user sees the chart. The model sees the summary. ## Next steps - \*\*[FastMCPApp](/apps/fastmcp-app)\*\* — when your UI needs to call backend too...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/prefab.mdx
main
model-context-protocol-fastmcp
[ -0.015591798350214958, 0.001462064916267991, -0.007351409178227186, 0.03386402502655983, -0.033840544521808624, 0.05189378932118416, -0.10698726028203964, 0.07374712079763412, 0.03327115625143051, -0.012316525913774967, 0.01072736456990242, -0.10039467364549637, 0.03938079625368118, -0.057...
-0.006541
import { VersionBadge } from '/snippets/version-badge.mdx' import PrefabPinWarning from '/snippets/prefab-pin-warning.mdx' import { PrefabDemoFrame } from '/snippets/prefab-demo-frame.mdx' A FastMCP app is a tool that returns an interactive UI instead of text. When the host calls it, the user sees a chart, a table, a f...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/overview.mdx
main
model-context-protocol-fastmcp
[ -0.07859277725219727, 0.020820902660489082, 0.011191748082637787, -0.005358769092708826, 0.08191879093647003, 0.024575892835855484, 0.009016943164169788, 0.01722947508096695, 0.021500831469893456, -0.06935083866119385, -0.023392587900161743, 0.010306067764759064, 0.06308922171592712, -0.00...
0.054635
import { VersionBadge } from '/snippets/version-badge.mdx' Everything on this page is for when you want full control: your own HTML, your own JavaScript framework, a map library, a 3D viewer, custom video playback. [Interactive Tools](/apps/prefab) wrap the MCP Apps extension so you never have to think about it — this ...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/low-level.mdx
main
model-context-protocol-fastmcp
[ -0.054833944886922836, -0.024551846086978912, 0.032714638859033585, -0.03925821930170059, 0.08785814791917801, 0.03567615523934364, 0.004103215876966715, 0.037943921983242035, -0.004486168269068003, -0.013341067358851433, 0.017993055284023285, -0.05569863319396973, 0.005893446039408445, -0...
0.04901
the host using the [`@modelcontextprotocol/ext-apps`](https://github.com/modelcontextprotocol/ext-apps) JavaScript SDK. The simplest approach is to load it from a CDN: ```html import { App } from "https://unpkg.com/@modelcontextprotocol/ext-apps@0.4.0/app-with-deps"; const app = new App({ name: "My App", version: "1.0....
https://github.com/jlowin/fastmcp/blob/main/docs/apps/low-level.mdx
main
model-context-protocol-fastmcp
[ -0.0584200955927372, 0.024134395644068718, -0.05796586349606514, 0.07670503854751587, 0.032554443925619125, -0.05472719296813011, -0.05825309455394745, 0.12263495475053787, 0.05376383289694786, 0.004890256095677614, 0.0332418754696846, -0.09157047420740128, 0.000926208624150604, -0.0153594...
0.027063
SDK from unpkg (declared in the CSP), listens for tool results, and renders the image. The host wires them together — when the LLM calls `generate\_qr`, the QR code appears in an interactive frame inside the conversation. ## Checking client support Not all hosts support the Apps extension. You can check at runtime usin...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/low-level.mdx
main
model-context-protocol-fastmcp
[ -0.09657122939825058, 0.053930241614580154, -0.02416514791548252, 0.023465119302272797, 0.04126102104783058, -0.09912469238042831, -0.041347913444042206, -0.009904774837195873, 0.07203646749258041, -0.05818768963217735, 0.04412558302283287, -0.11519603431224823, 0.05001440271735191, -0.004...
-0.009741
import { VersionBadge } from '/snippets/version-badge.mdx' You don't need this page to build apps. It's for when something isn't rendering the way you expect, when UI tool calls aren't reaching your server, or when you're writing [custom HTML apps](/apps/low-level) and need to understand the protocol directly. ## The p...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/architecture.mdx
main
model-context-protocol-fastmcp
[ -0.07544363290071487, 0.007351011969149113, 0.057316411286592484, -0.027209646999835968, 0.03999760374426842, -0.053809985518455505, -0.07525116205215454, 0.013073710724711418, -0.01661340706050396, -0.04940846562385559, 0.015923837199807167, -0.02820575423538685, 0.03146757185459137, -0.0...
0.013755
server sees this tag and routes the call through a special path that bypasses transforms (below). ### ToolResult assembly The final tool result has two parts: `content` (a list of `TextContent` blocks for the LLM) and `structuredContent` (the JSON tree for the renderer). By default, Prefab tools send `"[Rendered Prefab...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/architecture.mdx
main
model-context-protocol-fastmcp
[ -0.08603429794311523, -0.01888684555888176, -0.02379465475678444, 0.05885893851518631, -0.038079727441072464, -0.032670844346284866, -0.048348307609558105, 0.023126037791371346, 0.05154074728488922, 0.016605203971266747, 0.01628910005092621, -0.05227752402424812, -0.00674486206844449, -0.0...
0.003933
it internally; you only touch it directly when building [custom HTML apps](/apps/low-level). ## The dev server `fastmcp dev apps` simulates the host-side behavior locally without a real MCP client. ### Proxy architecture Two HTTP servers. Your MCP server runs on port 8000 with the Streamable HTTP transport. The dev UI ...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/architecture.mdx
main
model-context-protocol-fastmcp
[ -0.09041968733072281, -0.03599471226334572, 0.10330359637737274, -0.023278217762708664, 0.03634827956557274, -0.0608161985874176, -0.034710679203271866, 0.003072887659072876, 0.04686667025089264, -0.007393110077828169, 0.02637777291238308, 0.05011068657040596, -0.004614607430994511, -0.037...
0.039776
import { VersionBadge } from '/snippets/version-badge.mdx' import PrefabPinWarning from '/snippets/prefab-pin-warning.mdx' import { PrefabDemoFrame } from '/snippets/prefab-demo-frame.mdx' Search a list, fill out a form, click save, the list updates. That pattern — UI that reads and writes data on the server — needs tw...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/fastmcp-app.mdx
main
model-context-protocol-fastmcp
[ -0.13806383311748505, -0.012284324504435062, -0.0000670130830258131, -0.004817163106054068, -0.004014163743704557, 0.017000360414385796, 0.027834899723529816, 0.03995509073138237, -0.03868027403950691, -0.002944930922240019, 0.008862142451107502, 0.003684371942654252, 0.051100652664899826, ...
0.077176
list\_contacts() -> list[dict]: """Both the model and the UI can call this.""" return list(db) ``` Backend tools support `name`, `description`, `auth`, and `timeout`. ## `CallTool` — UI → backend `CallTool` is how the UI invokes a backend tool. Pass the tool's name (or a direct function reference): ```python from prefa...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/fastmcp-app.mdx
main
model-context-protocol-fastmcp
[ -0.1579296588897705, -0.013757743872702122, -0.05761747062206268, 0.07020203769207001, -0.08445928245782852, -0.03841578587889671, 0.04298454895615578, 0.08144235610961914, 0.009538289159536362, -0.004823845345526934, -0.030643345788121223, -0.021889979019761086, 0.01939362660050392, -0.01...
0.112553
app works the same whether standalone or mounted. ### Mounting `FastMCPApp` is a Provider. Add it to a server with `providers=` or `add\_provider`: ```python mcp = FastMCP("Platform", providers=[app]) # or mcp = FastMCP("Platform") mcp.add\_provider(app) ``` Multiple apps can coexist; each gets its own global keys, so ...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/fastmcp-app.mdx
main
model-context-protocol-fastmcp
[ -0.054114677011966705, -0.04350554570555687, 0.02524094097316265, -0.020750263705849648, -0.02788972482085228, -0.13670389354228973, -0.03516443073749542, 0.06871046125888824, 0.05597347766160965, -0.02911875955760479, 0.11340382695198059, -0.0472273975610733, 0.1053205206990242, -0.062587...
-0.03566
import { VersionBadge } from '/snippets/version-badge.mdx' import { PrefabDemoFrame } from '/snippets/prefab-demo-frame.mdx' By the end of this page, you'll have a working tool that returns this: A pie chart the user can hover, a table they can sort and search — and a single Python tool. ## Install ```bash pip install ...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/quickstart.mdx
main
model-context-protocol-fastmcp
[ -0.03729016333818436, 0.005879106931388378, 0.0035535674542188644, -0.00872202031314373, -0.013931356370449066, 0.01329281460493803, 0.016336573287844658, 0.029840528964996338, -0.03735479339957237, -0.006896845065057278, 0.04156353697180748, -0.032433751970529556, 0.07797227054834366, -0....
0.007505
c} for o, c in Counter(m["office"] for m in MEMBERS).items() ] @mcp.tool(app=True) def team\_directory() -> PrefabApp: """Browse the team directory.""" with PrefabApp(state={"selected": None}) as app: with Column(gap=4, css\_class="p-6"): with Grid(columns=[1, 2], gap=4): PieChart( data=OFFICE\_COUNTS, data\_key="count...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/quickstart.mdx
main
model-context-protocol-fastmcp
[ 0.06876520812511444, 0.006666818168014288, 0.018815426155924797, 0.07354903221130371, -0.051678646355867386, 0.08208223432302475, 0.05724329501390457, -0.011677619069814682, 0.011838654987514019, -0.016117218881845474, 0.055521752685308456, -0.06217989698052406, 0.06713956594467163, -0.047...
-0.095812
import { VersionBadge } from '/snippets/version-badge.mdx' `fastmcp dev apps` gives you a browser preview for your app tools without needing an MCP host client. It starts your server and a local dev UI side by side: you pick a tool, fill in its arguments, and the rendered result opens in a new tab. Works with both [Int...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/development.mdx
main
model-context-protocol-fastmcp
[ -0.039002254605293274, -0.02902539074420929, 0.06246444955468178, -0.02485349215567112, 0.0684320256114006, -0.03275186941027641, -0.09177815169095993, -0.013569974340498447, 0.0051371208392083645, 0.005414188839495182, 0.01596716046333313, 0.004240678157657385, 0.036028988659381866, -0.03...
-0.019338
import { VersionBadge } from '/snippets/version-badge.mdx' With Generative UI, the LLM writes the UI code at runtime. Instead of calling a pre-built tool with a fixed shape, the model writes Prefab Python tailored to the current data and request. The user watches the UI stream in as the model generates it. ```python fr...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/generative.mdx
main
model-context-protocol-fastmcp
[ -0.07677622139453888, -0.027710989117622375, 0.03009158745408058, 0.02565727010369301, 0.04103876277804375, -0.00009198839688906446, -0.05125484988093376, -0.010492012836039066, -0.02077125385403633, -0.04265078902244568, 0.005954397842288017, -0.061882708221673965, 0.03531581908464432, -0...
0.029068
limitations The Pyodide sandbox includes the Python standard library and Prefab. External packages (NumPy, pandas, requests, etc.) are \*\*not available\*\* — the LLM's code must work with only built-in Python and Prefab. If the LLM imports something unavailable, the sandbox raises `ImportError`. ## Next steps - \*\*[I...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/generative.mdx
main
model-context-protocol-fastmcp
[ -0.04137303680181503, -0.04745597392320633, 0.010545002296566963, -0.0316321924328804, 0.07624246180057526, -0.017377210780978203, -0.07675663381814957, 0.008396766148507595, -0.07750902324914932, 0.012790580280125141, 0.06521948426961899, -0.023608557879924774, -0.0019334119278937578, 0.0...
0.014446
import { VersionBadge } from '/snippets/version-badge.mdx' `Approval` adds a human-in-the-loop confirmation step to any server. The LLM presents what it's about to do, the user approves or rejects via buttons, and the decision flows back into the conversation as a message. ```python from fastmcp import FastMCP from fas...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/providers/approval.mdx
main
model-context-protocol-fastmcp
[ -0.0882491022348404, 0.004483753815293312, 0.05609964579343796, 0.007298081181943417, 0.07395659387111664, -0.04879693686962128, 0.06807052344083786, -0.016438685357570648, 0.072321318089962, -0.006413341499865055, 0.008251999504864216, -0.04879116639494896, 0.061913248151540756, -0.046672...
0.048174
import { VersionBadge } from '/snippets/version-badge.mdx' `FormInput` generates a validated form from a Pydantic model. The user fills it out, and the submission is validated against the model before being returned. Structured elicitation that can't be hallucinated. ```python from typing import Literal from pydantic i...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/providers/form.mdx
main
model-context-protocol-fastmcp
[ -0.06728018820285797, 0.04116564244031906, 0.019080379977822304, 0.025724589824676514, -0.05326135456562042, 0.027984946966171265, -0.005608689039945602, 0.0433356836438179, -0.043684106320142746, -0.032403986901044846, 0.04617953673005104, -0.05300568789243698, 0.1467973291873932, -0.0459...
0.028252
import { VersionBadge } from '/snippets/version-badge.mdx' `FileUpload` adds drag-and-drop file upload to any server. Users upload files through an interactive UI, bypassing the LLM context window entirely. The LLM can then list and read uploaded files through model-visible tools. ```python from fastmcp import FastMCP ...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/providers/file-upload.mdx
main
model-context-protocol-fastmcp
[ -0.07516302168369293, -0.015817105770111084, -0.03018951788544655, 0.026188965886831284, 0.08801841735839844, 0.00047768049989826977, -0.023611122742295265, 0.05364162102341652, -0.01944640651345253, 0.03836628422141075, 0.056866247206926346, 0.007353801280260086, 0.08494849503040314, -0.0...
0.022681
`name`, `type`, `size`, `size\_display`, and `uploaded\_at` fields — these populate the file list in the UI. `on\_read` returns a dict with file metadata and either `content` (decoded text) or `content\_base64` (a base64 preview for binary files).
https://github.com/jlowin/fastmcp/blob/main/docs/apps/providers/file-upload.mdx
main
model-context-protocol-fastmcp
[ -0.031793270260095596, 0.02563532441854477, -0.09921658784151077, 0.04143383726477623, 0.06809253990650177, -0.06032191589474678, 0.04776105284690857, 0.08325353264808655, 0.03804268687963486, 0.004847575444728136, 0.0474388487637043, 0.08063659816980362, -0.0057536098174750805, -0.0313961...
0.149382
import { VersionBadge } from '/snippets/version-badge.mdx' `Choice` lets the LLM present a set of options as clickable buttons instead of asking the user to type a response. The selection flows back into the conversation as a message, giving the LLM clean structured input. ```python from fastmcp import FastMCP from fas...
https://github.com/jlowin/fastmcp/blob/main/docs/apps/providers/choice.mdx
main
model-context-protocol-fastmcp
[ -0.06119700148701668, -0.022551279515028, 0.03193643316626549, 0.029061852023005486, 0.04534514620900154, -0.024844413623213768, 0.07644704729318619, -0.01718696765601635, 0.01070974301546812, -0.02059079520404339, 0.018912361934781075, -0.015667838975787163, 0.06950271874666214, -0.022965...
0.029227
import { VersionBadge } from '/snippets/version-badge.mdx' Tools are the core building blocks that allow your LLM to interact with external systems, execute code, and access data that isn't in its training data. In FastMCP, tools are Python functions exposed to LLMs through the MCP protocol. Tools in FastMCP transform ...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.059229686856269836, 0.02127411589026451, 0.004243445582687855, -0.03944733366370201, 0.03576663136482239, -0.06601358205080032, -0.025976596400141716, -0.022292889654636383, -0.03294986113905907, -0.039091117680072784, 0.007772992365062237, 0.02589586190879345, 0.11112925410270691, -0.0...
0.059946
true, this tool may interact with an "open world" of external entities. If false, the tool's domain of interaction is closed. Optional meta information about the tool. This data is passed through to the MCP client as the `meta` field of the client-side tool object and can be used for custom metadata, versioning, or oth...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.08706416934728622, -0.00027332574245519936, -0.004105346277356148, 0.04298108071088791, 0.0666269063949585, -0.07732255011796951, -0.07819154858589172, -0.052005331963300705, 0.04074648767709732, -0.025055868551135063, 0.06530813127756119, 0.006279366556555033, 0.010407785885035992, -0....
0.069931
w in desktop.GetChildren()[:5]] ``` The tradeoff is that the event loop is blocked for the duration of the call — other in-flight requests wait until the tool returns. Keep `run\_in\_thread=False` reserved for tools that genuinely need thread affinity, and prefer short-running calls in that path. Inline sync calls have...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.09083256870508194, -0.007012404967099428, 0.0509323850274086, 0.05242222175002098, 0.045458804816007614, -0.051291324198246, 0.0037665031850337982, -0.04662536829710007, 0.040623974055051804, -0.07150549441576004, 0.07932183146476746, -0.01875343918800354, -0.052622973918914795, -0.0627...
-0.016366
function parameter conventions. Parameters without default values are required, while those with default values are optional. ```python @mcp.tool def search\_products( query: str, # Required - no default value max\_results: int = 10, # Optional - has default value sort\_by: str = "relevance", # Optional - has default v...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.03563835844397545, 0.008864175528287888, 0.020842591300606728, -0.012813625857234001, -0.03609404340386391, 0.0009602710488252342, -0.010217373259365559, 0.07609651982784271, -0.02777431719005108, -0.07954969257116318, 0.08492574840784073, 0.02692660130560398, 0.05567456781864166, 0.003...
-0.05243
via `Annotated[x, "..."]` or `Field(description=...)` — that description takes precedence over the docstring. This makes it safe to adopt docstring-based descriptions incrementally: existing annotations keep working, and docstrings fill in the gaps. #### Simple String Descriptions For basic parameter descriptions, you ...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tools.mdx
main
model-context-protocol-fastmcp
[ 0.0007214994402602315, 0.10704714059829712, 0.04790107160806656, 0.0227210596203804, 0.04858763515949249, -0.04583331570029259, 0.03686533123254776, 0.10630550980567932, 0.0009360132971778512, -0.038008660078048706, -0.02243710123002529, -0.009531591087579727, 0.06030837073922157, 0.077126...
0.093455
\*\*MCP SDK content blocks\*\*: Sent as-is - \*\*A list of any of the above\*\*: Converts each item according to the above rules - \*\*`None`\*\*: Results in an empty response #### Media Helper Classes FastMCP provides helper classes for returning images, audio, and files. When you return one of these classes, either d...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.04444490000605583, -0.004049197770655155, 0.023212499916553497, -0.001063937321305275, 0.0923498347401619, -0.04714316129684448, -0.010300897061824799, 0.004483579192310572, 0.011374800466001034, -0.0555310919880867, 0.04474382475018501, -0.05500442907214165, 0.07103376090526581, 0.0063...
0.010466
"content": [ { "type": "text", "text": "8" } ] } ``` When you add a return annotation, such as `-> int`, FastMCP generates `structuredContent` by wrapping the primitive value in a `{"result": ...}` object, since JSON schemas require object-type roots for structured output: ```python Tool Definition @mcp.tool def calcul...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.061072904616594315, 0.06339442729949951, 0.04527047276496887, 0.046358443796634674, -0.03848715126514435, -0.012536967173218727, -0.01785779371857643, 0.019206050783395767, 0.02295202575623989, -0.03640430420637131, 0.04701627045869827, -0.05164413899183273, 0.027944330126047134, 0.0855...
0.03717
"""Tool with full control over output.""" return ToolResult( content=[TextContent(type="text", text="Human-readable summary")], structured\_content={"data": "value", "count": 42}, meta={"execution\_time\_ms": 145} ) ``` `ToolResult` accepts three fields: \*\*`content`\*\* - The traditional MCP content blocks that clien...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.01080351509153843, 0.026720579713582993, -0.03683413937687874, 0.10264987498521805, -0.04632383957505226, -0.02099466882646084, 0.020084265619516373, 0.10469990223646164, -0.0029767178930342197, -0.04045095667243004, 0.0328211709856987, -0.073409803211689, 0.09138806909322739, 0.0293642...
0.053846
will be converted to a generic message. ## Timeouts Tools can specify a `timeout` parameter to limit how long execution can take. When the timeout is exceeded, the client receives an MCP error and the tool stops processing. This protects your server from unexpectedly slow operations that could block resources or leave ...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.09871578961610794, 0.07105103135108948, -0.033147405833005905, 0.08096054941415787, -0.0035873213782906532, -0.12742459774017334, -0.08909403532743454, -0.04525187984108925, 0.04368673264980316, -0.03106934390962124, 0.05981070548295975, 0.0517505444586277, 0.029022784903645515, -0.1024...
0.052525
a + b ``` FastMCP supports these standard annotations: | Annotation | Type | Default | Purpose | | :--------- | :--- | :------ | :------ | | `title` | string | - | Display name for user interfaces | | `readOnlyHint` | boolean | false | Indicates if the tool only reads without making changes | | `destructiveHint` | bool...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.10232456028461456, 0.009465894661843777, -0.0009344917489215732, -0.016665605828166008, 0.002707574050873518, -0.02970297448337078, 0.09009811282157898, 0.007857244461774826, 0.02785813994705677, -0.022144466638565063, 0.04418059438467026, -0.08440984785556793, 0.05359683930873871, -0.0...
0.149242
add a parameter to your tool function with the type hint `Context`. ```python from fastmcp import FastMCP, Context mcp = FastMCP(name="ContextDemo") @mcp.tool async def process\_data(data\_uri: str, ctx: Context) -> dict: """Process data from a resource with progress reporting.""" await ctx.info(f"Processing data from ...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.0697602778673172, 0.05337819457054138, -0.03130530193448067, 0.0646420568227768, -0.034323327243328094, -0.029920773580670357, 0.026993805542588234, 0.07514537870883942, -0.009741434827446938, -0.03529305383563042, -0.01296194363385439, -0.05650993064045906, 0.04281312972307205, 0.01791...
0.035108
import { VersionBadge } from "/snippets/version-badge.mdx" FastMCP uses pluggable storage backends for caching responses and managing OAuth state. By default, all storage is in-memory, which is perfect for development but doesn't persist across restarts. FastMCP includes support for multiple storage backends, and you c...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/storage-backends.mdx
main
model-context-protocol-fastmcp
[ -0.06527640670537949, 0.02189498208463192, -0.032683003693819046, -0.016695840284228325, 0.0052787852473556995, -0.03414873033761978, -0.03308812156319618, 0.0019840202294290066, -0.013806503266096115, -0.0035809348337352276, 0.038138385862112045, 0.051906879991292953, 0.09233370423316956, ...
0.019242
review the [py-key-value documentation](https://github.com/strawgate/py-key-value) to understand the maturity level and limitations of your chosen backend. Some backends may be in preview or have specific constraints that make them unsuitable for production use. ## Use Cases in FastMCP ### Server-Side OAuth Token Stora...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/storage-backends.mdx
main
model-context-protocol-fastmcp
[ -0.06679794937372208, 0.010904095135629177, -0.04070362076163292, 0.010259769856929779, 0.004485109355300665, -0.05411164090037346, -0.024507351219654083, 0.0502796545624733, 0.04985405504703522, -0.002689236542209983, 0.030423825606703758, 0.06690166145563126, 0.07341192662715912, 0.01553...
-0.071596
Caching Middleware](/servers/middleware#caching-middleware) - Using storage for caching - [OAuth Token Security](/deployment/http#oauth-token-security) - Production OAuth configuration - [HTTP Deployment](/deployment/http) - Complete deployment guide
https://github.com/jlowin/fastmcp/blob/main/docs/servers/storage-backends.mdx
main
model-context-protocol-fastmcp
[ -0.04150562733411789, 0.06592928618192673, -0.02518581785261631, -0.07631781697273254, 0.07927640527486801, -0.10787230730056763, -0.0025739017874002457, 0.020352745428681374, -0.012746980413794518, 0.009151468053460121, 0.026500118896365166, 0.06948953121900558, 0.03770316764712334, -0.03...
0.20383
import { VersionBadge } from "/snippets/version-badge.mdx" Background tasks require the `tasks` optional extra. See [installation instructions](#enabling-background-tasks) below. FastMCP implements the MCP background task protocol ([SEP-1686](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/task...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tasks.mdx
main
model-context-protocol-fastmcp
[ -0.05114639922976494, 0.01614626683294773, 0.037719324231147766, -0.0092614172026515, 0.08112449198961258, -0.04962330684065819, -0.019630471244454384, -0.04808996990323067, 0.026551788672804832, 0.0587347038090229, -0.05549977347254753, 0.0006696428754366934, 0.01712995395064354, -0.01730...
0.150029
Poll Interval When clients poll for task status, the server tells them how frequently to check back. By default, FastMCP suggests a 5-second interval, but you can customize this per component: ```python from datetime import timedelta from fastmcp import FastMCP from fastmcp.server.tasks import TaskConfig mcp = FastMCP(...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tasks.mdx
main
model-context-protocol-fastmcp
[ -0.06587085872888565, -0.020909162238240242, -0.012477186508476734, 0.07576905936002731, -0.05375843122601509, -0.0608225092291832, -0.018416984006762505, -0.049537643790245056, 0.036041010171175, 0.001677718828432262, -0.0006339550600387156, -0.0028199118096381426, 0.005201983731240034, -...
0.044685
Set the total number of steps - `await progress.increment(amount=1)` — Increment progress - `await progress.set\_message(text)` — Update the status message Progress works in both immediate and background execution modes—you can use the same code regardless of how the client invokes your function. ## Docket Dependencies...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/tasks.mdx
main
model-context-protocol-fastmcp
[ -0.021150464192032814, 0.08536441624164581, -0.008910874836146832, 0.03265562653541565, -0.05757896229624748, -0.07249182462692261, -0.026742639020085335, 0.008328845724463463, 0.024264955893158913, -0.024469122290611267, -0.03933083638548851, -0.017509248107671738, 0.01423955149948597, -0...
0.02184
import { VersionBadge } from '/snippets/version-badge.mdx' User elicitation allows MCP servers to request structured input from users during tool execution. Instead of requiring all inputs upfront, tools can interactively ask for missing parameters, clarification, or additional context as needed. Elicitation enables to...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/elicitation.mdx
main
model-context-protocol-fastmcp
[ -0.0741981789469719, 0.017495229840278625, 0.017165273427963257, 0.009699803777039051, 0.013411210849881172, -0.0685650110244751, 0.005669198464602232, 0.020538534969091415, -0.05235777795314789, -0.047342099249362946, 0.002217913046479225, -0.05930653586983681, 0.08718376606702805, -0.072...
0.070161
input, such as a string, integer, or boolean. When you request a scalar type, FastMCP automatically wraps it in an object schema for MCP spec compatibility. Clients will see a schema requesting a single "value" field of the requested type. Once clients respond, the provided object is "unwrapped" and the scalar value is...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/elicitation.mdx
main
model-context-protocol-fastmcp
[ -0.06862695515155792, 0.00531878974288702, 0.017996618524193764, 0.09220705181360245, -0.06048930808901787, -0.030842354521155357, 0.07411416620016098, -0.003091360442340374, -0.026494057849049568, -0.10575137287378311, 0.04717196896672249, -0.11708956956863403, 0.014677661471068859, 0.021...
0.020398
import Enum class Tag(Enum): BUG = "bug" FEATURE = "feature" DOCS = "documentation" @mcp.tool async def select\_tags(ctx: Context) -> str: result = await ctx.elicit( "Choose tags", response\_type=list[Tag] ) if result.action == "accept": tags = [tag.value for tag in result.data] return f"Selected: {', '.join(tags)}" ``...
https://github.com/jlowin/fastmcp/blob/main/docs/servers/elicitation.mdx
main
model-context-protocol-fastmcp
[ -0.020115187391638756, 0.012580008246004581, 0.01994440332055092, 0.005290042143315077, 0.009244523011147976, -0.05270912125706673, 0.020755697041749954, 0.05189300328493118, -0.03742346167564392, -0.0049574654549360275, 0.07410179078578949, -0.09512504190206528, 0.04177892580628395, 0.009...
0.043414