Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PrefectHQ/fastmcp
/ functions
Functions
10,524 in github.com/PrefectHQ/fastmcp
⨍
Functions
10,524
◇
Types & classes
1,545
↳
Endpoints
103
↓ 10 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:389
↓ 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:294
↓ 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:136
↓ 10 callers
Function
ssrf_safe_fetch
Fetch URL with comprehensive SSRF protection and DNS pinning. Security measures: 1. HTTPS only 2. DNS resolution with IP validation 3
fastmcp_slim/fastmcp/server/auth/ssrf.py:242
↓ 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:146
↓ 10 callers
Method
to_transport
(self)
fastmcp_slim/fastmcp/mcp_config.py:201
↓ 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:591
↓ 10 callers
Method
verify_token
(self, token: str)
tests/server/auth/test_multi_auth.py:14
↓ 10 callers
Method
version
(self)
fastmcp_slim/fastmcp/server/server.py:481
↓ 10 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:539
↓ 10 callers
Method
wrap
Wrap a Tool to delegate execution to the server's middleware.
fastmcp_slim/fastmcp/server/providers/fastmcp_provider.py:64
↓ 9 callers
Method
_add_component
Add a component to unified storage. Args: component: The component to add. Returns: The component that was a
fastmcp_slim/fastmcp/server/providers/local_provider/local_provider.py:178
↓ 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:272
↓ 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
Method
_lifespan_manager
(self: FastMCP)
fastmcp_slim/fastmcp/server/mixins/lifespan.py:188
↓ 9 callers
Method
_make_proxy
(self, jwt_verifier, **kwargs)
tests/server/auth/oauth_proxy/test_tokens.py:760
↓ 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:346
↓ 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:57
↓ 9 callers
Method
_transform_error
Transform non-MCP errors to proper MCP errors.
fastmcp_slim/fastmcp/server/middleware/error_handling.py:81
↓ 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
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_request
Get the current HTTP request. Tries MCP SDK's request_ctx first, then falls back to FastMCP's HTTP context. In background tasks, returns a sy
fastmcp_slim/fastmcp/server/dependencies.py:361
↓ 9 callers
Method
increment
Atomically increment the current progress value.
fastmcp_slim/fastmcp/server/dependencies.py:1263
↓ 9 callers
Function
infer_transport
(transport: ClientTransportT)
fastmcp_slim/fastmcp/client/transports/inference.py:28
↓ 9 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:483
↓ 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_docket_available
Check if a compatible pydocket (>= 0.19.0) is installed and importable. Three things have to be true for fastmcp's task features to work: 1
fastmcp_slim/fastmcp/server/dependencies.py:111
↓ 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:106
↓ 9 callers
Method
list_tools
List tools with all transforms applied. Applies transforms sequentially: base → transforms (in order). Each transform receives the re
fastmcp_slim/fastmcp/server/providers/base.py:142
↓ 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
run_http_async
Run the server using HTTP transport. Args: transport: Transport protocol to use - "http" (default), "streamable-http", or "sse"
fastmcp_slim/fastmcp/server/mixins/transport.py:258
↓ 9 callers
Method
send_notification
Send a notification to the client immediately. Args: notification: An MCP notification instance (e.g., ToolListChangedNotificatio
fastmcp_slim/fastmcp/server/context.py:789
↓ 9 callers
Method
set_total
Set the total/target value for progress tracking.
fastmcp_slim/fastmcp/server/dependencies.py:1258
↓ 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
↓ 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:467
↓ 8 callers
Function
_extract_csrf
Extract CSRF token from HTML form.
tests/server/auth/test_oauth_consent_flow.py:144
↓ 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:120
↓ 8 callers
Function
_merge_defaults
Merge defaults with provided data at all levels.
fastmcp_slim/fastmcp/utilities/json_schema_type.py:755
↓ 8 callers
Function
_param_to_cli_flag
Convert a JSON Schema property name to its CLI flag form. Replicates cyclopts' default_name_transform: camelCase → snake_case, lowercase, und
fastmcp_slim/fastmcp/cli/generate.py:534
↓ 8 callers
Method
_read
(self, task_meta: None = None)
fastmcp_slim/fastmcp/resources/base.py:366
↓ 8 callers
Method
_run_middleware
Builds and executes the middleware chain.
fastmcp_slim/fastmcp/server/server.py:507
↓ 8 callers
Function
_slugify
Convert a display name to a URL-safe identifier. Lowercases, replaces non-alphanumeric runs with hyphens, and strips leading/trailing hyphens
fastmcp_slim/fastmcp/cli/install/goose.py:19
↓ 8 callers
Function
_to_python_identifier
Sanitize a string into a valid Python identifier.
fastmcp_slim/fastmcp/cli/generate.py:155
↓ 8 callers
Function
_unwrap_result
Extract the logical return value from a ToolResult.
tests/experimental/transforms/test_code_mode.py:49
↓ 8 callers
Method
_with_reload
Acquire the reload lock, reload if needed, then run *coro_fn*. Holding the lock across both the reload and the read prevents concurre
fastmcp_slim/fastmcp/server/providers/filesystem.py:162
↓ 8 callers
Function
apply_session_transforms
Apply session-specific visibility transforms to components. This helper applies session-level enable/disable rules by marking components with
fastmcp_slim/fastmcp/server/transforms/visibility.py:497
↓ 8 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
↓ 8 callers
Function
discover_files
Recursively discover all Python files under a directory. Excludes __init__.py files (they're for package structure, not components). Args:
fastmcp_slim/fastmcp/server/providers/filesystem_discovery.py:35
↓ 8 callers
Method
get_app_tool
Look up an app-visible tool by original name, bypassing transforms. Searches for a tool named ``tool_name`` tagged with the given app
fastmcp_slim/fastmcp/server/providers/base.py:187
↓ 8 callers
Function
get_client
Get or create an authenticated ATProto client.
examples/atproto_mcp/src/atproto_mcp/_atproto/_client.py:10
↓ 8 callers
Function
get_fastmcp_metadata
Extract FastMCP metadata from a component's meta dict. Handles both the current `fastmcp` namespace and the legacy `_fastmcp` namespace for c
fastmcp_slim/fastmcp/utilities/components.py:26
↓ 8 callers
Method
get_obo_credential
Get a cached or new OnBehalfOfCredential for OBO token exchange. Credentials are cached by user assertion so the Azure SDK's internal
fastmcp_slim/fastmcp/server/auth/providers/azure.py:620
↓ 8 callers
Method
get_resource
Get a resource by URI, filtering disabled resources. Overrides Provider.get_resource() to add visibility filtering after all transfor
fastmcp_slim/fastmcp/server/server.py:870
↓ 8 callers
Method
get_session_id
Get the session ID for this transport, if available.
fastmcp_slim/fastmcp/client/transports/base.py:76
↓ 8 callers
Method
get_task_status
Query the status of a background task. Sends a 'tasks/get' MCP protocol request over the existing transport. Args: task_
fastmcp_slim/fastmcp/client/mixins/task_management.py:33
↓ 8 callers
Method
list_resource_templates
List resource templates with all transforms applied. Components may be marked as disabled but are NOT filtered here.
fastmcp_slim/fastmcp/server/providers/base.py:276
↓ 8 callers
Method
load_server
Load server from filesystem.
fastmcp_slim/fastmcp/utilities/mcp_server_config/v1/sources/filesystem.py:64
↓ 8 callers
Function
normalize_timeout_to_timedelta
Normalize a timeout value to a timedelta. Args: value: Timeout value as int/float (seconds), timedelta, or None Returns: tim
fastmcp_slim/fastmcp/utilities/timeout.py:8
↓ 8 callers
Method
on_message
(self, message: Message)
fastmcp_slim/fastmcp/client/messages.py:76
↓ 8 callers
Function
paginate_sequence
Paginate a sequence of items. Args: items: The full sequence to paginate. cursor: Optional cursor from a previous request. None f
fastmcp_slim/fastmcp/utilities/pagination.py:50
↓ 8 callers
Method
read
Read the file content.
fastmcp_slim/fastmcp/resources/types.py:99
↓ 8 callers
Method
read_resource
Read a resource by its URI. For static resources, provide the exact URI. For templated resources, provide the URI with templa
fastmcp_slim/fastmcp/server/transforms/resources_as_tools.py:138
↓ 8 callers
Method
register_tools
Registers all methods marked with @mcp_tool with the FastMCP server. Args: mcp_server: The FastMCP server instance to register to
fastmcp_slim/fastmcp/contrib/mcp_mixin/mcp_mixin.py:203
↓ 8 callers
Method
replay_events_after
Replay events that occurred after the specified event ID. Args: last_event_id: The ID of the last event the client received
fastmcp_slim/fastmcp/server/event_store.py:187
↓ 8 callers
Method
search
(query: str)
tests/server/sampling/test_prepare_tools.py:22
↓ 8 callers
Function
serialize_tools_for_output_markdown
Serialize tools to compact markdown, using ~65-70% fewer tokens than JSON.
fastmcp_slim/fastmcp/server/transforms/search/base.py:138
↓ 8 callers
Function
transform_context_annotations
Transform ctx: Context into ctx: Context = CurrentContext(). Transforms ALL params typed as Context to use Docket's DI system, unless they al
fastmcp_slim/fastmcp/server/dependencies.py:180
↓ 8 callers
Function
validate_elicitation_json_schema
Validate that a JSON schema follows MCP elicitation requirements. This ensures the schema is compatible with MCP elicitation requirements: -
fastmcp_slim/fastmcp/server/elicitation.py:387
↓ 8 callers
Method
verify_token
Verify GitHub OAuth token by calling GitHub API.
fastmcp_slim/fastmcp/server/auth/providers/github.py:82
↓ 8 callers
Method
verify_token
Verify a bearer token using OAuth 2.0 Token Introspection (RFC 7662). This method makes a POST request to the introspection endpoint
fastmcp_slim/fastmcp/server/auth/providers/introspection.py:179
↓ 7 callers
Function
CurrentFastMCP
Get the current FastMCP server instance. This dependency provides access to the active FastMCP server. Returns: A dependency that re
fastmcp_slim/fastmcp/server/dependencies.py:1000
↓ 7 callers
Method
__init__
(self, client_factory: ClientFactoryT, **kwargs: Any)
fastmcp_slim/fastmcp/server/providers/proxy.py:127
↓ 7 callers
Function
_build_client
Build a ``Client`` from a resolved server spec. Applies ``auth='oauth'`` automatically for HTTP-based targets unless the caller explicitly pa
fastmcp_slim/fastmcp/cli/client.py:228
↓ 7 callers
Function
_build_uvx_command
Build a uvx command for running a FastMCP server. Goose requires uvx (not uv run) as the command. The uvx format is: uvx [--with pkg] [--
fastmcp_slim/fastmcp/cli/install/goose.py:58
↓ 7 callers
Method
_create_before_message
( self, context: MiddlewareContext[Any] )
fastmcp_slim/fastmcp/server/middleware/logging.py:56
↓ 7 callers
Method
_exchange
(self, proxy, code="test-code", **idp_token_overrides)
tests/server/auth/oauth_proxy/test_tokens.py:783
↓ 7 callers
Function
_get_npx_command
Get the correct npx command for the current platform.
fastmcp_slim/fastmcp/cli/cli.py:49
↓ 7 callers
Method
_get_verification_token
Get the token to verify from the upstream token set. When verify_id_token is enabled, returns the id_token from the upstream token re
fastmcp_slim/fastmcp/server/auth/oidc_proxy.py:459
↓ 7 callers
Function
_make_file
( name: str = "test.txt", content: str = "hello world", mime_type: str = "text/plain", )
tests/apps/test_file_upload.py:37
↓ 7 callers
Method
_make_tool
( self, name: str = "my_tool", properties: dict[str, Any] | None = None, requi
tests/cli/test_client_commands.py:157
↓ 7 callers
Function
_prune_param
Return a new schema with *param* removed from `properties`, `required`, and (if no longer referenced) `$defs`.
fastmcp_slim/fastmcp/utilities/json_schema.py:347
↓ 7 callers
Function
_sampling_content_to_google_genai_part
Convert MCP content to Google GenAI Part.
fastmcp_slim/fastmcp/client/sampling/handlers/google_genai.py:195
↓ 7 callers
Function
_scan_claude_code
Scan ``~/.claude.json`` for global and project-scoped MCP servers.
fastmcp_slim/fastmcp/cli/discovery.py:157
↓ 7 callers
Function
_schema_type_label
Return a human-readable type label for a property schema.
fastmcp_slim/fastmcp/cli/generate.py:548
↓ 7 callers
Method
_time_operation
Helper method to time any operation.
fastmcp_slim/fastmcp/server/middleware/timing.py:91
↓ 7 callers
Method
authorize
Start OAuth transaction and route through consent interstitial. Flow: 1. Validate client's resource matches server's resource URL (se
fastmcp_slim/fastmcp/server/auth/oauth_proxy/proxy.py:898
↓ 7 callers
Function
combine_lifespans
Combine multiple lifespans into a single lifespan. Useful when mounting FastMCP into FastAPI and you need to run both your app's lifespan and
fastmcp_slim/fastmcp/utilities/lifespan.py:12
↓ 7 callers
Function
combined
(app: AppT)
fastmcp_slim/fastmcp/utilities/lifespan.py:47
↓ 7 callers
Function
create_jwt
Create a test JWT token.
tests/utilities/test_auth.py:15
↓ 7 callers
Method
create_server
(self, include_tags=None, exclude_tags=None)
tests/server/providers/test_local_provider_resources.py:678
↓ 7 callers
Method
create_server
(self, include_tags=None, exclude_tags=None)
tests/server/providers/test_local_provider_resources.py:830
↓ 7 callers
Method
create_server
(self, include_tags=None, exclude_tags=None)
tests/server/providers/test_local_provider_prompts.py:420
↓ 7 callers
Method
create_server
(self, include_tags=None, exclude_tags=None)
tests/server/providers/local_provider_tools/test_tags.py:42
↓ 7 callers
Function
derive_jwt_key
Derive JWT signing key from a high-entropy key material and server salt.
fastmcp_slim/fastmcp/server/auth/jwt_issuer.py:30
← previous
next →
201–300 of 10,524, ranked by callers