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
↓ 12 callers
Function
parse_task_key
Parse Docket task key to extract metadata. Args: task_key: Encoded task key from Docket Returns: Dict with keys: ``task_scop
fastmcp_tasks/fastmcp_tasks/keys.py:118
↓ 12 callers
Function
parse_tool_arguments
Build a tool-call argument dict from CLI inputs. A single JSON object argument is treated as the full argument dict. ``--input-json`` provide
fastmcp_slim/fastmcp/cli/client.py:298
↓ 12 callers
Method
read_resource_mcp
Send a resources/read request and return the complete MCP protocol result. Args: uri (AnyUrl | str): The URI of the resource to r
fastmcp_slim/fastmcp/client/mixins/resources.py:215
↓ 12 callers
Method
run
(self, arguments: dict[str, Any])
tests/server/providers/test_base_provider.py:20
↓ 12 callers
Method
supports_tasks
Check if this component supports task execution.
fastmcp_slim/fastmcp/utilities/tasks.py:60
↓ 12 callers
Function
validate_url
Validate URL for SSRF and resolve to IPs. Args: url: URL to validate require_path: If True, require non-root path (for CIMD)
fastmcp_slim/fastmcp/server/auth/ssrf.py:274
↓ 12 callers
Method
verify_token
Verify a Google OAuth token using the tokeninfo endpoint. Calls ``https://oauth2.googleapis.com/tokeninfo?access_token=TOKEN`` to val
fastmcp_slim/fastmcp/server/auth/providers/google.py:92
↓ 11 callers
Method
_app
(marker: str = "x", app_name: str = "contacts")
tests/server/providers/test_prefab_roundtrip.py:261
↓ 11 callers
Method
_convert_to_anthropic_messages
( messages: Sequence[SamplingMessage], )
fastmcp_slim/fastmcp/client/sampling/handlers/anthropic.py:177
↓ 11 callers
Method
_get_resource_url
Get the actual resource URL being protected. Uses ``resource_base_url`` if set; otherwise falls back to ``base_url``. Args:
fastmcp_slim/fastmcp/server/auth/auth.py:456
↓ 11 callers
Function
_idp_jwks
Build a JWKS document from an RSA key pair's public key.
tests/server/auth/oauth_proxy/test_identity_assertion.py:47
↓ 11 callers
Function
_parse_mcp_config
Parse an mcpServers-style JSON file into discovered servers.
fastmcp_slim/fastmcp/cli/discovery.py:120
↓ 11 callers
Function
_schema_to_python_type
Convert a JSON Schema to a Python type annotation. Returns (type_annotation, needs_json_parsing).
fastmcp_slim/fastmcp/cli/generate.py:69
↓ 11 callers
Function
build_task_key
Build Docket task key with embedded metadata. When ``task_scope`` is ``None`` the task is anonymous and lives in the ``anon`` keyspace. Othe
fastmcp_tasks/fastmcp_tasks/keys.py:79
↓ 11 callers
Method
convert_result
Convert a raw result to ToolResult. Handles ToolResult passthrough and converts raw values using the tool's attributes (output_schema
fastmcp_slim/fastmcp/tools/base.py:353
↓ 11 callers
Method
enable_components
Enable components matching criteria for this session only. Session rules override global transforms. Rules accumulate - each call add
fastmcp_slim/fastmcp/server/context.py:1197
↓ 11 callers
Function
get_http_request
Get the current HTTP request. Tries MCP SDK's request_ctx first, then falls back to FastMCP's HTTP context.
fastmcp_slim/fastmcp/server/dependencies.py:515
↓ 11 callers
Method
get_request
( self, *, url: str | re.Pattern[str] | httpx2.URL | None = None, method: str
tests/utilities/httpx2_mock.py:189
↓ 11 callers
Method
initialize
Send an initialize request to the server. This method performs the MCP initialization handshake with the server, exchanging capabilit
fastmcp_slim/fastmcp/client/client.py:873
↓ 11 callers
Function
load_mcp_server_config
Load a FastMCP configuration from a fastmcp.json file. Args: config_path: Path to fastmcp.json file Returns: MCPServerConfig
fastmcp_slim/fastmcp/cli/run.py:124
↓ 11 callers
Function
make_m2m_responder
Build a responder for the standard M2M discovery + token exchange flow. Returns the responder and a dict that captures the token request and the
tests/client/auth/test_client_credentials.py:39
↓ 11 callers
Method
ping
()
tests/client/client/test_mode_negotiation.py:97
↓ 11 callers
Method
read
Read the resource by calling the wrapped function.
fastmcp_slim/fastmcp/resources/function_resource.py:201
↓ 11 callers
Method
report_progress
Report progress for the current operation. Works in both foreground (MCP progress notifications) and background (Docket task executio
fastmcp_slim/fastmcp/server/context.py:454
↓ 11 callers
Function
require_roles
Require all of the given roles, read from the token's claims. Roles and groups are not part of OIDC, so every identity provider puts them som
fastmcp_slim/fastmcp/utilities/authorization.py:148
↓ 11 callers
Method
start_as_current_span
( self, name: str, context: Context | None = None, kind: SpanKind = SpanKind.I
fastmcp_slim/fastmcp/telemetry.py:66
↓ 11 callers
Function
task_redis_prefix
Return the Redis key prefix that owns a given scope. Authenticated tasks live under ``fastmcp:task:auth:{enc_scope}``; anonymous tasks live u
fastmcp_tasks/fastmcp_tasks/keys.py:197
↓ 11 callers
Function
validate_redirect_uri
Validate a redirect URI against allowed patterns. Args: redirect_uri: The redirect URI to validate allowed_patterns: List of allo
fastmcp_slim/fastmcp/server/auth/redirect_validation.py:427
↓ 11 callers
Function
with_argv
Temporarily replace sys.argv if args provided. This context manager is used at the CLI boundary to inject server arguments when needed, witho
fastmcp_slim/fastmcp/cli/cli.py:75
↓ 10 callers
Function
_adder
()
tests/server/middleware/test_message_visibility.py:59
↓ 10 callers
Method
_bind
Bind this OAuth provider to a specific MCP server URL. Called automatically when mcp_url is provided to __init__, or by the transport
fastmcp_slim/fastmcp/client/auth/oauth.py:271
↓ 10 callers
Function
_convert_to_content
Convert a result to a sequence of content objects.
fastmcp_slim/fastmcp/tools/base.py:555
↓ 10 callers
Method
_convert_to_openai_messages
( system_prompt: str | None, messages: Sequence[SamplingMessage] )
fastmcp_slim/fastmcp/client/sampling/handlers/openai.py:183
↓ 10 callers
Function
_mock_httpx_client
Build a mock httpx2.AsyncClient whose stream() yields a canned response. The returned client's ``.stream.call_args`` exposes the request that was
tests/server/auth/test_ssrf_protection.py:23
↓ 10 callers
Function
app_config_to_meta_dict
Convert an AppConfig or dict to the wire-format dict for ``meta["ui"]``.
fastmcp_slim/fastmcp/apps/config.py:181
↓ 10 callers
Function
build_transport
(config: RemoteConfig)
fastmcp_remote/fastmcp_remote/cli.py:251
↓ 10 callers
Function
call_command
Call a tool, read a resource, or get a prompt on an MCP server. By default the target is treated as a tool name. If the target contains ``://
fastmcp_slim/fastmcp/cli/client.py:796
↓ 10 callers
Method
complete
Send a completion request to the server. Args: ref (mcp_types.ResourceTemplateReference | mcp_types.PromptReference): The referen
fastmcp_slim/fastmcp/client/client.py:1444
↓ 10 callers
Function
create_callback_html
Create a styled HTML response for OAuth callbacks.
fastmcp_slim/fastmcp/client/oauth_callback.py:34
↓ 10 callers
Function
discriminator_spec
A parent schema with a discriminator mapping onto two allOf subtypes.
tests/server/providers/openapi/test_openapi_discriminator.py:21
↓ 10 callers
Function
download_skill
Download a skill and all its files to a local directory. Creates a subdirectory named after the skill containing all files. Args: cl
fastmcp_slim/fastmcp/utilities/skills.py:127
↓ 10 callers
Method
execute
Execute tool calls using Python code.
fastmcp_slim/fastmcp/experimental/transforms/code_mode.py:593
↓ 10 callers
Method
fetch_token
Exchange an authorization grant for tokens at the token endpoint. Falsy parameters are dropped from the request body, matching authlib.
fastmcp_slim/fastmcp/server/auth/oauth_proxy/upstream.py:112
↓ 10 callers
Method
get_session_id
Get the session ID for this transport, if available.
fastmcp_slim/fastmcp/client/transports/base.py:128
↓ 10 callers
Method
load_server
Load and return the FastMCP server instance. Must be called after prepare() if the source requires preparation. All information neede
fastmcp_slim/fastmcp/utilities/mcp_server_config/v1/sources/base.py:22
↓ 10 callers
Function
open_deeplink
Attempt to open a Cursor deeplink URL using the system's default handler. Args: deeplink: The deeplink URL to open Returns:
fastmcp_slim/fastmcp/cli/install/cursor.py:47
↓ 10 callers
Function
resolve_root_ref
Resolve $ref at root level to meet MCP spec requirements. MCP specification requires outputSchema to have "type": "object" at the root level.
fastmcp_slim/fastmcp/utilities/json_schema.py:327
↓ 10 callers
Function
run_command
Run a MCP server or connect to a remote one. Args: server_spec: Python file, object specification (file:obj), config file, or URL
fastmcp_slim/fastmcp/cli/run.py:141
↓ 10 callers
Function
server_span
Emit or enrich a SERVER span with standard MCP attributes and auth context. When the current active span is the request's seam span (opened by
fastmcp_slim/fastmcp/server/telemetry.py:224
↓ 10 callers
Method
store_event
Store an event and return its ID. Args: stream_id: ID of the stream the event belongs to message: The JSON-RPC messag
fastmcp_slim/fastmcp/server/event_store.py:151
↓ 10 callers
Function
telemetry_mode
Resolve the effective telemetry mode for the current context. This is `fastmcp.settings.telemetry_mode`, except that an active `suppress_fast
fastmcp_slim/fastmcp/telemetry.py:86
↓ 10 callers
Function
tool_schema
Build the server and return the generated input schema for create_pet.
tests/server/providers/openapi/test_openapi_discriminator.py:162
↓ 10 callers
Function
user_meta
Strip the SDK's `serverInfo` stamp from a result's `_meta`. Every 2026-era result carries `io.modelcontextprotocol/serverInfo` (spec #3002),
tests/conftest.py:27
↓ 10 callers
Method
validate
(token: str)
tests/server/auth/providers/test_debug.py:31
↓ 10 callers
Function
validate_proxy
Validate OIDC proxy.
tests/server/auth/test_oidc_proxy.py:429
↓ 10 callers
Method
verify_token
Verify a token by trying the server, then each verifier in order. Each source is tried independently. If a source raises an exception,
fastmcp_slim/fastmcp/server/auth/auth.py:751
↓ 10 callers
Method
verify_token
(self, token: str)
tests/server/auth/test_multi_auth.py:15
↓ 10 callers
Method
version
(self)
fastmcp_slim/fastmcp/server/server.py:512
↓ 10 callers
Method
wrap
Wrap a Tool to delegate execution to the server's middleware.
fastmcp_slim/fastmcp/server/providers/fastmcp_provider.py:59
↓ 9 callers
Function
_convert_messages_to_google_genai_content
Convert MCP messages to Google GenAI content.
fastmcp_slim/fastmcp/client/sampling/handlers/google_genai.py:276
↓ 9 callers
Function
_elicit
A single-field form elicitation request keyed by ``key``.
tests/server/test_mrtr_guards.py:45
↓ 9 callers
Function
_elicit_request
A single-field form elicitation for *field*.
tests/conformance/server.py:397
↓ 9 callers
Function
_get_bridge
Attempts to connect to the Hue bridge using settings.
examples/smart_home/src/smart_home/lights/hue_utils.py:9
↓ 9 callers
Function
_key
( partition: str, *, method: str = "tools/list", params_key: str = "" )
tests/client/client/test_kv_response_cache.py:42
↓ 9 callers
Method
_make_proxy
(self, jwt_verifier, **kwargs)
tests/server/auth/oauth_proxy/test_tokens.py:815
↓ 9 callers
Function
_opted_in_request
Bind a request context carrying the tasks opt-in for a `tools/call`.
tests/tasks/task_helpers.py:85
↓ 9 callers
Function
_prefix
(docket: Docket, task_scope: str | None, task_id: str)
fastmcp_tasks/fastmcp_tasks/input_store.py:77
↓ 9 callers
Method
_prefix_scopes_for_azure
Prefix unprefixed custom API scopes with identifier_uri for Azure. This helper centralizes the scope prefixing logic used in both aut
fastmcp_slim/fastmcp/server/auth/providers/azure.py:411
↓ 9 callers
Function
_response_to_result_with_tools
Convert Google GenAI response to CreateMessageResultWithTools.
fastmcp_slim/fastmcp/client/sampling/handlers/google_genai.py:350
↓ 9 callers
Function
_strip_remote_refs
Return a deep copy of *obj* with non-local ``$ref`` values removed. Local refs (starting with ``#``) are kept intact. Remote refs (``http://
fastmcp_slim/fastmcp/utilities/json_schema.py:90
↓ 9 callers
Method
_transform_error
Transform non-MCP errors to proper MCP errors.
fastmcp_slim/fastmcp/server/middleware/error_handling.py:80
↓ 9 callers
Method
add_resource
Add a resource to the server. Args: resource: A Resource instance or @resource-decorated function to add Returns:
fastmcp_slim/fastmcp/server/server.py:1953
↓ 9 callers
Function
build_client_redirect
Build a client-facing authorization redirect that carries exactly one `iss`. Every redirect this server sends back to an OAuth client from the
fastmcp_slim/fastmcp/server/auth/redirect_validation.py:68
↓ 9 callers
Function
check_for_newer_version
Check if a newer version of FastMCP is available. Returns: The latest version string if newer than current, None otherwise.
fastmcp_slim/fastmcp/utilities/version_check.py:124
↓ 9 callers
Method
connect
( self, *, transport_options: TransportOptions | None = None, **session_kwargs
fastmcp_slim/fastmcp/client/transports/stdio.py:97
↓ 9 callers
Function
decode_jwt_header
Decode JWT header without signature verification. Useful for extracting the key ID (kid) for JWKS lookup. Args: token: JWT token str
fastmcp_slim/fastmcp/utilities/auth.py:32
↓ 9 callers
Function
fetch_json
Fetch a well-known document from a mounted authenticated server.
tests/server/auth/test_issuer_url_identity.py:100
↓ 9 callers
Function
format_tool_signature
Build ``name(param: type, ...) -> return_type`` from a tool's JSON schemas.
fastmcp_slim/fastmcp/cli/client.py:370
↓ 9 callers
Function
generate_cli_script
Generate the full CLI script source code.
fastmcp_slim/fastmcp/cli/generate.py:283
↓ 9 callers
Function
generate_goose_deeplink
Generate a Goose deeplink for installing an MCP extension. Args: name: Human-readable display name for the extension. command: Th
fastmcp_slim/fastmcp/cli/install/goose.py:29
↓ 9 callers
Function
get_http_headers
Return HTTP headers from an ambient server request, when available. The standalone client package has no server request context. When the full
fastmcp_slim/fastmcp/client/dependencies.py:4
↓ 9 callers
Method
increment
Atomically increment the current progress value.
fastmcp_slim/fastmcp/server/dependencies.py:1253
↓ 9 callers
Function
infer_transport
(transport: ClientTransportT)
fastmcp_slim/fastmcp/client/transports/inference.py:28
↓ 9 callers
Method
info
()
tests/server/versioning/test_mounting.py:55
↓ 9 callers
Function
inject_trace_context
Inject current trace context into a meta dict for MCP request propagation. Args: meta: Optional existing meta dict to merge with trace co
fastmcp_slim/fastmcp/telemetry.py:152
↓ 9 callers
Method
is_cimd_client_id
Check if a client_id looks like a CIMD URL. CIMD URLs must be HTTPS with a host and non-root path.
fastmcp_slim/fastmcp/server/auth/cimd.py:282
↓ 9 callers
Function
is_ip_allowed
Check if an IP address is allowed (must be globally routable unicast). Uses ip.is_global which catches: - Private (10.x, 172.16-31.x, 192.168
fastmcp_slim/fastmcp/server/auth/ssrf.py:137
↓ 9 callers
Function
mode
Set `fastmcp.settings.telemetry_mode` for the duration of a test.
tests/telemetry/test_interop.py:34
↓ 9 callers
Function
normalize_timeout_to_seconds
Normalize a timeout value to seconds (float). Args: value: Timeout value as int/float (seconds), timedelta, or None. Zero val
fastmcp_slim/fastmcp/utilities/timeout.py:28
↓ 9 callers
Method
read
Read the resource content. Subclasses implement this to return resource data. Supported return types: - str: Text content
fastmcp_slim/fastmcp/resources/base.py:413
↓ 9 callers
Function
resolve_name
Resolve a server name (or ``source:name``) to a transport. Raises :class:`ValueError` when the name is not found or is ambiguous.
fastmcp_slim/fastmcp/cli/discovery.py:331
↓ 9 callers
Method
set_total
Set the total/target value for progress tracking.
fastmcp_slim/fastmcp/server/dependencies.py:1248
↓ 9 callers
Method
validate_assertion
Validate JWT assertion from client. Args: assertion: The JWT assertion string client_id: Expected client_id (must mat
fastmcp_slim/fastmcp/server/auth/cimd.py:505
↓ 9 callers
Function
validate_config
Validate an OIDC configuration against the source dict.
tests/server/auth/test_oidc_proxy.py:247
↓ 9 callers
Function
without_injected_parameters
Create a wrapper function without injected parameters. Returns a wrapper that excludes Context and Docket dependency parameters, making it sa
fastmcp_slim/fastmcp/server/dependencies.py:659
↓ 8 callers
Function
CurrentDocket
Get the current Docket instance managed by FastMCP. This dependency provides access to the Docket instance that FastMCP automatically creates
fastmcp_tasks/fastmcp_tasks/dependencies.py:105
↓ 8 callers
Function
_ask
( request: ElicitRequest, key: str, request_state: str | None )
tests/server/test_mrtr_guards.py:58
↓ 8 callers
Function
_combine_schemas
Combines parameter and request body schemas into a single schema. Handles parameter name collisions by adding location suffixes. This is
fastmcp_slim/fastmcp/utilities/openapi/schemas.py:626
↓ 8 callers
Method
_get_additional_http_routes
Get all additional HTTP routes including from mounted servers. Collects custom HTTP routes registered via ``@server.custom_route()``
fastmcp_slim/fastmcp/server/mixins/transport.py:182
↓ 8 callers
Function
_is_object_schema
Check if a JSON schema represents an object type.
fastmcp_slim/fastmcp/tools/function_parsing.py:217
← previous
next →
201–300 of 11,669, ranked by callers