Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PrefectHQ/fastmcp
/ functions
Functions
10,312 in github.com/PrefectHQ/fastmcp
⨍
Functions
10,312
◇
Types & classes
1,519
↳
Endpoints
103
↓ 12 callers
Method
verify_token
Verify GitHub OAuth token by calling GitHub API.
fastmcp_slim/fastmcp/server/auth/providers/github.py:82
↓ 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
_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:245
↓ 11 callers
Method
_convert_to_anthropic_messages
( messages: Sequence[SamplingMessage], )
fastmcp_slim/fastmcp/client/sampling/handlers/anthropic.py:173
↓ 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
Method
call_tool_mcp
Send a tools/call request and return the complete MCP protocol result. This method returns the raw CallToolResult object, which includes an i
fastmcp_slim/fastmcp/client/mixins/tools.py:118
↓ 11 callers
Method
info
()
tests/server/versioning/test_mounting.py:55
↓ 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:483
↓ 11 callers
Method
is_allowed
Check if a request is allowed.
fastmcp_slim/fastmcp/server/middleware/rate_limiting.py:76
↓ 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:119
↓ 11 callers
Function
make_handler_wrapper
( handler: Callable[..., Awaitable[Any]], call_next: CallNext[Any, Any], )
fastmcp_slim/fastmcp/server/middleware/middleware.py:78
↓ 11 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
↓ 11 callers
Function
parse_args
(argv: Sequence[str] | None = None)
fastmcp_remote/fastmcp_remote/cli.py:163
↓ 11 callers
Method
read
Read the resource by calling the wrapped function.
fastmcp_slim/fastmcp/resources/function_resource.py:221
↓ 11 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:251
↓ 11 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
↓ 11 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
↓ 10 callers
Method
_convert_to_openai_messages
( system_prompt: str | None, messages: Sequence[SamplingMessage] )
fastmcp_slim/fastmcp/client/sampling/handlers/openai.py:182
↓ 10 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:343
↓ 10 callers
Function
_make_versioned_tool
Create a tool with a specific version for testing.
tests/server/transforms/test_catalog.py:23
↓ 10 callers
Function
_merge_defaults
Merge defaults with provided data at all levels.
fastmcp_slim/fastmcp/utilities/json_schema_type.py:732
↓ 10 callers
Function
_to_python_identifier
Sanitize a string into a valid Python identifier.
fastmcp_slim/fastmcp/cli/generate.py:155
↓ 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
Function
check
(ctx: AuthContext)
fastmcp_slim/fastmcp/utilities/authorization.py:54
↓ 10 callers
Function
client_span
Create a CLIENT span with standard MCP attributes. Automatically records any exception on the span and sets error status.
fastmcp_slim/fastmcp/client/telemetry.py:13
↓ 10 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
↓ 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
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
↓ 10 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
↓ 10 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:319
↓ 10 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:236
↓ 10 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:40
↓ 10 callers
Method
load_server
Load server from filesystem.
fastmcp_slim/fastmcp/utilities/mcp_server_config/v1/sources/filesystem.py:64
↓ 10 callers
Function
prepare_tools
Convert tools to SamplingTool objects. Accepts SamplingTool instances, FunctionTool instances, TransformedTool instances, or plain callable f
fastmcp_slim/fastmcp/server/sampling/run.py:400
↓ 10 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:189
↓ 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
Method
set_message
Update the progress status message.
fastmcp_slim/fastmcp/server/dependencies.py:1268
↓ 10 callers
Method
set_total
Set the total/target value for progress tracking.
fastmcp_slim/fastmcp/server/dependencies.py:1258
↓ 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:196
↓ 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:505
↓ 10 callers
Function
validate_proxy
Validate OIDC proxy.
tests/server/auth/test_oidc_proxy.py:429
↓ 10 callers
Method
version
(self)
fastmcp_slim/fastmcp/server/server.py:453
↓ 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
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
_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:730
↓ 9 callers
Function
_hash_schema
Generate a deterministic hash for schema caching. Handles non-JSON-native types (datetime, date, bool keys) that can appear in schemas loaded
fastmcp_slim/fastmcp/utilities/json_schema_type.py:242
↓ 9 callers
Function
_make_file
( name: str = "test.txt", content: str = "hello world", mime_type: str = "text/plain", )
tests/apps/test_file_upload.py:37
↓ 9 callers
Method
_make_proxy
(self, jwt_verifier, **kwargs)
tests/server/auth/oauth_proxy/test_tokens.py:715
↓ 9 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
↓ 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
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
↓ 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
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
↓ 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_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
↓ 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
Function
infer_transport
(transport: ClientTransportT)
fastmcp_slim/fastmcp/client/transports/inference.py:28
↓ 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
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
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
↓ 9 callers
Method
on_message
Start ping task on first message from a session.
fastmcp_slim/fastmcp/server/middleware/ping.py:42
↓ 9 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:135
↓ 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:227
↓ 9 callers
Method
unwrap
(self)
fastmcp_slim/fastmcp/server/middleware/caching.py:96
↓ 9 callers
Function
validate_config
Validate an OIDC configuration against the source dict.
tests/server/auth/test_oidc_proxy.py:247
↓ 9 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
↓ 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:462
↓ 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:151
↓ 8 callers
Function
_is_object_schema
Check if a JSON schema represents an object type.
fastmcp_slim/fastmcp/tools/function_parsing.py:73
↓ 8 callers
Method
_log_error
Log error with appropriate detail level.
fastmcp_slim/fastmcp/server/middleware/error_handling.py:58
↓ 8 callers
Method
_read
(self, task_meta: None = None)
fastmcp_slim/fastmcp/resources/base.py:366
↓ 8 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
↓ 8 callers
Method
_run_middleware
Builds and executes the middleware chain.
fastmcp_slim/fastmcp/server/server.py:479
↓ 8 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
↓ 8 callers
Function
_schema_to_type
Convert schema to appropriate Python type.
fastmcp_slim/fastmcp/utilities/json_schema_type.py:440
↓ 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
_start_flow
Register client and start auth; returns (txn_id, consent_url).
tests/server/auth/test_oauth_consent_page.py:67
↓ 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
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
↓ 8 callers
Method
create_proxy
Create an OAuth proxy with specified storage.
tests/server/auth/test_oauth_proxy_storage.py:45
↓ 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
Method
disable_components
Disable components matching criteria for this session only. Session rules override global transforms. Rules accumulate - each call ad
fastmcp_slim/fastmcp/server/context.py:1364
↓ 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:34
↓ 8 callers
Function
format_ip_for_url
Format IP address for use in URL (bracket IPv6 addresses). IPv6 addresses must be bracketed in URLs to distinguish the address from the port
fastmcp_slim/fastmcp/server/auth/ssrf.py:26
↓ 8 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
↓ 8 callers
Function
get_client
Get or create an authenticated ATProto client.
examples/atproto_mcp/src/atproto_mcp/_atproto/_client.py:10
↓ 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:842
↓ 8 callers
Function
get_server
Get the current FastMCP server instance directly. In a background-task worker, checks the task-server map first so that mounted-child tasks r
fastmcp_slim/fastmcp/server/dependencies.py:331
↓ 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_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
← previous
next →
201–300 of 10,312, ranked by callers