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
import { VersionBadge } from '/snippets/version-badge.mdx' FastMCP provides two powerful ways to integrate with FastAPI applications: 1. \*\*[Generate an MCP server FROM your FastAPI app](#generating-an-mcp-server)\*\* - Convert existing API endpoints into MCP tools 2. \*\*[Mount an MCP server INTO your FastAPI app](#m...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/fastapi.mdx
main
model-context-protocol-fastmcp
[ -0.05911504477262497, 0.012144505977630615, 0.03172493353486061, -0.046119797974824905, 0.04001118615269661, -0.044111527502536774, -0.10307802259922028, -0.026538046076893806, -0.03550298884510994, -0.0439484529197216, 0.0005122311413288116, -0.0341731458902359, 0.09738335758447647, -0.04...
0.011641
meaning you can add new tools, resources, and other components to it just like you would with any other FastMCP instance. ```python {8-11} # Assumes the FastAPI app from above is already defined from fastmcp import FastMCP # Convert to MCP server mcp = FastMCP.from\_fastapi(app=app) # Add a new tool @mcp.tool def get\_...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/fastapi.mdx
main
model-context-protocol-fastmcp
[ -0.0638786107301712, -0.03947552666068077, -0.008046237751841545, -0.03088650479912758, -0.020822184160351753, -0.051827725023031235, -0.004399915225803852, 0.049650367349386215, -0.05607053264975548, -0.05985178425908089, 0.06893114000558853, -0.04937135428190231, 0.09130171686410904, -0....
-0.007232
FastMCP from fastapi import FastAPI # Create MCP server mcp = FastMCP("Analytics Tools") @mcp.tool def analyze\_pricing(category: str) -> dict: """Analyze pricing for a category.""" products = [p for p in products\_db.values() if p.category == category] if not products: return {"error": f"No products in {category}"} pr...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/fastapi.mdx
main
model-context-protocol-fastmcp
[ -0.07060703635215759, 0.07324090600013733, -0.06820756942033768, 0.07073480635881424, -0.03470248356461525, -0.07806620746850967, 0.020888322964310646, 0.015526222996413708, 0.035582177340984344, -0.036078087985515594, 0.08593696355819702, -0.11941597610712051, 0.01606639102101326, -0.0477...
0.02076
= mcp.http\_app(path='/mcp') # Combine both lifespans @asynccontextmanager async def combined\_lifespan(app: FastAPI): # Run both lifespans async with app\_lifespan(app): async with mcp\_app.lifespan(app): yield # Use the combined lifespan app = FastAPI(lifespan=combined\_lifespan) app.mount("/mcp", mcp\_app) ``` This ...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/fastapi.mdx
main
model-context-protocol-fastmcp
[ -0.08129331469535828, 0.020583748817443848, -0.007256538141518831, 0.06075853481888771, -0.013209720142185688, -0.11821557581424713, -0.051604583859443665, 0.017319807782769203, -0.03686834126710892, -0.017075881361961365, 0.03217728063464165, -0.0298576932400465, 0.04455871507525444, -0.0...
0.017035
import { VersionBadge } from "/snippets/version-badge.mdx" Secure your FastMCP server with WorkOS Connect authentication. This integration uses the OAuth Proxy pattern to handle authentication through WorkOS Connect while maintaining compatibility with MCP clients. This guide covers WorkOS Connect applications. For Dyn...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/workos.mdx
main
model-context-protocol-fastmcp
[ -0.09042047709226608, 0.04600946977734566, 0.0017870328156277537, -0.056540463119745255, 0.025263190269470215, -0.03876281902194023, -0.021797386929392815, 0.006365352310240269, -0.03823480010032654, -0.042864300310611725, 0.03238794580101967, -0.030368885025382042, 0.044929176568984985, 0...
0.032322
variables and use a persistent storage backend like Redis for distributed deployments. For complete details on these parameters, see the [OAuth Proxy documentation](/v2/servers/auth/oauth-proxy#configuration-parameters). ## Environment Variables For production deployments, use environment variables instead of hardcodin...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/workos.mdx
main
model-context-protocol-fastmcp
[ -0.05381941422820091, 0.046726007014513016, -0.051919564604759216, 0.008077671751379967, -0.026962142437696457, -0.09536321461200714, 0.03559735044836998, 0.04295558109879494, 0.006652681156992912, -0.016062824055552483, 0.02117954194545746, 0.010789032094180584, 0.07127594947814941, 0.025...
0.055747
ChatGPT supports MCP servers through remote HTTP connections in two modes: \*\*Chat mode\*\* for interactive conversations and \*\*Deep Research mode\*\* for comprehensive information retrieval. \*\*Developer Mode Required for Chat Mode\*\*: To use MCP servers in regular ChatGPT conversations, you must first enable Dev...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/chatgpt.mdx
main
model-context-protocol-fastmcp
[ -0.0798717737197876, -0.06785586476325989, 0.02711409516632557, 0.023634880781173706, -0.045495640486478806, -0.129426047205925, 0.03131598234176636, -0.016202813014388084, 0.025553999468684196, 0.005657839588820934, 0.017346492037177086, 0.04613121971487999, -0.007703685201704502, 0.00297...
0.112844
"Jane Doe", "date": "2024"} } ``` ### Using Deep Research 1. Ensure your server is added to ChatGPT's connectors (same as Chat mode) 2. Start a new chat 3. Click \*\*+\*\* → \*\*Deep Research\*\* 4. Select your MCP server as a source 5. Ask research questions ChatGPT will use your `search` and `fetch` tools to find and...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/chatgpt.mdx
main
model-context-protocol-fastmcp
[ -0.05901535972952843, -0.04009014368057251, 0.1080755740404129, 0.021915236487984657, -0.0032297614961862564, 0.049628645181655884, 0.005353846121579409, 0.016286032274365425, 0.01255394984036684, 0.04071775823831558, 0.0025688940659165382, -0.047840870916843414, -0.07640806585550308, -0.0...
0.063554
import { VersionBadge } from "/snippets/version-badge.mdx" import { LocalFocusTip } from "/snippets/local-focus.mdx" Claude Code supports MCP servers through multiple transport methods including STDIO, SSE, and HTTP, allowing you to extend Claude's capabilities with custom tools, resources, and prompts from your FastMC...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/claude-code.mdx
main
model-context-protocol-fastmcp
[ -0.05268595367670059, -0.03571208938956261, -0.04426467791199684, -0.032663047313690186, -0.044548556208610535, -0.04123849794268608, -0.007149797864258289, -0.005141090136021376, -0.024274496361613274, -0.001963375834748149, 0.043325889855623245, 0.014475412666797638, 0.08594582229852676, ...
-0.014772
control over the configuration, you can manually use Claude Code's built-in MCP management commands. This gives you direct control over how your server is launched: ```bash # Add a server with custom configuration claude mcp add dice-roller -- uv run --with fastmcp fastmcp run server.py # Add with environment variables...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/claude-code.mdx
main
model-context-protocol-fastmcp
[ -0.04442291706800461, -0.018288884311914444, -0.01944267936050892, -0.013729396276175976, -0.04518651217222214, -0.056654445827007294, -0.056422311812639236, 0.05230644717812538, -0.063860684633255, 0.01693475805222988, 0.02433583326637745, -0.031196510419249535, 0.06629674136638641, -0.02...
-0.04439
import { VersionBadge } from "/snippets/version-badge.mdx" This guide shows you how to secure your FastMCP server using \*\*Google OAuth\*\*. Since Google doesn't support Dynamic Client Registration, this integration uses the [\*\*OAuth Proxy\*\*](/v2/servers/auth/oauth-proxy) pattern to bridge Google's traditional OAu...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/google.mdx
main
model-context-protocol-fastmcp
[ -0.10958240926265717, 0.018349982798099518, 0.09273718297481537, -0.06491165608167648, -0.004493876826018095, 0.0019438241142779589, 0.007700374349951744, -0.036474887281656265, -0.03125697001814842, -0.021042045205831528, 0.019920194521546364, -0.03865727782249451, 0.09870191663503647, -0...
-0.132094
the protected tool result = await client.call\_tool("get\_user\_info") print(f"Google user: {result['email']}") print(f"Name: {result['name']}") if \_\_name\_\_ == "\_\_main\_\_": asyncio.run(main()) ``` When you run the client for the first time: 1. Your browser will open to Google's authorization page 2. Sign in with...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/google.mdx
main
model-context-protocol-fastmcp
[ -0.11107103526592255, 0.044189080595970154, -0.020926157012581825, 0.032166488468647, -0.0609949566423893, -0.11627961695194244, 0.016357971355319023, 0.0292530320584774, -0.049075011163949966, -0.046408891677856445, 0.008927005343139172, 0.022665591910481453, 0.020899759605526924, -0.0788...
0.020738
import { VersionBadge } from '/snippets/version-badge.mdx' FastMCP can automatically generate an MCP server from any OpenAPI specification, allowing AI models to interact with existing APIs through the MCP protocol. Instead of manually creating tools and resources, you provide an OpenAPI spec and FastMCP intelligently ...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/openapi.mdx
main
model-context-protocol-fastmcp
[ -0.036171991378068924, -0.00021802097035106272, 0.0517742745578289, -0.021604619920253754, 0.042595893144607544, -0.05222649127244949, -0.11563972383737564, -0.012564849108457565, -0.026521164923906326, -0.02103160321712494, -0.03896322101354599, -0.03133315593004227, 0.09745366126298904, ...
0.045555
`Resource` and `ResourceTemplate` components based on whether they had path parameters. (This was changed solely for client compatibility reasons.) You can restore this behavior by providing custom route maps: ```python from fastmcp import FastMCP from fastmcp.server.providers.openapi import RouteMap, MCPType # Restore...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/openapi.mdx
main
model-context-protocol-fastmcp
[ -0.014072338119149208, 0.04351876303553581, 0.04242848604917526, 0.06774276494979858, -0.04318596050143242, -0.05396172031760216, -0.028133450075984, -0.009042294695973396, -0.05568224564194679, -0.030135342851281166, -0.002030004747211933, -0.030187532305717468, 0.004588666372001171, 0.01...
0.00914
= FastMCP.from\_openapi( openapi\_spec=spec, client=client, route\_map\_fn=custom\_route\_mapper, ) ``` ## Customization ### Component Names FastMCP automatically generates names for MCP components based on the OpenAPI specification. By default, it uses the `operationId` from your OpenAPI spec, up to the first double u...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/openapi.mdx
main
model-context-protocol-fastmcp
[ -0.03037652000784874, 0.012423573061823845, 0.014479381963610649, 0.0407777838408947, -0.07219035178422928, -0.08818570524454117, 0.016644516959786415, 0.017561504617333412, -0.02659507654607296, -0.08148057758808136, 0.05398429185152054, -0.06025761365890503, 0.03705838695168495, -0.02380...
0.052838
function is called on it and has the opportunity to modify it in-place. Your `mcp\_component\_fn` is expected to modify the component in-place, not to return a new component. The result of the function is ignored. ```python from fastmcp.server.providers.openapi import ( OpenAPITool, OpenAPIResource, OpenAPIResourceTemp...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/openapi.mdx
main
model-context-protocol-fastmcp
[ 0.006291634403169155, 0.03290592506527901, 0.019976641982793808, 0.04469780623912811, 0.025550076737999916, -0.04163065180182457, -0.005037576425820589, 0.05312218517065048, -0.003168128663673997, -0.012191765010356903, 0.04176827520132065, -0.01831192895770073, -0.02018161304295063, -0.05...
-0.015718
import { VersionBadge } from "/snippets/version-badge.mdx" This guide shows you how to secure your FastMCP server using \*\*Azure OAuth\*\* (Microsoft Entra ID). Since Azure doesn't support Dynamic Client Registration, this integration uses the [\*\*OAuth Proxy\*\*](/v2/servers/auth/oauth-proxy) pattern to bridge Azure...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/azure.mdx
main
model-context-protocol-fastmcp
[ -0.08055410534143448, 0.03647695481777191, 0.030565928667783737, -0.03141523897647858, -0.013187090866267681, 0.037968672811985016, 0.0028068411629647017, -0.05980760604143143, 0.015266051515936852, 0.02550571784377098, 0.033024370670318604, -0.04278859123587608, 0.11887240409851074, -0.01...
-0.061286
- \*\*Client Secret\*\*: The value you copied in the previous step Store these credentials securely. Never commit them to version control. Use environment variables or a secrets manager in production. ### Step 2: FastMCP Configuration Create your FastMCP server using the `AzureProvider`, which handles Azure's OAuth flo...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/azure.mdx
main
model-context-protocol-fastmcp
[ -0.08401471376419067, 0.06605208665132523, -0.027452383190393448, 0.002714637666940689, -0.01500382088124752, 0.006417862139642239, -0.006349239964038134, -0.01952170766890049, 0.06554162502288818, 0.0685032457113266, 0.05379704013466835, -0.026683203876018524, 0.10261356085538864, 0.01146...
-0.138963
and protected by Azure OAuth authentication. ### Testing with a Client Create a test client that authenticates with your Azure-protected server: ```python test\_client.py from fastmcp import Client import asyncio async def main(): # The client will automatically handle Azure OAuth async with Client("http://localhost:80...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/azure.mdx
main
model-context-protocol-fastmcp
[ -0.08303660154342651, 0.04364464804530144, -0.07701221853494644, 0.053833842277526855, -0.01408848911523819, -0.04842870309948921, 0.019409803673624992, -0.046989649534225464, -0.0019805075135082006, 0.003901388496160507, 0.0401579886674881, 0.004554685205221176, 0.04293976351618767, 0.013...
-0.031899
list of additional scopes to include in the authorization request without prefixing. Use this to request upstream scopes such as Microsoft Graph permissions. These are not used for token validation. Application ID URI used to prefix scopes during authorization. Azure authority base URL. Override this to use Azure Gover...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/azure.mdx
main
model-context-protocol-fastmcp
[ -0.06806200742721558, 0.06669152528047562, 0.004292741417884827, -0.008598284795880318, -0.0016871111001819372, -0.05048048496246338, 0.027754593640565872, -0.03590331971645355, 0.013381761498749256, 0.06892383843660355, 0.027089830487966537, -0.038878925144672394, 0.0776059478521347, 0.04...
-0.072824
import { VersionBadge } from "/snippets/version-badge.mdx" This guide shows you how to secure your FastMCP server using \*\*Auth0 OAuth\*\*. While Auth0 does have support for Dynamic Client Registration, it is not enabled by default so this integration uses the [\*\*OIDC Proxy\*\*](/v2/servers/auth/oidc-proxy) pattern ...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/auth0.mdx
main
model-context-protocol-fastmcp
[ -0.09005054086446762, 0.05005321651697159, 0.015837902203202248, -0.05057062208652496, -0.0034595669712871313, 0.004585775546729565, 0.004289770033210516, -0.011505370028316975, -0.03449522331357002, -0.0512816347181797, 0.03183787688612938, -0.03402275592088699, 0.11373643577098846, -0.03...
-0.066048
protected tool result = await client.call\_tool("get\_token\_info") print(f"Auth0 audience: {result['audience']}") if \_\_name\_\_ == "\_\_main\_\_": asyncio.run(main()) ``` When you run the client for the first time: 1. Your browser will open to Auth0's authorization page 2. After you authorize the app, you'll be redi...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/auth0.mdx
main
model-context-protocol-fastmcp
[ -0.04930519312620163, 0.012690591625869274, -0.08878897875547409, 0.024285640567541122, -0.02640984207391739, -0.09534844756126404, -0.015425414778292179, 0.04835815727710724, -0.023844461888074875, -0.0425679050385952, 0.01436694711446762, -0.04353103041648865, 0.05598831921815872, -0.031...
0.08512
import { VersionBadge } from "/snippets/version-badge.mdx" FastMCP can generate standard MCP JSON configuration files that work with any MCP-compatible client including Claude Desktop, VS Code, Cursor, and other applications that support the Model Context Protocol. ## MCP JSON Configuration Standard The MCP JSON config...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/mcp-json-configuration.mdx
main
model-context-protocol-fastmcp
[ -0.05931396782398224, -0.0220728050917387, 0.03132294490933418, -0.0501914918422699, 0.0024141997564584017, -0.02332661673426628, -0.06638530641794205, 0.010512051172554493, -0.05715883523225784, -0.0018796315416693687, 0.03145887702703476, -0.006780501455068588, 0.06723258644342422, 0.000...
0.016246
install mcp-json server.py --with pandas # Multiple packages fastmcp install mcp-json server.py --with pandas --with requests --with httpx # Editable local package fastmcp install mcp-json server.py --with-editable ./my-package # From requirements file fastmcp install mcp-json server.py --with-requirements requirements...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/mcp-json-configuration.mdx
main
model-context-protocol-fastmcp
[ -0.01713387295603752, -0.016748346388339996, 0.0029002733062952757, -0.08876082301139832, 0.0052491445094347, -0.042183052748441696, -0.08894822001457214, 0.01612974889576435, -0.06301702558994293, -0.010885286144912243, 0.07108675688505173, -0.03557838127017021, -0.032624952495098114, 0.0...
-0.10537
and provides a CLI entry point of the same name: ```json { "mcpServers": { "My Server": { "command": "uvx", "args": ["my-mcp-server"] } } } ``` If the package name differs from the CLI command (e.g., package `weather-mcp` with command `weather-server`): ```json { "mcpServers": { "Weather": { "command": "uvx", "args": [...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/mcp-json-configuration.mdx
main
model-context-protocol-fastmcp
[ -0.08128885179758072, 0.004030400887131691, 0.0535326823592186, -0.03413006290793419, -0.012134659104049206, -0.08643508702516556, -0.018485847860574722, 0.0032333291601389647, -0.011958600953221321, -0.055136583745479584, 0.04441014677286148, -0.048519108444452286, 0.05725732073187828, 0....
0.015922
import { VersionBadge } from "/snippets/version-badge.mdx" Anthropic's [Messages API](https://docs.anthropic.com/en/api/messages) supports MCP servers as remote tool sources. This tutorial will show you how to create a FastMCP server and deploy it to a public URL, then how to call it from the Messages API. Currently, t...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/anthropic.mdx
main
model-context-protocol-fastmcp
[ -0.027585159987211227, -0.01576322317123413, -0.0024411261547356844, -0.007037808652967215, 0.030695060268044472, -0.04642842337489128, -0.00715969642624259, -0.00466183852404356, -0.015022801235318184, 0.0203964002430439, 0.027218518778681755, -0.01655544340610504, 0.06391260772943497, -0...
0.039032
server while still allowing Anthropic to access it. ### Server Authentication The simplest way to add authentication to the server is to use a bearer token scheme. For this example, we'll quickly generate our own tokens with FastMCP's `RSAKeyPair` utility, but this may not be appropriate for production use. For more de...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/anthropic.mdx
main
model-context-protocol-fastmcp
[ -0.06602396816015244, 0.027873700484633446, -0.049470625817775726, -0.026088962331414223, -0.02454855851829052, -0.030513038858771324, 0.011232287622988224, 0.03358615189790726, 0.03706837445497513, -0.03260409086942673, 0.011578141711652279, -0.010470462962985039, 0.03739769756793976, -0....
-0.016392
import { VersionBadge } from "/snippets/version-badge.mdx" import { LocalFocusTip } from "/snippets/local-focus.mdx" Gemini CLI supports MCP servers through multiple transport methods including STDIO, SSE, and HTTP, allowing you to extend Gemini's capabilities with custom tools, resources, and prompts from your FastMCP...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/gemini-cli.mdx
main
model-context-protocol-fastmcp
[ -0.06680549681186676, -0.03116886503994465, -0.029079513624310493, -0.06939785182476044, -0.038935765624046326, -0.06271901726722717, 0.017795151099562645, -0.010384207591414452, -0.03557167574763298, -0.03288513422012329, 0.013023941777646542, 0.049334943294525146, 0.051464423537254333, -...
-0.015895
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/v2/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\*\*](/v2/servers/auth/oauth-proxy) pattern to bridge Discord's traditional ...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/discord.mdx
main
model-context-protocol-fastmcp
[ -0.07297109067440033, 0.004858506843447685, 0.05822843313217163, -0.06687355041503906, 0.0028008418157696724, 0.023297278210520744, 0.02124437503516674, 0.001804628991521895, -0.0000016052139244493446, -0.033303067088127136, 0.0071858796291053295, -0.03774245083332062, 0.11034118384122849, ...
-0.042115
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/v2/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/v2/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/v2/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/v2/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" 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\*\*](/v2/servers/auth/oauth-proxy) pattern to bridge AWS Cogni...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/aws-cognito.mdx
main
model-context-protocol-fastmcp
[ -0.049867674708366394, 0.039086781442165375, -0.006326661910861731, -0.0752154216170311, 0.008678272366523743, 0.018322808668017387, 0.009220442734658718, -0.04733625426888466, -0.0078087905421853065, 0.004576188512146473, 0.04353545978665352, -0.0952574610710144, 0.06375392526388168, -0.0...
-0.030717
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/v2/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](/v2/servers/auth/oauth-proxy#configuration-parameters). ## Environment Variables For production deployments, use environment variables instead of hardcoding credentials. ### Provider Selection Setting this environment variable allows the AWS Cognito provider to be used automatically with...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/integrations/aws-cognito.mdx
main
model-context-protocol-fastmcp
[ -0.015383083373308182, 0.02450917847454548, -0.021266844123601913, -0.02325558103621006, -0.005103947129100561, -0.03457557410001755, 0.033410970121622086, -0.040484584867954254, 0.05989859625697136, 0.02460932545363903, 0.06262042373418808, -0.07940605282783508, 0.04084833711385727, -0.02...
-0.056516
\*\*FastMCP is the standard framework for building MCP applications.\*\* The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) provides a standardized way to connect LLMs to tools and data, and FastMCP makes it production-ready with clean, Pythonic code: ```python {1} from fastmcp import FastMCP mcp = Fa...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/getting-started/welcome.mdx
main
model-context-protocol-fastmcp
[ -0.0811285525560379, -0.04661867767572403, -0.020605042576789856, -0.024916354566812515, -0.049859266728162766, -0.06964337825775146, -0.001204624306410551, 0.021362826228141785, -0.007875916548073292, -0.0072317421436309814, 0.06306235492229462, -0.030899764969944954, 0.10721379518508911, ...
0.132096
A sitemap listing all documentation pages - [llms-full.txt](https://gofastmcp.com/llms-full.txt) - The entire documentation in one file (may exceed context 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 ...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/getting-started/welcome.mdx
main
model-context-protocol-fastmcp
[ 0.006445499137043953, 0.08502280712127686, 0.008813958615064621, -0.036159057170152664, 0.0715421810746193, 0.014255509711802006, -0.08185847848653793, 0.025811919942498207, -0.018247030675411224, 0.04906057193875313, -0.006519383750855923, 0.09126294404268265, 0.06653673946857452, -0.0283...
-0.005798
Welcome! This guide will help you quickly set up FastMCP, run your first MCP server, and deploy a server to Prefect Horizon. If you haven't already installed FastMCP, follow the [installation instructions](/v2/getting-started/installation). ## Create a FastMCP Server A FastMCP server is a collection of tools, resources...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/getting-started/quickstart.mdx
main
model-context-protocol-fastmcp
[ -0.04618241265416145, -0.047415073961019516, 0.007188417483121157, -0.010106582194566727, -0.07020827382802963, -0.08199276030063629, -0.04924902319908142, 0.03505706787109375, -0.053870800882577896, -0.0011425656266510487, 0.04343806952238083, -0.024862969294190407, 0.034870583564043045, ...
0.037963
provides managed hosting, authentication, access control, and observability for MCP servers. Horizon is \*\*free for personal projects\*\* and offers enterprise governance for teams. To deploy your server, you'll need a [GitHub account](https://github.com). Once you have one, you can deploy your server in three steps: ...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/getting-started/quickstart.mdx
main
model-context-protocol-fastmcp
[ 0.021332884207367897, -0.07119543105363846, -0.014769460074603558, -0.046916961669921875, 0.008520584553480148, -0.0728541761636734, -0.08418948203325272, 0.029474955052137375, 0.01758289895951748, 0.03507415950298309, 0.021169345825910568, 0.0009948007063940167, 0.01273943018168211, 0.010...
0.028828
## Install FastMCP We recommend using [uv](https://docs.astral.sh/uv/getting-started/installation/) to install and manage FastMCP. If you plan to use FastMCP in your project, you can add it as a dependency with: ```bash uv add fastmcp ``` Alternatively, you can install it directly with `pip` or `uv pip`: ```bash uv uv ...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/getting-started/installation.mdx
main
model-context-protocol-fastmcp
[ -0.06509692966938019, -0.000993496272712946, 0.04353397339582443, -0.05019993707537651, 0.02447911910712719, -0.012247939594089985, -0.062081173062324524, 0.023353714495897293, -0.06105000898241997, -0.020770352333784103, 0.09274820238351822, -0.07896693795919418, -0.01725476235151291, 0.0...
-0.077635
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/v2/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/v2/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.07469204813241959, -0.04466303065419197, 0.022242115810513496, -0.01671341434121132, 0.004244165029376745, -0.09256535768508911, -0.10621826350688934, 0.04687033221125603, 0.0029727525543421507, -0.004030849318951368, 0.0010594684863463044, 0.02844269573688507, 0.03731324523687363, -0.0...
-0.026241
use `allow\_origins=["\*"]` in production. Specify the exact origins of your browser-based clients. Using wildcards exposes your server to unauthorized access from any website. ### SSE Polling for Long-Running Operations This feature only applies to the \*\*StreamableHTTP transport\*\* (the default for `http\_app()`). ...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.07730252295732498, 0.003655225969851017, -0.03429001569747925, 0.048868682235479355, -0.0373426154255867, -0.10050376504659653, 0.0000340158621838782, -0.013243749737739563, 0.006814946886152029, -0.044590063393116, -0.027450310066342354, 0.014903226867318153, 0.028149351477622986, 0.02...
0.039806
be properly initialized. #### Nested Mounts You can create complex routing structures by nesting mounts: ```python from fastmcp import FastMCP from starlette.applications import Starlette from starlette.routing import Mount # Create your FastMCP server mcp = FastMCP("MyServer") # Create the ASGI app mcp\_app = mcp.http...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.09183088690042496, -0.041518695652484894, 0.008118238300085068, 0.033751312643289566, -0.0586337186396122, -0.12858320772647858, -0.06124214828014374, 0.06591736525297165, -0.04923358932137489, -0.018213341012597084, 0.0696505457162857, -0.020336970686912537, 0.04745164513587952, -0.035...
0.045571
under a prefix, operational routes move with it, but discovery routes must stay at root level for RFC compliance. ### Configuration Parameters Three parameters control where routes are located and how they combine: \*\*`base\_url`\*\* tells clients where to find operational endpoints. This includes any Starlette `Mount...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.05299842357635498, -0.04787682369351387, 0.040063124150037766, -0.000534005113877356, -0.030058886855840683, -0.12113623321056366, -0.08272717893123627, 0.03436800837516785, 0.014480562880635262, -0.02295573800802231, 0.03858618810772896, 0.01575559191405773, 0.03306661918759346, 0.0687...
0.017809
For more details on OAuth authentication, see the [Authentication guide](/v2/servers/auth). ## Production Deployment ### Running with Uvicorn When deploying to production, you'll want to optimize your server for performance and reliability. Uvicorn provides several options to improve your server's capabilities: ```bash...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.026867523789405823, 0.04080919921398163, -0.024465855211019516, -0.017412137240171432, -0.010983631014823914, -0.10871217399835587, -0.029230104759335518, 0.04688302055001259, -0.03150761500000954, -0.0421438030898571, 0.02359021082520485, -0.03945159912109375, 0.059784628450870514, -0....
0.034843
local testing. - \*\*Linux\*\*: Keys are ephemeral (random salt at startup), so tokens are invalidated on restart. This automatic approach is convenient for development but not suitable for production deployments. \*\*For Production:\*\* Production requires explicit key management to ensure tokens survive restarts and ...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.05780448019504547, -0.046660296618938446, -0.04563705250620842, -0.02325521782040596, 0.00665690703317523, -0.10141415894031525, 0.0335426926612854, 0.0579272136092186, 0.02588789165019989, -0.042696211487054825, 0.022068122401833534, -0.02599772997200489, 0.0740300789475441, 0.01795988...
0.121719
events reach clients immediately. This is the single most important setting. - \*\*Increase timeouts\*\*: The default nginx `proxy\_read\_timeout` is 60 seconds. Long-running MCP tools will cause the connection to drop. Set timeouts to at least 300 seconds, or higher if your tools run longer. For tools that may exceed ...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/deployment/http.mdx
main
model-context-protocol-fastmcp
[ -0.07262305915355682, 0.013110194355249405, 0.05809745937585831, 0.044140249490737915, -0.03628145158290863, -0.0008166205952875316, -0.046939000487327576, -0.02480362541973591, 0.014489646069705486, -0.0021430188789963722, -0.055080801248550415, -0.002409015316516161, 0.04082806035876274, ...
-0.012491
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](/v2/deployment/http) guide. ## The `run()` Method Every FastMCP server needs to be started to accept connections....
https://github.com/jlowin/fastmcp/blob/main/docs/v2/deployment/running-server.mdx
main
model-context-protocol-fastmcp
[ -0.05077695474028587, -0.02099938876926899, -0.015069246292114258, 0.0007901977514848113, -0.053606066852808, -0.0955706536769867, -0.08549490571022034, -0.0049264440312981606, -0.025680039077997208, -0.029519295319914818, 0.06761643290519714, 0.02652328461408615, 0.05726834014058113, -0.0...
-0.032198
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 communication. ```python if \_\_name\_\_ == "\_\_main\_\...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/deployment/running-server.mdx
main
model-context-protocol-fastmcp
[ -0.027487030252814293, -0.047023214399814606, 0.006482836324721575, 0.025331467390060425, -0.06009304150938988, -0.06513108313083649, -0.030654020607471466, 0.08184449374675751, -0.05676022171974182, -0.026549220085144043, -0.06424394249916077, -0.003939716145396233, -0.0009633832960389555, ...
0.109494
error about the event loop already running. Always use `run\_async()` inside async functions and `run()` in synchronous contexts. Both `run()` and `run\_async()` accept the same transport arguments, so all the examples above apply to both methods. ## Custom Routes When using HTTP transport, you might want to add custom...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/deployment/running-server.mdx
main
model-context-protocol-fastmcp
[ -0.034368984401226044, 0.0084129823371768, -0.0048044114373624325, 0.053416766226291656, -0.05022287368774414, -0.054455529898405075, -0.005813356954604387, 0.022803286090493202, -0.02014525607228279, -0.016528349369764328, 0.029414907097816467, 0.015615640208125114, -0.0005724315415136516, ...
0.0191
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/v2/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/v2/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/v2/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/v2/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/v2/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/v2/tutorials/rest-api.mdx
main
model-context-protocol-fastmcp
[ -0.02869715727865696, -0.04041886329650879, 0.02312583662569523, -0.00847404170781374, -0.0100413728505373, -0.028749629855155945, -0.11406072974205017, 0.04059919714927673, -0.06436531990766525, 0.024989377707242966, -0.012529609724879265, -0.057506393641233444, 0.07272462546825409, -0.02...
0.117036
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/v2/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/v2/tutorials/create-mcp-server.mdx
main
model-context-protocol-fastmcp
[ -0.07557867467403412, -0.03126390650868416, -0.004082015715539455, 0.006850728299468756, -0.07046898454427719, -0.07859136909246445, -0.01757967844605446, 0.030162861570715904, -0.0492633692920208, -0.018231580033898354, -0.04310426115989685, 0.0074989632703363895, 0.048048969358205795, -0...
0.130919
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/v2/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/v2/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/v2/tutorials/mcp.mdx
main
model-context-protocol-fastmcp
[ -0.0365847684442997, 0.06990968436002731, -0.027917947620153427, 0.022154396399855614, -0.05890046805143356, -0.09729040414094925, 0.12534047663211823, 0.08228883892297745, -0.04576895013451576, -0.06719259172677994, 0.021863367408514023, -0.0280006006360054, 0.08839336782693863, 0.0107860...
0.012907
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/v2/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' 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/v2/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
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 other application-specific purposes. ### Async Support FastMCP is an async-first framework that seamlessly supports both asynchronous (`async def`) and synchronous (`def...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.07832114398479462, 0.048189181834459305, -0.035719793289899826, 0.06843099743127823, 0.00010497186303837225, -0.14767470955848694, -0.006259733811020851, -0.010663921944797039, 0.014006253331899643, -0.02517007663846016, 0.018134314566850662, 0.0150986909866333, -0.04599004611372948, -0...
0.115858
values | | Paths | `Path` | File system paths (auto-converted from strings) | | UUIDs | `UUID` | Universally unique identifiers (auto-converted from strings) | | Pydantic models | `UserData` | Complex structured data with validation | FastMCP supports all types that Pydantic supports as fields, including all Pydantic c...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.030368512496352196, 0.035198964178562164, -0.06185377016663551, -0.03782711923122406, -0.0174478217959404, -0.06753969192504883, -0.0019429336534813046, 0.04332616925239563, -0.0035078227519989014, -0.025022000074386597, 0.020291928201913834, -0.05467885732650757, 0.10679444670677185, -...
-0.007034
#### Simple String Descriptions For basic parameter descriptions, you can use a convenient shorthand with `Annotated`: ```python from typing import Annotated @mcp.tool def process\_image( image\_url: Annotated[str, "URL of the image to process"], resize: Annotated[bool, "Whether to resize the image"] = False, width: An...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.010140429250895977, 0.08054359257221222, 0.014157670550048351, 0.009139453060925007, 0.013617715798318386, -0.07795223593711853, 0.04723483324050903, 0.11700714379549026, -0.06411430984735489, -0.04388360306620598, -0.007192492019385099, -0.028087148442864418, 0.06229228526353836, 0.091...
0.099154
Classes FastMCP provides helper classes for returning images, audio, and files. When you return one of these classes, either directly or as part of a list, FastMCP automatically converts it to the appropriate MCP content block. For example, if you return a `fastmcp.utilities.types.Image` object, FastMCP will convert it...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.04374731332063675, -0.031735897064208984, 0.024690013378858566, 0.012552869506180286, 0.05513608828186989, -0.05208107829093933, -0.001926946104504168, 0.023446450009942055, -0.020101120695471764, -0.05266421660780907, 0.043610602617263794, -0.020032135769724846, 0.07154936343431473, 0....
0.005587
...}` object, since JSON schemas require object-type roots for structured output: ```python Tool Definition @mcp.tool def calculate\_sum(a: int, b: int) -> int: """Calculate sum with return annotation.""" return a + b # Returns 8 ``` ```json MCP Result { "content": [ { "type": "text", "text": "8" } ], "structuredConten...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.06590911000967026, 0.055690255016088486, 0.008818835020065308, 0.019864017143845558, -0.046833597123622894, -0.02298392914235592, -0.017206577584147453, 0.06104191765189171, -0.0315084233880043, -0.052946317940950394, 0.046447161585092545, -0.057862624526023865, 0.012617560103535652, 0....
0.042114
display to users. Can be a string (automatically converted to `TextContent`), a list of MCP content blocks, or any serializable value (converted to JSON string). At least one of `content` or `structured\_content` must be provided. ```python # Simple string ToolResult(content="Hello, world!") # List of content blocks To...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.026730189099907875, 0.01202371995896101, -0.05892983078956604, 0.036313436925411224, -0.03808670490980148, -0.048383861780166626, 0.006656718906015158, 0.10789218544960022, -0.021749276667833328, -0.060318972915410995, 0.08327621221542358, -0.0803445428609848, 0.12307824939489365, 0.054...
0.055453
dynamic\_tool.disable() dynamic\_tool.enable() ``` ## MCP Annotations FastMCP allows you to add specialized metadata to your tools through annotations. These annotations communicate how tools behave to client applications without consuming token context in LLM prompts. Annotations serve several purposes in client appli...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.07802305370569229, 0.05851909890770912, -0.009490869008004665, 0.036968573927879333, -0.012468711473047733, -0.023359939455986023, 0.015348313376307487, 0.04811430722475052, 0.029221568256616592, -0.003074151463806629, -0.0060934042558074, -0.08859606087207794, 0.03859690949320793, -0.0...
0.099786
are added, removed, enabled, or disabled. This allows clients to stay up-to-date with the current tool set without manually polling for changes. ```python @mcp.tool def example\_tool() -> str: return "Hello!" # These operations trigger notifications: mcp.add\_tool(example\_tool) # Sends tools/list\_changed notification...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/tools.mdx
main
model-context-protocol-fastmcp
[ -0.06946620345115662, -0.056345805525779724, 0.055972177535295486, 0.06337759643793106, 0.020816773176193237, -0.08505868166685104, 0.06965412199497223, -0.025741925463080406, 0.044328756630420685, 0.015274508856236935, 0.0396755151450634, 0.05710546672344208, 0.05009690672159195, -0.01271...
0.142299
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/v2/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
and storage based on your platform: - \*\*Mac/Windows\*\*: Keys are auto-managed via system keyring, storage defaults to disk. Suitable \*\*only\*\* for development and local testing. - \*\*Linux\*\*: Keys are ephemeral, storage defaults to memory. No configuration needed: ```python from fastmcp.server.auth.providers.g...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/storage-backends.mdx
main
model-context-protocol-fastmcp
[ -0.04117446020245552, -0.020347321406006813, -0.11142139136791229, 0.01648891530930996, -0.018367400392889977, -0.031943704932928085, 0.020827967673540115, 0.023253293707966805, 0.030314723029732704, 0.04261909797787666, 0.10883966088294983, 0.01944238506257534, 0.07359987497329712, -0.023...
0.053298
import { VersionBadge } from "/snippets/version-badge.mdx" FastMCP implements the MCP background task protocol ([SEP-1686](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks)), giving your servers a production-ready distributed task scheduler with a single decorator change. \*\*What is Docke...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/tasks.mdx
main
model-context-protocol-fastmcp
[ -0.051888737827539444, 0.034989748150110245, 0.037812698632478714, -0.017567425966262817, 0.06413456797599792, -0.07001422345638275, -0.013932989910244942, -0.04322382062673569, 0.05509145185351372, 0.06879324465990067, -0.06573310494422913, 0.007767376024276018, 0.029573731124401093, -0.0...
0.167437
this with `task=False`. ```python mcp = FastMCP("MyServer", tasks=True) ``` If your server defines any synchronous tools, resources, or prompts, you will need to explicitly set `task=False` on their decorators to avoid an error. ### Graceful Degradation When a client requests background execution but the component has ...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/tasks.mdx
main
model-context-protocol-fastmcp
[ -0.014763767831027508, 0.031409576535224915, 0.02126895636320114, 0.04314267635345459, 0.017027152702212334, -0.12121076881885529, -0.059246473014354706, -0.03102605789899826, -0.011951017193496227, -0.031217867508530617, -0.01162034459412098, 0.014322841539978981, 0.055957894772291183, -0...
-0.014303
retry policies, timeouts, and custom dependencies.
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/tasks.mdx
main
model-context-protocol-fastmcp
[ -0.07506946474313736, 0.015316072851419449, 0.07268814742565155, 0.0065275938250124454, -0.0010069316485896707, -0.011683824472129345, -0.00556141184642911, -0.04385397583246231, -0.0511016845703125, 0.011816365644335747, 0.07036960870027542, 0.0774252638220787, 0.007967057637870312, -0.02...
0.046261
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. Most of the examples i...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/elicitation.mdx
main
model-context-protocol-fastmcp
[ -0.07900138199329376, -0.002758946269750595, 0.04539317265152931, -0.022416716441512108, 0.059994522482156754, -0.02188940718770027, 0.0035842908546328545, -0.0036289487034082413, -0.05638284608721733, -0.019868772476911545, -0.0017050232272595167, -0.057077836245298386, 0.09945318847894669,...
0.136632
or no response at all, by automatically wrapping them in MCP-compatible object schemas. ### Scalar Types You can request simple scalar data types for basic 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...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/elicitation.mdx
main
model-context-protocol-fastmcp
[ -0.07858087122440338, 0.015389973297715187, 0.007654774468392134, 0.07577905803918839, -0.09200969338417053, -0.05799763649702072, 0.006249692291021347, 0.020213663578033447, -0.0719037801027298, -0.07815470546483994, 0.02963661402463913, -0.09638005495071411, 0.014484122395515442, 0.03168...
0.011095
list of strings" @mcp.tool async def select\_tags(ctx: Context) -> str: """Select multiple tags.""" result = await ctx.elicit( "Choose tags", response\_type=[["bug", "feature", "documentation"]] # Note: list of a list ) if result.action == "accept": tags = result.data # List of selected strings return f"Selected tags: ...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/elicitation.mdx
main
model-context-protocol-fastmcp
[ -0.009208268485963345, -0.006837939377874136, 0.010101070627570152, 0.0012465949403122067, 0.0723930299282074, -0.04511209949851036, 0.12214773893356323, 0.04727521538734436, -0.041899509727954865, -0.0031292277853935957, 0.04999218136072159, -0.09197307378053665, 0.02221916988492012, -0.0...
0.082327
= Field(default=Priority.MEDIUM, description="Task priority") @mcp.tool async def create\_task(ctx: Context) -> str: result = await ctx.elicit("Please provide task details", response\_type=TaskDetails) if result.action == "accept": return f"Created: {result.data.title}" return "Task creation cancelled" ``` ## Multi-Tur...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/elicitation.mdx
main
model-context-protocol-fastmcp
[ -0.033705901354551315, 0.021591883152723312, 0.009522730484604836, 0.0873672142624855, -0.037195540964603424, -0.05675775930285454, -0.022755516692996025, 0.004500049166381359, 0.04383091628551483, -0.02548569068312645, -0.029137710109353065, -0.07866597920656204, -0.019547171890735626, 0....
0.075037
import { VersionBadge } from "/snippets/version-badge.mdx" Prompts are reusable message templates that help LLMs generate structured, purposeful responses. FastMCP simplifies defining these templates, primarily using the `@mcp.prompt` decorator. ## What Are Prompts? Prompts provide parameterized message templates for L...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/prompts.mdx
main
model-context-protocol-fastmcp
[ -0.006977922283113003, 0.029025837779045105, 0.06271084398031235, -0.05900561437010765, 0.05900908261537552, -0.008885134942829609, 0.01643412746489048, 0.015947449952363968, -0.017121758311986923, -0.04281243681907654, 0.012758316472172737, -0.037920501083135605, 0.1340133249759674, -0.06...
0.006829
as strings, but FastMCP allows you to use typed annotations for better developer experience. When you use complex types like `list[int]` or `dict[str, str]`, FastMCP: 1. \*\*Automatically converts\*\* string arguments from MCP clients to the expected types 2. \*\*Generates helpful descriptions\*\* showing the exact JSO...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/prompts.mdx
main
model-context-protocol-fastmcp
[ -0.04123444855213165, 0.0793609693646431, 0.04212479293346405, 0.004500895738601685, -0.04332764819264412, -0.09206883609294891, 0.06618279963731766, 0.04792537912726402, 0.014122246764600277, -0.04835887625813484, -0.016581591218709946, -0.033497296273708344, 0.03184989467263222, 0.070550...
0.058363
If `analysis\_type` or `include\_charts` are omitted, their default values will be used. ### Disabling Prompts You can control the visibility and availability of prompts by enabling or disabling them. Disabled prompts will not appear in the list of available prompts, and attempting to call a disabled prompt will result...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/prompts.mdx
main
model-context-protocol-fastmcp
[ 0.014822079800069332, 0.018041839823126793, 0.03189297020435333, 0.07956526428461075, 0.04741979390382767, 0.003068641060963273, -0.0227808877825737, -0.02528860792517662, -0.05662606284022331, 0.00614707637578249, -0.004904316738247871, -0.07642250508069992, 0.044465966522693634, -0.00929...
-0.005948
`ValueError`, preventing the duplicate registration. - `"replace"`: Silently replaces the existing prompt with the new one. - `"ignore"`: Keeps the original prompt and ignores the new registration attempt.
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/prompts.mdx
main
model-context-protocol-fastmcp
[ -0.06589638441801071, -0.029439473524689674, 0.03751664608716965, -0.008345291949808598, 0.004537982866168022, -0.05805836617946625, 0.06266624480485916, 0.00715820724144578, 0.014548802748322487, -0.051750779151916504, 0.07234132289886475, -0.024683766067028046, 0.08425389975309372, -0.08...
-0.035856
import { VersionBadge } from "/snippets/version-badge.mdx"; LLM sampling allows your MCP tools to request text generation from an LLM during execution. This enables tools to leverage AI capabilities for analysis, generation, reasoning, and more—without the client needing to orchestrate multiple calls. By default, sampl...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/sampling.mdx
main
model-context-protocol-fastmcp
[ -0.05515148490667343, -0.024935316294431686, 0.0012427468318492174, -0.0464237779378891, 0.05127694457769394, -0.05825844407081604, -0.011067511513829231, 0.0076324655674397945, 0.017852574586868286, -0.013448644429445267, -0.06615971028804779, -0.0022879750467836857, 0.099457748234272, -0...
0.075304
outputs, while lower values make responses more deterministic. The `max\_tokens` parameter limits response length. ### Model Preferences Model preferences let you hint at which LLM the client should use for a request. You can pass a single model name or a list of preferences in priority order. These are hints rather th...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/sampling.mdx
main
model-context-protocol-fastmcp
[ -0.03771943598985672, 0.022959228605031967, -0.010361419059336185, 0.12228047847747803, -0.02895992621779442, -0.08704061806201935, -0.009243197739124298, 0.10890650004148483, 0.03522726148366928, -0.03143880143761635, -0.07211306691169739, -0.05538339540362358, 0.038319382816553116, -0.00...
0.071137
using available tools.""" result = await ctx.sample( messages=question, tools=[search, get\_time], ) return result.text or "" ``` The LLM sees each function's signature and docstring, using this information to decide when and how to call them. Tool errors are caught and sent back to the LLM, allowing it to recover grac...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/sampling.mdx
main
model-context-protocol-fastmcp
[ -0.02955646440386772, 0.07333619892597198, -0.0005893840570934117, 0.04140201583504677, 0.019626272842288017, -0.07252040505409241, 0.015207810327410698, 0.08209323137998581, -0.00421995110809803, -0.05226079002022743, -0.03486105427145958, -0.07695072144269943, 0.07896513491868973, -0.046...
-0.015431
tool results, ready for the next iteration - \*\*`execute\_tools=False`\*\*: Includes the assistant's tool request, but you add results yourself ### Manual Tool Execution Set `execute\_tools=False` to handle tool execution yourself. When disabled, `step.history` contains the user message and the assistant's response wi...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/sampling.mdx
main
model-context-protocol-fastmcp
[ -0.06497518718242645, 0.030878212302923203, -0.000041808380046859384, 0.0817161500453949, -0.07111313939094543, -0.040324289351701736, 0.002443560864776373, 0.011887816712260246, -0.02138460986316204, -0.0802825540304184, 0.062011051923036575, -0.054816972464323044, 0.049757011234760284, -...
-0.000238
import { VersionBadge } from "/snippets/version-badge.mdx" The central piece of a FastMCP application is the `FastMCP` server class. This class acts as the main container for your application's tools, resources, and prompts, and manages communication with MCP clients. ## Creating a Server Instantiating a server is stra...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/server.mdx
main
model-context-protocol-fastmcp
[ -0.06030449643731117, 0.007805234752595425, 0.021766038611531258, -0.0218952726572752, -0.02278689667582512, -0.07998615503311157, -0.0018315196502953768, 0.018255101516842842, -0.03666752949357033, -0.022868884727358818, 0.024873171001672745, -0.016005143523216248, 0.08422835916280746, -0...
0.067835
```python @mcp.prompt def analyze\_data(data\_points: list[float]) -> str: """Creates a prompt asking for analysis of numerical data.""" formatted\_data = ", ".join(str(point) for point in data\_points) return f"Please analyze these data points: {formatted\_data}" ``` See [Prompts](/v2/servers/prompts) for detailed doc...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/server.mdx
main
model-context-protocol-fastmcp
[ -0.012867484241724014, 0.057919953018426895, -0.031492508947849274, 0.032916802912950516, 0.0522097647190094, -0.11520442366600037, 0.09297123551368713, -0.02806047350168228, -0.03752335533499718, -0.037682171911001205, 0.04711401090025902, -0.058920085430145264, 0.08798853307962418, 0.010...
-0.009203
reuse existing servers. See the [Server Composition](/v2/servers/composition) guide for full details, best practices, and examples. ```python # Example: Importing a subserver from fastmcp import FastMCP import asyncio main = FastMCP(name="Main") sub = FastMCP(name="Sub") @sub.tool def hello(): return "hi" # Mount direc...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/server.mdx
main
model-context-protocol-fastmcp
[ -0.0839366540312767, -0.07139308005571365, 0.017505062744021416, 0.04112008213996887, -0.11542317271232605, -0.09794271737337112, -0.0704924613237381, 0.025144504383206367, -0.016888046637177467, -0.0364585816860199, -0.025448592379689217, 0.04197445884346962, 0.05265121906995773, -0.03097...
0.076293
`tool\_serializer` function when creating your server: ```python import yaml from fastmcp import FastMCP # Define a custom serializer that formats dictionaries as YAML def yaml\_serializer(data): return yaml.dump(data, sort\_keys=False) # Create a server with the custom serializer mcp = FastMCP(name="MyServer", tool\_s...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/server.mdx
main
model-context-protocol-fastmcp
[ -0.04301036521792412, 0.012503230012953281, 0.015213541686534882, -0.00453746784478426, -0.07606316357851028, -0.061415985226631165, -0.03990013152360916, -0.00726647675037384, 0.02511337772011757, -0.03642858564853668, 0.08303574472665787, 0.022464312613010406, 0.009387221187353134, -0.07...
0.011843
import { VersionBadge } from '/snippets/version-badge.mdx' Progress reporting allows MCP tools to notify clients about the progress of long-running operations. This enables clients to display progress indicators and provide better user experience during time-consuming tasks. ## Why Use Progress Reporting? Progress repo...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/progress.mdx
main
model-context-protocol-fastmcp
[ -0.06838510185480118, 0.06185024604201317, -0.03368357568979263, 0.030503850430250168, -0.0004668191249947995, -0.022456614300608635, -0.006401277147233486, 0.002177830319851637, -0.03120153397321701, -0.022546537220478058, -0.0013164457632228732, -0.008964979089796543, 0.05341679975390434, ...
0.08102
Client Requirements Progress reporting requires clients to support progress handling: - Clients must send a `progressToken` in the initial request to receive progress updates - If no progress token is provided, progress calls will have no effect (they won't error) - See [Client Progress](/v2/clients/progress) for detai...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/progress.mdx
main
model-context-protocol-fastmcp
[ -0.05812012776732445, 0.00914946012198925, 0.0018999520689249039, -0.013017882592976093, -0.03604266792535782, 0.008338574320077896, -0.07431154698133469, -0.014724843204021454, -0.01095847599208355, 0.011993078514933586, -0.06101742759346962, 0.019685324281454086, -0.0109889330342412, 0.0...
0.047811
import { VersionBadge } from '/snippets/version-badge.mdx' This documentation covers \*\*MCP client logging\*\* - sending messages from your server to MCP clients. For standard server-side logging (e.g., writing to files, console), use `fastmcp.utilities.logging.get\_logger()` or Python's built-in `logging` module. Ser...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/logging.mdx
main
model-context-protocol-fastmcp
[ -0.027119839563965797, 0.016792502254247665, 0.046001337468624115, 0.0044362205080688, 0.0911112055182457, -0.0858093649148941, 0.009238671511411667, 0.0016168218571692705, -0.017865994945168495, 0.02295536734163761, 0.015387580730021, 0.009169738739728928, 0.07124484330415726, -0.03863441...
0.071678
permissions") # File processing logic await ctx.debug("File processing completed successfully") return "File processed" ``` ### Info Use for general information about normal program execution: ```python @mcp.tool async def backup\_database(ctx: Context) -> str: """Backup database with progress information.""" await ctx...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/logging.mdx
main
model-context-protocol-fastmcp
[ -0.07078251242637634, 0.029918784275650978, -0.061657730489969254, 0.041521355509757996, -0.006875231396406889, -0.09465645253658295, -0.016008678823709488, 0.03885580226778984, -0.10246898978948593, -0.0005725487717427313, 0.0013009097892791033, 0.010432190261781216, 0.0853782594203949, -...
0.007885
import { VersionBadge } from "/snippets/version-badge.mdx" MCP middleware is a powerful concept that allows you to add cross-cutting functionality to your FastMCP server. Unlike traditional web middleware, MCP middleware is designed specifically for the Model Context Protocol, providing hooks for different types of MCP...
https://github.com/jlowin/fastmcp/blob/main/docs/v2/servers/middleware.mdx
main
model-context-protocol-fastmcp
[ -0.09673547744750977, -0.009967654012143612, 0.08279892802238464, -0.085647813975811, 0.10349330306053162, -0.025052955374121666, -0.04331449046730995, 0.0014806251274421811, -0.04761683940887451, 0.0131043940782547, -0.018792325630784035, -0.004819199908524752, 0.0619618259370327, -0.0296...
0.174527