Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PrefectHQ/fastmcp
/ functions
Functions
12,199 in github.com/PrefectHQ/fastmcp
⨍
Functions
12,199
◇
Types & classes
1,854
↳
Endpoints
123
↓ 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:298
↓ 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:340
↓ 9 callers
Method
set_total
Set the total/target value for progress tracking.
fastmcp_slim/fastmcp/server/dependencies.py:1263
↓ 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:665
↓ 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:57
↓ 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
_cookie_name
Return secure cookie name for HTTPS, fallback for HTTP development.
fastmcp_slim/fastmcp/server/auth/oauth_proxy/consent.py:110
↓ 8 callers
Function
_era_reporting_backend
A dual-era backend for the mirroring tests. Hosts the three-round guard tool (``book_flight``), a tool that reports the protocol version its
tests/server/test_mrtr_guards.py:521
↓ 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:181
↓ 8 callers
Function
_hash_token
Hash a token for secure storage lookup. Uses SHA-256 to create a one-way hash. The original token cannot be recovered from the hash, providin
fastmcp_slim/fastmcp/server/auth/oauth_proxy/models.py:152
↓ 8 callers
Function
_is_object_schema
Check if a JSON schema represents an object type.
fastmcp_slim/fastmcp/tools/function_parsing.py:191
↓ 8 callers
Function
_merge_defaults
Merge defaults with provided data at all levels.
fastmcp_slim/fastmcp/utilities/json_schema_type.py:755
↓ 8 callers
Method
_on_list_tools
List all available tools. Supports pagination via params.cursor.
fastmcp_slim/fastmcp/server/mixins/mcp_operations.py:132
↓ 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
Server entry point for resource reads. The server calls this method instead of ``read()`` directly so that subclasses can customize d
fastmcp_slim/fastmcp/resources/base.py:446
↓ 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
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:511
↓ 8 callers
Function
build_proxy
Build an OAuth proxy mounted at BASE_URL, optionally with a distinct issuer.
tests/server/auth/test_issuer_url_identity.py:61
↓ 8 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
↓ 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
Function
extract_trace_context
Extract trace context from an MCP request meta dict. If already in a valid trace (e.g., from HTTP propagation), the existing trace context is
fastmcp_slim/fastmcp/telemetry.py:263
↓ 8 callers
Function
fn
(n: int, ctx: Any)
tests/tasks/server/test_guard_reentrant.py:228
↓ 8 callers
Method
from_openapi
Create a FastMCP server from an OpenAPI specification. Args: openapi_spec: OpenAPI schema as a dictionary cl
fastmcp_slim/fastmcp/server/server.py:2379
↓ 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:22
↓ 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:629
↓ 8 callers
Method
get_routes
Get OAuth routes with custom handlers for better error UX. This method creates standard OAuth routes and replaces: - /authorize endpo
fastmcp_slim/fastmcp/server/auth/oauth_proxy/proxy.py:2386
↓ 8 callers
Function
get_session
Resolve and validate a `Session` for an explicit `session_id`. Pair with a `session_id: SessionId` tool argument (the agent obtains an id fro
fastmcp_slim/fastmcp/server/dependencies.py:485
↓ 8 callers
Function
inspect_fastmcp_v1
Extract information from a FastMCP v1.x instance using a Client. Args: mcp: The FastMCP v1.x instance to inspect Returns: Fa
fastmcp_slim/fastmcp/utilities/inspect.py:251
↓ 8 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:249
↓ 8 callers
Method
list_prompts
List prompts with all transforms applied. Components may be marked as disabled but are NOT filtered here.
fastmcp_slim/fastmcp/server/providers/base.py:321
↓ 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:278
↓ 8 callers
Method
list_resources
List resources with all transforms applied. Components may be marked as disabled but are NOT filtered here.
fastmcp_slim/fastmcp/server/providers/base.py:238
↓ 8 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
↓ 8 callers
Method
list_tools_mcp
Send a tools/list request and return the complete MCP protocol result. Args: cursor: Optional pagination cursor from a previous r
fastmcp_slim/fastmcp/client/mixins/tools.py:34
↓ 8 callers
Method
load_server
Load server from filesystem.
fastmcp_slim/fastmcp/utilities/mcp_server_config/v1/sources/filesystem.py:64
↓ 8 callers
Function
login
Sign in to Prefect Horizon.
fastmcp_slim/fastmcp/cli/deploy/command.py:195
↓ 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
Function
parse_hashed_backend_name
Parse ``<HASH_LENGTH hex>_<rest>`` → ``(hash, local_tool_name)`` or None.
fastmcp_slim/fastmcp/server/providers/addressing.py:53
↓ 8 callers
Method
read
Read the file content.
fastmcp_slim/fastmcp/resources/types.py:99
↓ 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:191
↓ 8 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
↓ 8 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:884
↓ 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:140
↓ 8 callers
Method
start
Start the mock OAuth server.
tests/server/auth/oauth_proxy/conftest.py:214
↓ 8 callers
Method
to_resource_content
( self, mime_type: str | None = None, annotations: Annotations | None = None, )
fastmcp_slim/fastmcp/utilities/types.py:415
↓ 8 callers
Function
transform_context_annotations
Transform injected-by-type params into Dependency-defaulted params. Transforms ALL params typed as Context (into ``= CurrentContext()``) and as
fastmcp_slim/fastmcp/server/dependencies.py:281
↓ 8 callers
Function
update_task
Call the `tasks/update` handler within the given auth scope.
tests/tasks/task_helpers.py:151
↓ 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:395
↓ 8 callers
Method
verify_token
Verify GitHub OAuth token by calling GitHub API.
fastmcp_slim/fastmcp/server/auth/providers/github.py:91
↓ 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
Method
__init__
(self, client_factory: ClientFactoryT, **kwargs: Any)
fastmcp_slim/fastmcp/server/providers/proxy.py:347
↓ 7 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
↓ 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
_dispatch_component_middleware
Run the interior middleware chain for a component operation. This is the dispatch site for the component methods (``tools/call``, ``t
fastmcp_slim/fastmcp/server/server.py:579
↓ 7 callers
Function
_elicited_field
The accepted value of *field* from the elicitation answered under *key*.
tests/conformance/server.py:428
↓ 7 callers
Method
_exchange
(self, proxy, code="test-code", **idp_token_overrides)
tests/server/auth/oauth_proxy/test_tokens.py:838
↓ 7 callers
Function
_form
(request: httpx2.Request)
tests/server/auth/oauth_proxy/test_upstream_client.py:23
↓ 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:480
↓ 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:389
↓ 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:199
↓ 7 callers
Function
_scan_claude_code
Scan ``~/.claude.json`` for global and project-scoped MCP servers.
fastmcp_slim/fastmcp/cli/discovery.py:166
↓ 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
Function
as_principal
(token: SDKAccessToken | None)
tests/server/test_session_provider.py:59
↓ 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:1109
↓ 7 callers
Function
build_cache_hints
Build the per-method `CacheHint` map for the SDK low-level server. `cache_ttl` is in seconds and is converted to the wire's milliseconds. When
fastmcp_slim/fastmcp/server/caching.py:29
↓ 7 callers
Function
build_id_server
Server whose cart tools take an explicit `session_id: SessionId`.
tests/server/test_session_provider.py:88
↓ 7 callers
Function
build_server
()
tests/utilities/test_asgi_transport.py:19
↓ 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
Function
create_openapi_server
Helper to create a FastMCP server with OpenAPIProvider.
tests/server/providers/openapi/test_openapi_features.py:25
↓ 7 callers
Method
create_server
(self, include_tags=None, exclude_tags=None)
tests/server/providers/test_local_provider_resources.py:687
↓ 7 callers
Method
create_server
(self, include_tags=None, exclude_tags=None)
tests/server/providers/test_local_provider_resources.py:839
↓ 7 callers
Method
create_server
(self, include_tags=None, exclude_tags=None)
tests/server/providers/test_local_provider_prompts.py:423
↓ 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
delegate_span
Create an INTERNAL span for provider delegation. Used by FastMCPProvider when delegating to mounted servers. Automatically records any except
fastmcp_slim/fastmcp/server/telemetry.py:305
↓ 7 callers
Method
exchange_authorization_code
( self, client: OAuthClientInformationFull, authorization_code: AuthorizationCode )
tests/server/test_auth_integration.py:74
↓ 7 callers
Function
form_body
Parse an x-www-form-urlencoded request body into a dict.
tests/client/auth/test_client_credentials.py:120
↓ 7 callers
Function
forward
Forward to parent tool with argument transformation applied. This function can only be called from within a transformed tool's custom functio
fastmcp_slim/fastmcp/tools/tool_transform.py:47
↓ 7 callers
Method
from_file
Load configuration from JSON file.
fastmcp_slim/fastmcp/mcp_config.py:351
↓ 7 callers
Function
generate_cursor_deeplink
Generate a Cursor deeplink for installing the MCP server. Args: server_name: Name of the server server_config: Server configurati
fastmcp_slim/fastmcp/cli/install/cursor.py:22
↓ 7 callers
Method
get_client
Fetch CIMD document and create synthetic OAuth client. Args: client_id_url: HTTPS URL pointing to CIMD document Returns:
fastmcp_slim/fastmcp/server/auth/cimd.py:748
← previous
next →
301–400 of 12,199, ranked by callers