Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PrefectHQ/fastmcp
/ functions
Functions
13,374 in github.com/PrefectHQ/fastmcp
⨍
Functions
13,374
◇
Types & classes
2,002
↳
Endpoints
150
↓ 10 callers
Method
info
()
tests/server/versioning/test_mounting.py:55
↓ 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
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
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:275
↓ 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
start
Start the mock OAuth server.
tests/server/auth/oauth_proxy/conftest.py:214
↓ 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
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:527
↓ 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:558
↓ 10 callers
Method
wrap
Wrap a Tool to delegate execution to the server's middleware.
fastmcp_slim/fastmcp/server/providers/fastmcp_provider.py:60
↓ 9 callers
Function
_bearer
(key_pair: RSAKeyPair, scopes: list[str])
tests/contrib/test_component_manager.py:676
↓ 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
_convert_to_content
Convert a result to a sequence of content objects.
fastmcp_slim/fastmcp/tools/base.py:573
↓ 9 callers
Function
_elicit
A single-field form elicitation request keyed by ``key``.
tests/server/test_mrtr_guards.py:44
↓ 9 callers
Function
_elicit_request
A single-field form elicitation for *field*.
tests/conformance/server.py:397
↓ 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:412
↓ 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:192
↓ 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:1920
↓ 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:132
↓ 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:36
↓ 9 callers
Function
dedupe_with_versions
Deduplicate components by key, keeping highest version. Groups components by key, selects the highest version from each group, and injects av
fastmcp_slim/fastmcp/utilities/versions.py:306
↓ 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
fn
(n: int, ctx: Any)
tests/tasks/server/test_guard_reentrant.py:228
↓ 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
Method
get_oidc_configuration
Gets the OIDC configuration for the specified configuration URL. Args: config_url: The OIDC configuration URL strict:
fastmcp_slim/fastmcp/server/auth/oidc_proxy.py:570
↓ 9 callers
Method
increment
Atomically increment the current progress value.
fastmcp_slim/fastmcp/server/dependencies.py:1327
↓ 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:141
↓ 9 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:33
↓ 9 callers
Method
load
(self, more: bool = False)
scripts/rank_issues_tui.py:323
↓ 9 callers
Function
make_auth_server
(*middleware: Middleware)
tests/server/middleware/test_tool_injection.py:305
↓ 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
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:60
↓ 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:1322
↓ 9 callers
Function
set_up_component_manager
Set up HTTP routes for enabling/disabling tools, resources, and prompts. The routes require the same authentication as the MCP endpoint of the
fastmcp_slim/fastmcp/contrib/component_manager/component_manager.py:21
↓ 9 callers
Method
to_resource_content
( self, mime_type: str | None = None, annotations: Annotations | None = None, )
fastmcp_slim/fastmcp/utilities/types.py:446
↓ 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:724
↓ 9 callers
Method
wrap_transform
Return a new provider with this transform applied (immutable). Unlike add_transform() which mutates this provider, wrap_transform() r
fastmcp_slim/fastmcp/server/providers/base.py:148
↓ 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:714
↓ 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
_is_object_schema
Check if a JSON schema represents an object type.
fastmcp_slim/fastmcp/tools/function_parsing.py:219
↓ 8 callers
Function
_make_protocol_era_server
(name: str, starts: list[str] | None = None)
tests/test_mcp_config.py:176
↓ 8 callers
Function
_merge_defaults
Merge defaults with provided data at all levels.
fastmcp_slim/fastmcp/utilities/json_schema_type.py:1024
↓ 8 callers
Method
_on_list_tools
( self, ctx: ServerRequestContext, params: mcp_types.Paginated
tests/server/test_pagination.py:254
↓ 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:177
↓ 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
(auth_token: str | None = None)
tests/downstream/server.py:46
↓ 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
call
Invoke a tool the way an agent does, so the result is a ToolMessage with its artifact.
tests/downstream/smoke_langchain_mcp_adapters.py:61
↓ 8 callers
Method
close
(self)
tests/client/client/test_client.py:972
↓ 8 callers
Method
connect
( self, *, transport_options: TransportOptions | None = None, **session_kwargs
fastmcp_slim/fastmcp/client/transports/stdio.py:97
↓ 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
Method
exchange_authorization_code
( self, client: OAuthClientInformationFull, authorization_code: AuthorizationCode )
tests/server/test_auth_integration.py:74
↓ 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
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:237
↓ 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:2450
↓ 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:544
↓ 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:308
↓ 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
Method
parse
Parse the OpenAPI schema into HTTP routes.
fastmcp_slim/fastmcp/utilities/openapi/parser.py:702
↓ 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:78
↓ 8 callers
Function
process_common_args
Process common arguments shared by all install commands. Handles both fastmcp.json config files and traditional file.py:object syntax.
fastmcp_slim/fastmcp/cli/install/shared.py:182
↓ 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
( self, code: str, *, inputs: dict[str, Any] | None = None, external_f
fastmcp_slim/fastmcp/experimental/transforms/code_mode.py:206
↓ 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
← previous
next →
301–400 of 13,374, ranked by callers