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
↓ 5 callers
Method
async_auth_flow
HTTPX auth flow with automatic retry on stale cached credentials. If the OAuth flow fails due to invalid/stale client credentials, cl
fastmcp_slim/fastmcp/client/auth/oauth.py:402
↓ 5 callers
Function
call_sync_fn_in_threadpool
Call a sync function in a threadpool to avoid blocking the event loop. Uses anyio.to_thread.run_sync which properly propagates contextvars, m
fastmcp_slim/fastmcp/utilities/async_utils.py:26
↓ 5 callers
Function
check_background_task
Check task mode and submit to background if requested. Args: component: The MCP component task_type: Type of task ("tool", "resou
fastmcp_slim/fastmcp/server/tasks/routing.py:26
↓ 5 callers
Function
configure_logging
Configure logging for FastMCP. Args: logger: the logger to configure level: the log level to use rich_kwargs: the pa
fastmcp_slim/fastmcp/utilities/logging.py:29
↓ 5 callers
Method
consume
Try to consume tokens from the bucket. Args: tokens: Number of tokens to consume Returns: True if tokens wer
fastmcp_slim/fastmcp/server/middleware/rate_limiting.py:39
↓ 5 callers
Function
create_function_without_params
Create a new function with the same code but without the specified parameters in annotations. This is used to exclude parameters from type a
fastmcp_slim/fastmcp/utilities/types.py:181
↓ 5 callers
Function
create_openapi_server
Helper to create a FastMCP server with OpenAPIProvider.
tests/server/providers/openapi/test_deepobject_style.py:11
↓ 5 callers
Function
create_page
Create a complete HTML page with FastMCP styling. Args: content: HTML content to place inside the page title: Page title
fastmcp_slim/fastmcp/utilities/ui.py:453
↓ 5 callers
Method
create_proxy
Create an OAuth proxy with specified storage.
tests/server/auth/test_oauth_proxy_storage.py:45
↓ 5 callers
Function
create_sse_app
Return an instance of the SSE server app. Args: server: The FastMCP server instance message_path: Path for SSE messages s
fastmcp_slim/fastmcp/server/http.py:414
↓ 5 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
↓ 5 callers
Function
default_log_handler
Default handler that properly routes server log messages to appropriate log levels.
fastmcp_slim/fastmcp/client/logging.py:17
↓ 5 callers
Function
extract_output_schema_from_responses
Extract output schema from OpenAPI responses for use as MCP tool output schema. This function finds the first successful response (200, 201,
fastmcp_slim/fastmcp/utilities/openapi/schemas.py:484
↓ 5 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:82
↓ 5 callers
Method
form
()
tests/server/providers/test_prefab_roundtrip.py:119
↓ 5 callers
Function
format_fastmcp_info
Format FastMCPInfo as FastMCP-specific JSON. This includes FastMCP-specific fields like tags, enabled, annotations, etc.
fastmcp_slim/fastmcp/utilities/inspect.py:403
↓ 5 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:2330
↓ 5 callers
Function
generate_schema
Generate JSON schema for fastmcp.json files. This is used to create the schema file that IDEs can use for validation and auto-completion.
fastmcp_slim/fastmcp/utilities/mcp_server_config/v1/mcp_server_config.py:416
↓ 5 callers
Method
get_meta
(self)
fastmcp_slim/fastmcp/server/providers/skills/skill_provider.py:41
↓ 5 callers
Method
get_setting
Get a setting. If the setting contains one or more `__`, it will be treated as a nested setting.
fastmcp_slim/fastmcp/settings.py:148
↓ 5 callers
Method
get_task_result
Retrieve the raw result of a completed background task. Sends a 'tasks/result' MCP protocol request over the existing transport. Retu
fastmcp_slim/fastmcp/client/mixins/task_management.py:56
↓ 5 callers
Function
get_task_scope
Get the authorization scope for task isolation. Returns the raw scope identifier for the current access token, or ``None`` when no auth conte
fastmcp_slim/fastmcp/server/tasks/context.py:42
↓ 5 callers
Method
get_token_expiry
(self)
fastmcp_slim/fastmcp/client/auth/oauth.py:147
↓ 5 callers
Method
getsockname
(self)
tests/client/auth/test_oauth_client.py:268
↓ 5 callers
Function
handle_phue_error
Creates a standardized error response for phue operations.
examples/smart_home/src/smart_home/lights/hue_utils.py:23
↓ 5 callers
Function
make_restricted_tag_server
()
tests/server/auth/test_authorization.py:48
↓ 5 callers
Function
mock_cognito_oidc_discovery
Context manager to mock AWS Cognito OIDC discovery endpoint.
tests/server/auth/providers/test_aws.py:12
↓ 5 callers
Method
new
(self)
fastmcp_slim/fastmcp/server/providers/proxy.py:1192
↓ 5 callers
Function
new_mock_context
Create a new mock middleware context.
tests/server/middleware/test_logging.py:40
↓ 5 callers
Method
on_status_change
Register callback for status change notifications. The callback will be invoked when a notifications/tasks/status is received for thi
fastmcp_slim/fastmcp/client/tasks.py:146
↓ 5 callers
Function
parse_frontmatter
Parse YAML frontmatter from markdown content. Args: content: Markdown content potentially starting with --- Returns: Tuple o
fastmcp_slim/fastmcp/server/providers/skills/_common.py:33
↓ 5 callers
Function
parse_header
(value: str)
fastmcp_remote/fastmcp_remote/cli.py:73
↓ 5 callers
Function
prepare
Prepare a FastMCP project by creating a persistent uv environment. This command creates a persistent uv project with all dependencies installed:
fastmcp_slim/fastmcp/cli/cli.py:1033
↓ 5 callers
Method
prepare
Prepare the Python environment using uv. Args: output_dir: Directory where the persistent uv project will be created.
fastmcp_slim/fastmcp/utilities/mcp_server_config/v1/environments/uv.py:109
↓ 5 callers
Method
register_prompts
Registers all methods marked with @mcp_prompt with the FastMCP server. Args: mcp_server: The FastMCP server instance to register
fastmcp_slim/fastmcp/contrib/mcp_mixin/mcp_mixin.py:268
↓ 5 callers
Method
register_resources
Registers all methods marked with @mcp_resource with the FastMCP server. Args: mcp_server: The FastMCP server instance to registe
fastmcp_slim/fastmcp/contrib/mcp_mixin/mcp_mixin.py:233
↓ 5 callers
Function
resolve_serialize_by_alias
Resolve the effective ``by_alias`` setting for serializing *value*. Pydantic's low-level serialization helpers (``to_json``, ``to_jsonable_py
fastmcp_slim/fastmcp/tools/base.py:65
↓ 5 callers
Function
run
Run an MCP server or connect to a remote one. The server can be specified in several ways: 1. Module approach: "server.py" - runs the module
fastmcp_slim/fastmcp/cli/cli.py:410
↓ 5 callers
Function
run_module_command
Run a Python module directly using ``python -m <module>``. When ``-m`` is used, the module manages its own server startup. No server-object d
fastmcp_slim/fastmcp/cli/run.py:272
↓ 5 callers
Method
save
(self, deps: Deps)
examples/memory.py:102
↓ 5 callers
Method
set_tokens
(self, tokens: OAuthToken)
fastmcp_slim/fastmcp/client/auth/oauth.py:127
↓ 5 callers
Function
set_up_component_manager
Set up HTTP routes for enabling/disabling tools, resources, and prompts. Args: server: The FastMCP server instance. path: Base pa
fastmcp_slim/fastmcp/contrib/component_manager/component_manager.py:17
↓ 5 callers
Function
sync_skills
Download all available skills from a server. Args: client: Connected FastMCP client target_dir: Directory where skill folders wil
fastmcp_slim/fastmcp/utilities/skills.py:218
↓ 5 callers
Method
to_audio_content
( self, mime_type: str | None = None, annotations: Annotations | None = None, )
fastmcp_slim/fastmcp/utilities/types.py:347
↓ 5 callers
Method
tool
()
tests/server/mount/test_mount.py:25
↓ 5 callers
Function
validate_command
Validate a hosted CIMD document. Fetches the document from the given URL and validates: - URL is valid CIMD URL (HTTPS, non-root path) -
fastmcp_slim/fastmcp/cli/cimd.py:144
↓ 5 callers
Method
verify_token
Verify a bearer token and return access info if valid. This method implements the TokenVerifier protocol by delegating to ou
fastmcp_slim/fastmcp/server/auth/providers/jwt.py:576
↓ 5 callers
Method
wrap
(cls, value: ToolResult)
fastmcp_slim/fastmcp/server/middleware/caching.py:88
↓ 4 callers
Function
CurrentContext
Get the current FastMCP Context instance. This dependency provides access to the active FastMCP Context for the current MCP operation (tool/r
fastmcp_slim/fastmcp/server/dependencies.py:843
↓ 4 callers
Method
__init__
Create a Task wrapper. Args: client: The FastMCP client task_id: The task identifier immediate_r
fastmcp_slim/fastmcp/client/tasks.py:61
↓ 4 callers
Method
__init__
Initialize a FastMCPProvider. Args: server: The FastMCP server to wrap.
fastmcp_slim/fastmcp/server/providers/fastmcp_provider.py:517
↓ 4 callers
Method
__init__
Initialize the multi-auth provider. Args: server: Optional auth provider (e.g., OAuthProxy) that owns routes and
fastmcp_slim/fastmcp/server/auth/auth.py:533
↓ 4 callers
Function
_apply_pagination
Apply pagination to items, raising McpError for invalid cursors. If page_size is None, returns all items without pagination.
fastmcp_slim/fastmcp/server/mixins/mcp_operations.py:27
↓ 4 callers
Function
_audio_content_to_openai_part
Convert MCP AudioContent to OpenAI input_audio content part.
fastmcp_slim/fastmcp/client/sampling/handlers/openai.py:79
↓ 4 callers
Method
_build_discovery_tools
(self)
fastmcp_slim/fastmcp/experimental/transforms/code_mode.py:533
↓ 4 callers
Method
_call_tool_mcp
Handle MCP 'callTool' requests. Extracts task metadata from MCP request context and passes it explicitly to call_tool(). The
fastmcp_slim/fastmcp/server/mixins/mcp_operations.py:188
↓ 4 callers
Function
_convert_set_default_none
Convert a sequence to a set, defaulting to an empty set if None.
fastmcp_slim/fastmcp/utilities/components.py:43
↓ 4 callers
Method
_cookie_name
Return secure cookie name for HTTPS, fallback for HTTP development.
fastmcp_slim/fastmcp/server/auth/oauth_proxy/consent.py:74
↓ 4 callers
Method
_create_default_client
Create a default httpx client from the OpenAPI spec's server URL.
fastmcp_slim/fastmcp/server/providers/openapi/provider.py:169
↓ 4 callers
Method
_ensure_discovered
Ensure skills are discovered, rediscovering if reload is enabled.
fastmcp_slim/fastmcp/server/providers/skills/directory_provider.py:122
↓ 4 callers
Function
_extract_csrf
Extract CSRF token from HTML form.
tests/server/auth/test_oauth_consent_page.py:97
↓ 4 callers
Function
_extract_result
Extract the list of names from a call_tool ToolResult.
tests/server/transforms/test_catalog.py:253
↓ 4 callers
Method
_extract_schema_as_dict
Resolves a schema and returns it as a dictionary.
fastmcp_slim/fastmcp/utilities/openapi/parser.py:208
↓ 4 callers
Function
_find_request
(request_id: str)
examples/apps/approvals/approvals_server.py:133
↓ 4 callers
Function
_get_cache_path
Get the path to the version cache file.
fastmcp_slim/fastmcp/utilities/version_check.py:21
↓ 4 callers
Method
_get_client
Gets a client instance by calling the sync or async factory.
fastmcp_slim/fastmcp/server/providers/proxy.py:618
↓ 4 callers
Method
_get_client_identifier
Get client identifier for rate limiting.
fastmcp_slim/fastmcp/server/middleware/rate_limiting.py:150
↓ 4 callers
Method
_get_highest_version_result
Get the highest version from successful non-None results. Used for versioned components where we want the highest version across all
fastmcp_slim/fastmcp/server/providers/aggregate.py:156
↓ 4 callers
Method
_get_jwks_key
Fetch key from JWKS with simple caching and SSRF protection.
fastmcp_slim/fastmcp/server/auth/providers/jwt.py:331
↓ 4 callers
Method
_get_refresh_lock
Get or create a per-token refresh lock, evicting LRU entries when at capacity.
fastmcp_slim/fastmcp/server/auth/oauth_proxy/proxy.py:733
↓ 4 callers
Method
_get_tool
( self, name: str, version: VersionSpec | None = None )
fastmcp_slim/fastmcp/server/providers/proxy.py:646
↓ 4 callers
Function
_get_tool_hash
Read the stored hash from tool meta, or compute from app name + tool name.
fastmcp_slim/fastmcp/server/providers/prefab_synthesis.py:46
↓ 4 callers
Function
_hash_cache_key
Build a fixed-length SHA-256 cache key from request-derived input.
fastmcp_slim/fastmcp/server/middleware/caching.py:551
↓ 4 callers
Method
_make_provider
(self, resource: str | None = None)
tests/server/auth/providers/test_propelauth.py:189
↓ 4 callers
Method
_make_template
(self)
tests/resources/test_resource_template_query_params.py:269
↓ 4 callers
Method
_make_verify_factory
(self)
fastmcp_slim/fastmcp/client/transports/sse.py:91
↓ 4 callers
Function
_make_versioned_tool
Create a tool with a specific version for testing.
tests/server/transforms/test_catalog.py:23
↓ 4 callers
Function
_mock_github_success
Configure *mock_client* to return a successful GitHub user + scopes response.
tests/server/auth/providers/test_github.py:159
↓ 4 callers
Function
_normalize_host
(host: str)
fastmcp_slim/fastmcp/server/http.py:114
↓ 4 callers
Function
_read_cache
Read cached version info. Returns: Tuple of (cached_version, cache_timestamp) or (None, 0) if no cache.
fastmcp_slim/fastmcp/utilities/version_check.py:29
↓ 4 callers
Function
_redact_headers
(headers: httpx.Headers)
fastmcp_slim/fastmcp/server/providers/openapi/components.py:48
↓ 4 callers
Function
_remember_snapshot
Bind a snapshot to the current asyncio context under ``task_id``. Nothing outside this task's context sees it; stale entries left in a reused
fastmcp_slim/fastmcp/server/tasks/context.py:197
↓ 4 callers
Method
_remove_component
Remove a component from unified storage. Args: key: The prefixed key of the component. Raises: KeyError: If
fastmcp_slim/fastmcp/server/providers/local_provider/local_provider.py:203
↓ 4 callers
Function
_resolve_allowed_hosts_for_run
( *, host: str, host_origin_protection: HostOriginProtection, allowed_hosts: list[str] | None,
fastmcp_slim/fastmcp/server/mixins/transport.py:53
↓ 4 callers
Function
_response_to_create_message_result
Convert Google GenAI response to CreateMessageResult (no tools).
fastmcp_slim/fastmcp/client/sampling/handlers/google_genai.py:318
↓ 4 callers
Method
_revoke_internal
Internal helper to remove tokens and their associations.
fastmcp_slim/fastmcp/server/auth/providers/in_memory.py:315
↓ 4 callers
Function
_scan_goose
Scan Goose config for MCP server extensions. Goose uses YAML (``~/.config/goose/config.yaml``) with a different schema — MCP servers are defi
fastmcp_slim/fastmcp/cli/discovery.py:251
↓ 4 callers
Function
_schema_type
(schema: Any)
fastmcp_slim/fastmcp/server/transforms/search/base.py:90
↓ 4 callers
Method
_should_retry
Determine if an error should trigger a retry. Checks both the error itself and its ``__cause__``, since FastMCP wraps tool exceptions
fastmcp_slim/fastmcp/server/middleware/error_handling.py:183
↓ 4 callers
Function
_suppress_user_scanners
Suppress all scanners that read real user config files.
tests/cli/test_discovery.py:505
↓ 4 callers
Method
_upstream_oauth_client
(self)
fastmcp_slim/fastmcp/server/auth/oauth_proxy/proxy.py:726
↓ 4 callers
Method
aclose
(self)
tests/client/auth/test_oauth_client.py:314
↓ 4 callers
Method
add_prompts
(self, fastmcp: FastMCP, prefix: str = "")
tests/server/middleware/test_caching.py:172
↓ 4 callers
Method
add_template
Add a resource template to the server. Args: template: A ResourceTemplate instance to add Returns: The templ
fastmcp_slim/fastmcp/server/server.py:1851
↓ 4 callers
Method
call_tool
Call a tool by name with the given arguments. Use this to execute tools discovered via search_tools.
fastmcp_slim/fastmcp/server/transforms/search/base.py:227
↓ 4 callers
Method
call_tool_bulk
Call a single tool registered on this MCP server multiple times with a single request. Each call can include different arguments. Us
fastmcp_slim/fastmcp/contrib/bulk_tool_caller/bulk_tool_caller.py:93
↓ 4 callers
Method
clear
Clear all cached clients and force disconnect them.
fastmcp_slim/fastmcp/server/providers/proxy.py:1204
↓ 4 callers
Function
compare_versions
Compare two version strings. Args: a: First version string (or None). b: Second version string (or None). Returns: -
fastmcp_slim/fastmcp/utilities/versions.py:237
↓ 4 callers
Method
connect_session
( self, **session_kwargs: Unpack[SessionKwargs] )
fastmcp_slim/fastmcp/client/transports/config.py:92
↓ 4 callers
Function
create_error_html
Create a styled HTML error page for OAuth errors. Args: error_title: The error title (e.g., "OAuth Error", "Authorization Failed")
fastmcp_slim/fastmcp/server/auth/oauth_proxy/ui.py:215
← previous
next →
401–500 of 10,524, ranked by callers