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
↓ 19 callers
Method
_mark_component
Set visibility state in component metadata if rule matches. Returns a copy of the component with updated metadata to avoid mutating s
fastmcp_slim/fastmcp/server/transforms/visibility.py:173
↓ 19 callers
Method
fetch
Fetch and validate a CIMD document with SSRF protection. Uses ssrf_safe_fetch_response for the HTTP layer, which provides: - HTTPS on
fastmcp_slim/fastmcp/server/auth/cimd.py:299
↓ 19 callers
Method
set_mcp_path
Set the MCP endpoint path and create JWTIssuer with correct audience. This method is called by get_routes() to configure the resource URL
fastmcp_slim/fastmcp/server/auth/oauth_proxy/proxy.py:665
↓ 19 callers
Method
to_mcp_tool
Convert the FastMCP tool to an MCP tool.
fastmcp_slim/fastmcp/tools/base.py:222
↓ 18 callers
Function
find_available_port
Find an available port by letting the OS assign one.
fastmcp_slim/fastmcp/utilities/http.py:4
↓ 18 callers
Method
from_dict
Parse MCP configuration from dictionary format.
fastmcp_slim/fastmcp/mcp_config.py:324
↓ 18 callers
Function
is_coroutine_function
Check if a callable is a coroutine function, unwrapping functools.partial. ``inspect.iscoroutinefunction`` returns ``False`` for ``functools.
fastmcp_slim/fastmcp/utilities/async_utils.py:14
↓ 18 callers
Method
issue_access_token
Issue a minimal FastMCP access token. FastMCP tokens are reference tokens containing only the minimal claims needed for validation an
fastmcp_slim/fastmcp/server/auth/jwt_issuer.py:105
↓ 18 callers
Method
run
(self, arguments: dict[str, Any])
tests/server/providers/test_base_provider.py:20
↓ 18 callers
Method
set_state
Set a value in the state store. By default, values are stored in the session-scoped state store and persist across requests within th
fastmcp_slim/fastmcp/server/context.py:1249
↓ 17 callers
Function
coerce_value
Coerce a string CLI value according to a JSON-Schema type hint.
fastmcp_slim/fastmcp/cli/client.py:264
↓ 17 callers
Function
dereference_refs
Resolve all $ref references in a JSON schema by inlining definitions. This function resolves $ref references that point to $defs, replacing them
fastmcp_slim/fastmcp/utilities/json_schema.py:147
↓ 17 callers
Method
supports_tasks
Check if this component supports task execution.
fastmcp_slim/fastmcp/utilities/tasks.py:53
↓ 16 callers
Method
_list_tools
(self)
fastmcp_slim/fastmcp/apps/app.py:393
↓ 16 callers
Method
_must_run_with_uv
Check if this environment config requires uv to set up. Returns: True if any environment settings require uv run
fastmcp_slim/fastmcp/utilities/mcp_server_config/v1/environments/uv.py:93
↓ 16 callers
Method
add_tool
Add a tool to this app programmatically. The tool is tagged with this app's name for routing.
fastmcp_slim/fastmcp/apps/app.py:362
↓ 16 callers
Method
assert_called
Assert that a hook was called a specific number of times.
tests/server/middleware/test_middleware.py:73
↓ 16 callers
Method
assert_not_called
Assert that a hook was not called.
tests/server/middleware/test_middleware.py:103
↓ 16 callers
Method
from_callable_tool
Create a SamplingTool from a FunctionTool or TransformedTool. Reuses existing server tools in sampling contexts. For TransformedTool,
fastmcp_slim/fastmcp/server/sampling/sampling_tool.py:126
↓ 16 callers
Method
from_function
Create a SamplingTool from a function. The function's signature is analyzed to generate a JSON schema for the tool's parameters. Type
fastmcp_slim/fastmcp/server/sampling/sampling_tool.py:84
↓ 16 callers
Function
gather
( *awaitables: Awaitable[T], return_exceptions: Literal[True], )
fastmcp_slim/fastmcp/utilities/async_utils.py:38
↓ 16 callers
Function
get_context
Get the current FastMCP Context instance directly.
fastmcp_slim/fastmcp/server/dependencies.py:321
↓ 16 callers
Method
get_state
Get a value from the state store. Checks request-scoped state first (set with ``serializable=False``), then falls back to the session
fastmcp_slim/fastmcp/server/context.py:1291
↓ 16 callers
Function
is_class_member_of_type
Check if cls is a member of base, even if cls is a type variable. Base can be a type, a UnionType, or an Annotated type. Generic types are n
fastmcp_slim/fastmcp/utilities/types.py:133
↓ 16 callers
Method
make_key
Construct the lookup key for this component type. Args: identifier: The raw identifier (name for tools/prompts, uri for resources
fastmcp_slim/fastmcp/utilities/components.py:125
↓ 16 callers
Method
raise_for_status
()
tests/server/providers/openapi/test_comprehensive.py:649
↓ 15 callers
Method
_list_tools_mcp
List all available tools, in the format expected by the low-level MCP server. Supports pagination when list_page_size is configured.
fastmcp_slim/fastmcp/server/mixins/mcp_operations.py:98
↓ 15 callers
Function
_tool_function_source
Generate the source for a single ``@call_tool_app.command`` function.
fastmcp_slim/fastmcp/cli/generate.py:166
↓ 15 callers
Method
clear
(ctx: Context)
tests/server/test_session_visibility.py:458
↓ 15 callers
Function
get_elicitation_schema
Get the schema for an elicitation response. Args: response_type: The type of the response
fastmcp_slim/fastmcp/server/elicitation.py:368
↓ 15 callers
Method
reset
Clear all recorded notifications.
tests/client/test_notifications.py:61
↓ 15 callers
Function
task_redis_prefix
Return the Redis key prefix that owns a given scope. Authenticated tasks live under ``fastmcp:task:auth:{enc_scope}``; anonymous tasks live u
fastmcp_slim/fastmcp/server/tasks/keys.py:156
↓ 15 callers
Method
validate_redirect_uri
Validate that a redirect_uri is allowed by the CIMD document. Uses component-level matching (scheme, host, port, path) which correctly
fastmcp_slim/fastmcp/server/auth/cimd.py:434
↓ 15 callers
Method
validate_redirect_uri
Validate redirect URI against proxy patterns and optionally CIMD redirect_uris. For CIMD clients: validates against BOTH the CIMD document's
fastmcp_slim/fastmcp/server/auth/oauth_proxy/models.py:221
↓ 14 callers
Function
expand_uri_template
Expand a URI template with parameters — inverse of `match_uri_template`. Supports the same RFC 6570 subset: - Path params: `{var}`, `{var*}`
fastmcp_slim/fastmcp/resources/template.py:119
↓ 14 callers
Method
from_b2c
Create an AzureProvider pre-configured for Azure AD B2C. Derives authority host, tenant path, and identifier URI from `tenant_name` a
fastmcp_slim/fastmcp/server/auth/providers/azure.py:296
↓ 14 callers
Function
parse_args
(argv: Sequence[str] | None = None)
fastmcp_remote/fastmcp_remote/cli.py:185
↓ 14 callers
Method
to_json
Serialize to JSON for Redis storage.
fastmcp_slim/fastmcp/server/tasks/context.py:166
↓ 14 callers
Method
verify_token
Verify token using custom validation logic. Args: token: The token string to validate Returns: AccessToken i
fastmcp_slim/fastmcp/server/auth/providers/debug.py:77
↓ 13 callers
Function
CurrentDocket
Get the current Docket instance managed by FastMCP. This dependency provides access to the Docket instance that FastMCP automatically creates
fastmcp_slim/fastmcp/server/dependencies.py:903
↓ 13 callers
Function
_extract_mime_type_from_route
Extract the primary MIME type from an HTTPRoute's response definitions. Looks for the first successful response (2xx) and returns its content typ
fastmcp_slim/fastmcp/server/providers/openapi/components.py:65
↓ 13 callers
Function
_get_auth_context
Get auth context for the current request. Returns a tuple of (skip_auth, token) where: - skip_auth=True means auth checks should be skipped (
fastmcp_slim/fastmcp/server/server.py:192
↓ 13 callers
Method
_hash_token
Return the SHA-256 hex digest of *token*.
fastmcp_slim/fastmcp/utilities/token_cache.py:146
↓ 13 callers
Function
_unwrap_string_result
Extract a string result from a ToolResult. String results are wrapped in ``{"result": "..."}`` by the structured-output convention.
tests/experimental/transforms/test_code_mode.py:75
↓ 13 callers
Method
add_prompt
Add a prompt to the server. Args: prompt: A Prompt instance or @prompt-decorated function to add Returns: Th
fastmcp_slim/fastmcp/server/server.py:1981
↓ 13 callers
Function
create_openapi_server
Helper to create a FastMCP server with OpenAPIProvider.
tests/server/providers/openapi/test_comprehensive.py:15
↓ 13 callers
Function
generate_skill_content
Generate a SKILL.md file for a generated CLI script.
fastmcp_slim/fastmcp/cli/generate.py:619
↓ 13 callers
Method
load_access_token
Validate a JWT bearer token and return an AccessToken when the token is valid. Parameters: token (str): The JWT bearer t
fastmcp_slim/fastmcp/server/auth/providers/jwt.py:434
↓ 13 callers
Function
parse_task_key
Parse Docket task key to extract metadata. Args: task_key: Encoded task key from Docket Returns: Dict with keys: ``task_scop
fastmcp_slim/fastmcp/server/tasks/keys.py:80
↓ 13 callers
Method
run_async
Run the FastMCP server asynchronously. Args: transport: Transport protocol to use ("stdio", "http", "sse", or "streamable-http")
fastmcp_slim/fastmcp/server/mixins/transport.py:75
↓ 12 callers
Function
_convert_to_content
Convert a result to a sequence of content objects.
fastmcp_slim/fastmcp/tools/base.py:600
↓ 12 callers
Function
_is_http_target
Return True if the resolved target will use an HTTP-based transport. MCPConfig dicts are excluded because ``MCPConfigTransport`` manages indi
fastmcp_slim/fastmcp/cli/client.py:158
↓ 12 callers
Function
_make_token
( *, token: str = "tok", client_id: str = "client-1", scopes: list[str] | None = None, exp
tests/utilities/test_token_cache.py:11
↓ 12 callers
Method
_matches
Check if this transform applies to the component. All specified criteria must match (intersection semantics). An empty rule (no crite
fastmcp_slim/fastmcp/server/transforms/visibility.py:111
↓ 12 callers
Method
_prepare_scopes_for_upstream_refresh
Prepare scopes for Azure token refresh. Azure requires fully-qualified scopes and only allows ONE resource per token request (AADSTS2
fastmcp_slim/fastmcp/server/auth/providers/azure.py:517
↓ 12 callers
Function
_replace_ref_with_defs
Replace openapi $ref with jsonschema $defs recursively. Examples: - {"type": "object", "properties": {"$ref": "#/components/schemas/..."
fastmcp_slim/fastmcp/utilities/openapi/schemas.py:76
↓ 12 callers
Method
apply
Create a TransformedTool from a provided tool and this transformation configuration.
fastmcp_slim/fastmcp/tools/tool_transform.py:998
↓ 12 callers
Method
assert_called
Assert that a hook was called a specific number of times.
tests/server/middleware/test_middleware_nested.py:74
↓ 12 callers
Function
create_command
Generate a CIMD document for hosting. Create a Client ID Metadata Document that you can host at an HTTPS URL. The URL where you host this doc
fastmcp_slim/fastmcp/cli/cimd.py:32
↓ 12 callers
Function
extract_components
Extract all MCP components from a module. Scans all module attributes for instances of Tool, Resource, ResourceTemplate, or Prompt objects cr
fastmcp_slim/fastmcp/server/providers/filesystem_discovery.py:285
↓ 12 callers
Function
generate_cli_command
Generate a standalone CLI script from an MCP server. Connects to the server, reads its tools/resources/prompts, and writes a Python script th
fastmcp_slim/fastmcp/cli/generate.py:670
↓ 12 callers
Function
get_log_lines
Get log lines from a caplog fixture.
tests/server/middleware/test_logging.py:29
↓ 12 callers
Method
get_well_known_routes
Delegate well-known route creation to the server. This ensures that server-specific well-known route logic (e.g., OAuthProvider's RFC
fastmcp_slim/fastmcp/server/auth/auth.py:626
↓ 12 callers
Method
is_connected
Check if the client is currently connected.
fastmcp_slim/fastmcp/client/client.py:418
↓ 12 callers
Method
key
The globally unique lookup key for this resource.
fastmcp_slim/fastmcp/resources/base.py:428
↓ 12 callers
Function
parse_tool_arguments
Build a tool-call argument dict from CLI inputs. A single JSON object argument is treated as the full argument dict. ``--input-json`` provide
fastmcp_slim/fastmcp/cli/client.py:298
↓ 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
_convert_to_anthropic_messages
( messages: Sequence[SamplingMessage], )
fastmcp_slim/fastmcp/client/sampling/handlers/anthropic.py:173
↓ 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
Function
build_task_key
Build Docket task key with embedded metadata. When ``task_scope`` is ``None`` the task is anonymous and lives in the ``anon`` keyspace. Othe
fastmcp_slim/fastmcp/server/tasks/keys.py:41
↓ 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
close
(self)
fastmcp_slim/fastmcp/client/client.py:798
↓ 11 callers
Method
enable_components
Enable components matching criteria for this session only. Session rules override global transforms. Rules accumulate - each call add
fastmcp_slim/fastmcp/server/context.py:1326
↓ 11 callers
Method
get_tool
( self, name: str, call_next: GetToolNext, *, version: VersionSpec | None = None )
tests/server/transforms/test_catalog.py:46
↓ 11 callers
Function
hash_tool
Deterministic hex hash for a tool in an app. Same inputs on every replica produce the same output.
fastmcp_slim/fastmcp/server/providers/addressing.py:29
↓ 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
Method
read
Read the resource by calling the wrapped function.
fastmcp_slim/fastmcp/resources/function_resource.py:221
↓ 11 callers
Function
validate_redirect_uri
Validate a redirect URI against allowed patterns. Args: redirect_uri: The redirect URI to validate allowed_patterns: List of allo
fastmcp_slim/fastmcp/server/auth/redirect_validation.py:232
↓ 11 callers
Function
with_argv
Temporarily replace sys.argv if args provided. This context manager is used at the CLI boundary to inject server arguments when needed, witho
fastmcp_slim/fastmcp/cli/cli.py:76
↓ 10 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
↓ 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
_parse_mcp_config
Parse an mcpServers-style JSON file into discovered servers.
fastmcp_slim/fastmcp/cli/discovery.py:120
↓ 10 callers
Function
_start_flow
Register client and start auth; returns (txn_id, consent_url).
tests/server/auth/test_oauth_consent_flow.py:114
↓ 10 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:1838
↓ 10 callers
Function
app_config_to_meta_dict
Convert an AppConfig or dict to the wire-format dict for ``meta["ui"]``.
fastmcp_slim/fastmcp/apps/config.py:180
↓ 10 callers
Function
build_transport
(config: RemoteConfig)
fastmcp_remote/fastmcp_remote/cli.py:251
↓ 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
Method
convert_result
Convert a raw result to ToolResult. Handles ToolResult passthrough and converts raw values using the tool's attributes (serializer, o
fastmcp_slim/fastmcp/tools/base.py:312
↓ 10 callers
Function
create_callback_html
Create a styled HTML response for OAuth callbacks.
fastmcp_slim/fastmcp/client/oauth_callback.py:34
↓ 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
Method
execute
Execute tool calls using Python code.
fastmcp_slim/fastmcp/experimental/transforms/code_mode.py:593
↓ 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
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
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
← previous
next →
101–200 of 10,524, ranked by callers