Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PrefectHQ/fastmcp
/ functions
Functions
11,669 in github.com/PrefectHQ/fastmcp
⨍
Functions
11,669
◇
Types & classes
1,774
↳
Endpoints
123
↓ 2 callers
Method
_message_to_create_message_result
( message: Message, )
fastmcp_slim/fastmcp/client/sampling/handlers/anthropic.py:336
↓ 2 callers
Method
_message_to_result_with_tools
Convert Anthropic response to CreateMessageResultWithTools.
fastmcp_slim/fastmcp/client/sampling/handlers/anthropic.py:407
↓ 2 callers
Function
_modern_proxy
A proxy whose backend client negotiates the modern era, so the backend can emit an `InputRequiredResult` for the proxy to round-trip.
tests/server/test_mrtr_guards_components.py:57
↓ 2 callers
Function
_mrtr_server
An SDK MCPServer whose `greet` tool elicits a name via a resolver. At 2026-07-28 the elicitation is delivered as an `InputRequiredResult`.
tests/client/client/test_input_required_driver.py:69
↓ 2 callers
Function
_multi_round_server
()
tests/client/client/test_input_required_driver.py:59
↓ 2 callers
Method
_negotiate
Run the connect-time protocol negotiation dictated by ``self.mode``. - ``"legacy"``: today's initialize handshake (populates ``initialize_res
fastmcp_slim/fastmcp/client/client.py:820
↓ 2 callers
Function
_normalize_scopes
Normalize scopes to a space-separated string (or None).
fastmcp_slim/fastmcp/client/auth/client_credentials.py:57
↓ 2 callers
Function
_object_schema_to_type
Convert an object schema to the appropriate Python type. Single source of truth for the four object-schema cases, used by both the top-level
fastmcp_slim/fastmcp/utilities/json_schema_type.py:385
↓ 2 callers
Method
_on_call_tool
Handle MCP 'tools/call' requests. A guard tool (SEP-2322 multi-round-trip) requests client input by returning an ``InputRequiredResul
fastmcp_slim/fastmcp/server/mixins/mcp_operations.py:218
↓ 2 callers
Method
_paginate_list
Generic pagination helper for list operations. Invokes a FastMCP ``_on_*`` list handler (``(ctx, params) -> result``) page by page. T
fastmcp_slim/fastmcp/server/context.py:517
↓ 2 callers
Method
_parse_call_tool_result
Parse an mcp_types.CallToolResult into our CallToolResult dataclass. Args: name: Tool name (for schema lookup) result
fastmcp_slim/fastmcp/client/mixins/tools.py:248
↓ 2 callers
Function
_prefab_to_json
Serialize a PrefabApp, addressing its peer-tool references by identity. The resolver writes each reference as ``<hash>_<local_name>``, and the
fastmcp_slim/fastmcp/tools/base.py:520
↓ 2 callers
Method
_prepare_scopes_for_upstream_refresh
Prepare scopes for upstream token refresh request. Override this method to transform scopes before sending to upstream provider. For
fastmcp_slim/fastmcp/server/auth/oauth_proxy/proxy.py:1670
↓ 2 callers
Function
_propagation_only_span
Attach the incoming `_meta` trace context without creating a span. This is what separates `propagation_only` from `off`. Both create no FastM
fastmcp_slim/fastmcp/server/telemetry.py:100
↓ 2 callers
Function
_query_scalar_to_str
Convert a scalar to its query-string representation. Booleans are lowercased to match JSON/OpenAPI conventions (true/false) rather than Pytho
fastmcp_slim/fastmcp/utilities/openapi/director.py:18
↓ 2 callers
Function
_recover_new_pid
Call `call` until it succeeds on a subprocess other than `old_pid`. `psutil.Process(pid).kill()` is asynchronous and crash recovery is transp
tests/client/test_stdio.py:82
↓ 2 callers
Function
_relay_read_resource
Read a backend resource, surfacing a guard ask rather than driving it. Mirrors `ProxyTool.run`: on a modern backend the low-level session is used
fastmcp_slim/fastmcp/server/providers/proxy.py:133
↓ 2 callers
Function
_remove_task_session
(session_id: str, ref: weakref.ref[ServerSession])
fastmcp_tasks/fastmcp_tasks/context.py:339
↓ 2 callers
Method
_render_results
(self, tools: Sequence[Tool])
fastmcp_slim/fastmcp/server/transforms/search/base.py:259
↓ 2 callers
Function
_request_state_key
(docket: Docket, task_scope: str | None, task_id: str)
fastmcp_tasks/fastmcp_tasks/input_store.py:93
↓ 2 callers
Method
_request_token
(self, url: str, data: dict[str, Any])
fastmcp_slim/fastmcp/server/auth/oauth_proxy/upstream.py:85
↓ 2 callers
Function
_require_azure_identity
Raise ImportError with install instructions if azure-identity is not available.
fastmcp_slim/fastmcp/server/auth/providers/azure.py:809
↓ 2 callers
Method
_reset_session_state
Reset session state after disconnect or cancellation. Args: full: If True, also resets session_task and nesting_counter.
fastmcp_slim/fastmcp/client/client.py:636
↓ 2 callers
Function
_resolve_param_hints
Resolve a callable's parameter type hints, tolerating partials. ``get_type_hints`` rejects ``functools.partial`` objects (and other non-funct
fastmcp_slim/fastmcp/tools/function_tool.py:173
↓ 2 callers
Function
_resolve_ref
Resolve JSON Schema reference to target schema.
fastmcp_slim/fastmcp/utilities/json_schema_type.py:258
↓ 2 callers
Function
_resolve_token_storage
Wrap a token store in the FastMCP adapter, defaulting to in-memory. Unlike the interactive `OAuth` provider, M2M providers do not warn when using
fastmcp_slim/fastmcp/client/auth/client_credentials.py:77
↓ 2 callers
Function
_resource_texts
Text from ReadResourceResult.contents blocks (TextResourceContents).
tests/server/test_protocol_eras.py:83
↓ 2 callers
Function
_restore_request_context
Set the ``request_ctx``, ``_current_context`` and ``_current_server`` ContextVars from stashed values so a proxy forwarding handler relays to the
fastmcp_slim/fastmcp/server/providers/proxy.py:1440
↓ 2 callers
Function
_restore_token_expiry
Restore the persisted absolute token expiry after a token is reloaded. The inherited initializer reloads the stored token but not its expiry, so
fastmcp_slim/fastmcp/client/auth/client_credentials.py:108
↓ 2 callers
Method
_reverse_name
Remove namespace prefix from a name, or None if no match.
fastmcp_slim/fastmcp/server/transforms/namespace.py:64
↓ 2 callers
Method
_reverse_uri
Remove namespace from a URI, or None if no match.
fastmcp_slim/fastmcp/server/transforms/namespace.py:82
↓ 2 callers
Method
_run_outer_mw
Run the method-agnostic (``on_message``/``on_request``) hook pass. ``call_next`` bridges to the real SDK dispatch (request-state boundary,
fastmcp_slim/fastmcp/server/low_level.py:225
↓ 2 callers
Function
_sanitize_name
Convert string to valid Python identifier.
fastmcp_slim/fastmcp/utilities/json_schema_type.py:537
↓ 2 callers
Method
_select_model_from_preferences
( self, model_preferences: ModelPreferences | str | list[str] | None )
fastmcp_slim/fastmcp/client/sampling/handlers/openai.py:405
↓ 2 callers
Method
_select_model_from_preferences
( self, model_preferences: ModelPreferences | str | list[str] | None )
fastmcp_slim/fastmcp/client/sampling/handlers/anthropic.py:357
↓ 2 callers
Method
_server
()
tests/test_exceptions.py:111
↓ 2 callers
Method
_set_auth
(self, auth: httpx2.Auth | Literal["oauth"] | str | None)
fastmcp_slim/fastmcp/client/transports/sse.py:78
↓ 2 callers
Method
_set_consent_binding_cookie
Add a consent binding entry for a transaction. This cookie binds the browser that approved consent to the IdP callback, ensuring a di
fastmcp_slim/fastmcp/server/auth/oauth_proxy/consent.py:238
↓ 2 callers
Method
_set_list_cookie
( self: OAuthProxy, response: HTMLResponse | RedirectResponse, base_name: str,
fastmcp_slim/fastmcp/server/auth/oauth_proxy/consent.py:164
↓ 2 callers
Method
_setup_session_with_claims
Set up a proxy JWT pointing at a valid upstream token, with optional upstream_claims.
tests/server/auth/oauth_proxy/test_tokens.py:1439
↓ 2 callers
Function
_split_declared_strictness
Pop `"additionalProperties": false` from every migrated schema, asserting it's there. FastMCP's generated tool schemas declare `"additionalProper
tests/docs/test_upgrade_guide_equivalence.py:81
↓ 2 callers
Function
_task_key_ttl_seconds
Wall-clock TTL for a task's Redis metadata keys. Docket's ``execution_ttl`` plus a buffer (matching task creation), so a key written or refre
fastmcp_tasks/fastmcp_tasks/handlers.py:116
↓ 2 callers
Function
_task_server
()
tests/tasks/server/test_task_protocol.py:20
↓ 2 callers
Method
_template
(self)
tests/resources/test_resource_template_meta.py:39
↓ 2 callers
Function
_terminal_error_message
The best available error message for a failed task.
fastmcp_tasks/fastmcp_tasks/client.py:308
↓ 2 callers
Function
_tokenize
Lowercase, split on non-alphanumeric, filter short tokens.
fastmcp_slim/fastmcp/server/transforms/search/bm25.py:18
↓ 2 callers
Method
_transform_name
Apply namespace prefix to a name.
fastmcp_slim/fastmcp/server/transforms/namespace.py:60
↓ 2 callers
Method
_transport_answering
An in-memory transport whose ``server/discover`` returns ``body`` verbatim.
tests/client/client/test_mode_negotiation.py:184
↓ 2 callers
Method
_truncate_to_result
Truncate text to fit within max_size and wrap in ToolResult.
fastmcp_slim/fastmcp/server/middleware/response_limiting.py:71
↓ 2 callers
Method
_try_transparent_refresh
Refresh the upstream token transparently and update storage. Called during load_access_token when the upstream token has expired but
fastmcp_slim/fastmcp/server/auth/oauth_proxy/proxy.py:2033
↓ 2 callers
Function
_update_lock_key
(docket: Docket, task_scope: str | None, task_id: str)
fastmcp_tasks/fastmcp_tasks/input_store.py:458
↓ 2 callers
Function
_wait_for_process_exit
Poll until a process has exited, raising if it's still alive after timeout.
tests/test_mcp_config.py:460
↓ 2 callers
Function
_walk_prefab_tools
Enumerate all prefab tools across the server's providers (sync walk of _components).
fastmcp_slim/fastmcp/server/providers/prefab_synthesis.py:154
↓ 2 callers
Function
_walk_tool_calls
Collect every ``toolCall`` action object in a payload tree.
fastmcp_slim/fastmcp/server/providers/prefab_payload.py:44
↓ 2 callers
Function
_worker_snapshot_headers
Read the HTTP headers snapshotted at task submission from inside a worker.
tests/server/http/test_http_dependencies.py:180
↓ 2 callers
Function
_write_cache
Write version info to cache.
fastmcp_slim/fastmcp/utilities/version_check.py:46
↓ 2 callers
Method
_write_consent_bindings
Write the consent binding map to a signed cookie.
fastmcp_slim/fastmcp/server/auth/oauth_proxy/consent.py:207
↓ 2 callers
Function
_write_map
(payload: dict[str, Any], names: dict[str, str])
fastmcp_slim/fastmcp/server/providers/prefab_payload.py:73
↓ 2 callers
Function
acquire_update_lock
Take the per-task update lock, or return False if one is already held. Serializes concurrent ``tasks/update`` calls for a task so two racing
fastmcp_tasks/fastmcp_tasks/input_store.py:462
↓ 2 callers
Function
acquire_update_lock_blocking
Wait for the per-task update lock, up to ``timeout`` seconds. ``tasks/cancel`` uses this to serialize with an in-flight ``tasks/update``: it
fastmcp_tasks/fastmcp_tasks/input_store.py:482
↓ 2 callers
Method
add
(self, a: int, b: int)
tests/server/middleware/test_caching.py:121
↓ 2 callers
Method
add_prompt
Add a prompt to this provider's storage. Accepts either a Prompt object or a decorated function with __fastmcp__ metadata.
fastmcp_slim/fastmcp/server/providers/local_provider/decorators/prompts.py:35
↓ 2 callers
Method
add_resource
Add a resource to this provider's storage. Accepts either a Resource/ResourceTemplate object or a decorated function with __fastmcp__ metadat
fastmcp_slim/fastmcp/server/providers/local_provider/decorators/resources.py:41
↓ 2 callers
Method
add_tool
Add a tool to this provider's storage. Accepts either a Tool object or a decorated function with __fastmcp__ metadata.
fastmcp_slim/fastmcp/server/providers/local_provider/decorators/tools.py:122
↓ 2 callers
Function
apps
Preview a FastMCPApp UI in the browser. Starts the MCP server from SERVER_SPEC on --mcp-port, launches a local dev UI on --dev-port with a to
fastmcp_slim/fastmcp/cli/cli.py:339
↓ 2 callers
Method
assert_notification_sent
Assert that a notification was sent a specific number of times.
tests/client/test_notifications.py:44
↓ 2 callers
Method
async_auth_flow
( self, request: httpx2.Request )
fastmcp_slim/fastmcp/client/auth/client_credentials.py:384
↓ 2 callers
Method
authorize
Start OAuth transaction and redirect to Azure AD. Override parent's authorize method to filter out the 'resource' parameter which is
fastmcp_slim/fastmcp/server/auth/providers/azure.py:374
↓ 2 callers
Function
block_server_imports
()
tests/client/test_slim_package_boundaries.py:16
↓ 2 callers
Function
build_app
The ASGI app the conformance suite is run against. Shared by the pytest fixture and the `__main__` entry point so both exercise the same conf
tests/conformance/server.py:867
↓ 2 callers
Function
call
()
tests/client/test_stdio.py:110
↓ 2 callers
Method
call_tool
Call a tool on the server. Unlike call_tool_mcp, this method raises a ToolError if the tool call results in an error. Args:
fastmcp_slim/fastmcp/client/mixins/tools.py:274
↓ 2 callers
Function
call_tool_with_optin
Run a `tools/call` with the tasks opt-in bound into the request context.
tests/tasks/server/test_task_proxy.py:37
↓ 2 callers
Method
cancel
Request cooperative cancellation of the task via `tasks/cancel`.
fastmcp_tasks/fastmcp_tasks/client.py:512
↓ 2 callers
Method
clear
Clear this adapter's collection only. Prefers deleting each enumerated key (which leaves the collection usable), and falls back to wh
fastmcp_slim/fastmcp/client/caching.py:185
↓ 2 callers
Method
clear
(self)
fastmcp_slim/fastmcp/client/auth/oauth.py:135
↓ 2 callers
Function
clear_outstanding
Drop a leg's outstanding requests and mapping once it has been answered. The answered surfaced keys are never reused (a later leg mints its own),
fastmcp_tasks/fastmcp_tasks/input_store.py:412
↓ 2 callers
Function
collect
(task)
examples/tasks/client.py:119
↓ 2 callers
Function
convert_raw_to_resource_result
Wrap a user function's return value in a ResourceResult. Shared by `Resource` and `ResourceTemplate` so both honor the MIME type the componen
fastmcp_slim/fastmcp/resources/base.py:270
↓ 2 callers
Method
convert_result
Convert a raw result to ResourceResult. This is used in two contexts: 1. In _read() to convert user function return values to Resourc
fastmcp_slim/fastmcp/resources/template.py:269
↓ 2 callers
Method
convert_result
Convert a raw return value to PromptResult. Accepts: - PromptResult: passed through - str: wrapped as single Message
fastmcp_slim/fastmcp/prompts/base.py:309
↓ 2 callers
Function
convert_roots_list
(roots: RootsList)
fastmcp_slim/fastmcp/client/roots.py:20
↓ 2 callers
Function
create_base_app
Create a base Starlette app with common middleware and routes. Args: routes: List of routes to include in the app middleware: Lis
fastmcp_slim/fastmcp/server/http.py:388
↓ 2 callers
Function
create_consent_html
Create a styled HTML consent page for OAuth authorization requests. Args: csp_policy: Content Security Policy override. If No
fastmcp_slim/fastmcp/server/auth/oauth_proxy/ui.py:20
↓ 2 callers
Function
create_fastmcp_server_for_headers
Create a FastMCP server from FastAPI app with experimental parser.
tests/client/test_openapi.py:14
↓ 2 callers
Function
create_info_box
Create an info box. Args: content: HTML content for the info box is_error: True for error styling, False for normal
fastmcp_slim/fastmcp/utilities/ui.py:539
↓ 2 callers
Method
create_oauth_app
()
tests/server/auth/test_enhanced_error_responses.py:650
↓ 2 callers
Function
create_openapi_server
Helper to create a FastMCP server with OpenAPIProvider.
tests/server/providers/openapi/test_openapi_discriminator.py:14
↓ 2 callers
Function
create_roots_callback
( handler: RootsList | RootsHandler, )
fastmcp_slim/fastmcp/client/roots.py:34
↓ 2 callers
Function
create_status_message
Create a status message with icon. Args: message: Status message text is_success: True for success (✓), False for error (✕)
fastmcp_slim/fastmcp/utilities/ui.py:516
↓ 2 callers
Function
cursor_command
Install an MCP server in Cursor. Args: server_spec: Python file to install, optionally with :object suffix
fastmcp_slim/fastmcp/cli/install/cursor.py:228
↓ 2 callers
Function
decorator
(fn: F, tool_name: str | None)
fastmcp_slim/fastmcp/tools/function_tool.py:610
↓ 2 callers
Function
decorator
(fn: F, prompt_name: str | None)
fastmcp_slim/fastmcp/prompts/function_prompt.py:418
↓ 2 callers
Function
default_serializer
(data: Any)
fastmcp_slim/fastmcp/tools/base.py:79
↓ 2 callers
Method
delete_state
Delete a value from the state store. Removes from both request-scoped and session-scoped stores.
fastmcp_slim/fastmcp/server/context.py:1176
↓ 2 callers
Method
enum_schema
Generate inline enum schema. Always generates enum pattern: `{"enum": [value, ...]}` Titled enums are handled separately via dict-bas
fastmcp_slim/fastmcp/server/elicitation.py:94
↓ 2 callers
Method
exchange_refresh_token
( self, client: OAuthClientInformationFull, refresh_token: RefreshToken, scope
tests/server/test_auth_integration.py:126
↓ 2 callers
Function
extract_query_params
Extract query parameter names from RFC 6570 `{?param1,param2}` syntax.
fastmcp_slim/fastmcp/resources/template.py:38
↓ 2 callers
Function
extract_version_spec
Extract the FastMCP component version from a lifted ``_meta`` block.
fastmcp_slim/fastmcp/server/dependencies.py:131
↓ 2 callers
Function
fail
Always raises an error.
examples/apps/inspector_demo.py:114
← previous
next →
1,001–1,100 of 11,669, ranked by callers