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
↓ 8 callers
Method
get_span_attributes
(self)
fastmcp_slim/fastmcp/server/providers/proxy.py:228
↓ 8 callers
Function
get_task_context
Get the current task context if running inside a background task worker. This function extracts task information from the Docket execution contex
fastmcp_slim/fastmcp/server/tasks/context.py:82
↓ 8 callers
Method
get_task_status
Query the status of a background task. Sends a 'tasks/get' MCP protocol request over the existing transport. Args: task_
fastmcp_slim/fastmcp/client/mixins/task_management.py:33
↓ 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:276
↓ 8 callers
Method
on_message
(self, message: Message)
fastmcp_slim/fastmcp/client/messages.py:76
↓ 8 callers
Function
parse_version_key
Parse a version string into a sortable key. Args: version: The version string, or None for unversioned. Returns: A VersionKe
fastmcp_slim/fastmcp/utilities/versions.py:197
↓ 8 callers
Method
read
Read the file content.
fastmcp_slim/fastmcp/resources/types.py:99
↓ 8 callers
Method
read_resource
Read a resource by its URI. For static resources, provide the exact URI. For templated resources, provide the URI with templa
fastmcp_slim/fastmcp/server/transforms/resources_as_tools.py:138
↓ 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:203
↓ 8 callers
Method
search
Search for available tools by query. Returns matching tools ranked by relevance.
fastmcp_slim/fastmcp/experimental/transforms/code_mode.py:276
↓ 8 callers
Method
search
(query: str)
tests/server/sampling/test_prepare_tools.py:22
↓ 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:138
↓ 8 callers
Method
to_mcp_resource_contents
Convert to MCP resource contents type. Args: uri: The URI of the resource (required by MCP types) Returns: T
fastmcp_slim/fastmcp/resources/base.py:94
↓ 8 callers
Function
transform_context_annotations
Transform ctx: Context into ctx: Context = CurrentContext(). Transforms ALL params typed as Context to use Docket's DI system, unless they al
fastmcp_slim/fastmcp/server/dependencies.py:180
↓ 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:387
↓ 7 callers
Function
CurrentFastMCP
Get the current FastMCP server instance. This dependency provides access to the active FastMCP server. Returns: A dependency that re
fastmcp_slim/fastmcp/server/dependencies.py:1000
↓ 7 callers
Method
__init__
(self, client_factory: ClientFactoryT, **kwargs: Any)
fastmcp_slim/fastmcp/server/providers/proxy.py:128
↓ 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
Function
_by_status
(status: str)
examples/apps/approvals/approvals_server.py:129
↓ 7 callers
Method
_create_before_message
( self, context: MiddlewareContext[Any] )
fastmcp_slim/fastmcp/server/middleware/logging.py:56
↓ 7 callers
Method
_exchange
(self, proxy, code="test-code", **idp_token_overrides)
tests/server/auth/oauth_proxy/test_tokens.py:738
↓ 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:449
↓ 7 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:128
↓ 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
_parse_env_var
Parse environment variable string in format KEY=VALUE.
fastmcp_slim/fastmcp/cli/cli.py:63
↓ 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:304
↓ 7 callers
Function
_query_scalar_to_str
Convert a scalar to its query-string representation. Booleans are lowercased to match JSON/OpenAPI conventions (true/false) rather than Pytho
fastmcp_slim/fastmcp/utilities/openapi/director.py:18
↓ 7 callers
Method
_resolve_ref
Resolves a reference to its target definition.
fastmcp_slim/fastmcp/utilities/openapi/parser.py:153
↓ 7 callers
Function
_scan_claude_code
Scan ``~/.claude.json`` for global and project-scoped MCP servers.
fastmcp_slim/fastmcp/cli/discovery.py:157
↓ 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
_set_token
(token)
tests/server/middleware/test_caching.py:732
↓ 7 callers
Method
_time_operation
Helper method to time any operation.
fastmcp_slim/fastmcp/server/middleware/timing.py:91
↓ 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:881
↓ 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
Method
create_server
(self, include_tags=None, exclude_tags=None)
tests/server/providers/test_local_provider_resources.py:678
↓ 7 callers
Method
create_server
(self, include_tags=None, exclude_tags=None)
tests/server/providers/test_local_provider_resources.py:830
↓ 7 callers
Method
create_server
(self, include_tags=None, exclude_tags=None)
tests/server/providers/test_local_provider_prompts.py:420
↓ 7 callers
Method
create_server
(self, include_tags=None, exclude_tags=None)
tests/server/providers/local_provider_tools/test_tags.py:42
↓ 7 callers
Method
exchange_authorization_code
( self, client: OAuthClientInformationFull, authorization_code: AuthorizationCode )
tests/server/test_auth_integration.py:74
↓ 7 callers
Function
format_info
Format server information according to the specified format. Args: mcp: The FastMCP instance format: Output format ("fastmcp" or
fastmcp_slim/fastmcp/utilities/inspect.py:465
↓ 7 callers
Method
from_file
Load configuration from JSON file.
fastmcp_slim/fastmcp/mcp_config.py:338
↓ 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:726
↓ 7 callers
Function
get_fastmcp_meta
Extract FastMCP metadata from a function, handling bound methods and wrappers.
fastmcp_slim/fastmcp/decorators.py:29
↓ 7 callers
Method
get_prompt
Get prompt by transformed name with all transforms applied. Note: This method does NOT filter disabled components. The Server (FastMC
fastmcp_slim/fastmcp/server/providers/base.py:329
↓ 7 callers
Function
get_property
(tool: Tool, name: str)
tests/tools/tool_transform/test_args.py:21
↓ 7 callers
Method
get_resource_template
Get a resource template by URI, filtering disabled templates. Overrides Provider.get_resource_template() to add visibility filtering after
fastmcp_slim/fastmcp/server/server.py:974
↓ 7 callers
Function
get_tracer
Get the FastMCP tracer for creating spans. Args: version: Optional version string for the instrumentation Returns: A tracer
fastmcp_slim/fastmcp/telemetry.py:38
↓ 7 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:50
↓ 7 callers
Function
install_goose
Install FastMCP server in Goose via deeplink. Args: file: Path to the server file. server_object: Optional server object name (fo
fastmcp_slim/fastmcp/cli/install/goose.py:85
↓ 7 callers
Function
list_skills
List all available skills from an MCP server. Discovers skills by finding resources with URIs matching the `skill://{name}/SKILL.md` pattern.
fastmcp_slim/fastmcp/utilities/skills.py:43
↓ 7 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
↓ 7 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:53
↓ 7 callers
Method
reset
Clear all recorded calls.
tests/server/middleware/test_middleware.py:109
↓ 7 callers
Function
reset_transport
Reset transport to previous value.
fastmcp_slim/fastmcp/server/context.py:98
↓ 7 callers
Function
server_span
Create a SERVER span with standard MCP attributes and auth context. Automatically records any exception on the span and sets error status.
fastmcp_slim/fastmcp/server/telemetry.py:57
↓ 7 callers
Method
set_mcp_path
Propagate MCP path to the server and all verifiers.
fastmcp_slim/fastmcp/server/auth/auth.py:612
↓ 7 callers
Function
set_transport
Set the current transport type. Returns token for reset.
fastmcp_slim/fastmcp/server/context.py:91
↓ 6 callers
Method
__init__
Initialize a Stdio transport. Args: command: The command to run (e.g., "python", "node", "uvx") args: The ar
fastmcp_slim/fastmcp/client/transports/stdio.py:29
↓ 6 callers
Method
__init__
( self, reload: bool = False, supporting_files: Literal["template", "resources"] = "te
fastmcp_slim/fastmcp/server/providers/skills/vendor_providers.py:54
↓ 6 callers
Function
_b64_decoded_size
Return the exact decoded byte-length of a base64 string without decoding it.
fastmcp_slim/fastmcp/apps/file_upload.py:74
↓ 6 callers
Method
_calculate_delay
Calculate delay for the given attempt number.
fastmcp_slim/fastmcp/server/middleware/error_handling.py:197
↓ 6 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
↓ 6 callers
Method
_check_client_connected
Validate that client context is still active. Raises: RuntimeError: If accessed outside client context (unless immediate)
fastmcp_slim/fastmcp/client/tasks.py:88
↓ 6 callers
Method
_decode_list_cookie
Decode and verify a signed base64-encoded JSON list from cookie. Returns [] if missing/invalid.
fastmcp_slim/fastmcp/server/auth/oauth_proxy/consent.py:113
↓ 6 callers
Function
_derive_server_name
Derive a human-friendly name from a server spec.
fastmcp_slim/fastmcp/cli/generate.py:790
↓ 6 callers
Method
_extract_schema_as_dict
Resolves a schema and returns it as a dictionary.
fastmcp_slim/fastmcp/utilities/openapi/parser.py:208
↓ 6 callers
Function
_fetch_latest_version
Fetch the latest version from PyPI. Args: include_prereleases: If True, include pre-release versions (alpha, beta, rc). Returns:
fastmcp_slim/fastmcp/utilities/version_check.py:59
↓ 6 callers
Function
_final_response
Build a final_response tool-use reply.
tests/client/test_sampling_result_types.py:555
↓ 6 callers
Function
_get_auth_partition_key
Return a stable, hashed identifier for the current access token. Cache entries are partitioned by access token so that responses filtered by
fastmcp_slim/fastmcp/server/middleware/caching.py:557
↓ 6 callers
Method
_get_model
(self, model_preferences: ModelPreferences | None)
fastmcp_slim/fastmcp/client/sampling/handlers/google_genai.py:136
↓ 6 callers
Method
_get_visibility_rules
Load visibility rule dicts from session state.
fastmcp_slim/fastmcp/server/context.py:1318
↓ 6 callers
Method
_list_tools
(self)
fastmcp_slim/fastmcp/server/providers/filesystem.py:192
↓ 6 callers
Function
_loop_thread_id
()
tests/tools/test_tool_run_in_thread.py:22
↓ 6 callers
Function
_make_call_tool_cache_key
Make a cache key for a tool call using a stable hash of name and arguments.
fastmcp_slim/fastmcp/server/middleware/caching.py:572
↓ 6 callers
Function
_make_endpoint
Create an endpoint function for enabling/disabling a component type.
fastmcp_slim/fastmcp/contrib/component_manager/component_manager.py:91
↓ 6 callers
Function
_make_restoring_handler
Wrap a proxy handler to restore request_ctx before delegating. The wrapper is a plain ``async def`` so it passes ``inspect.isfunction()`` che
fastmcp_slim/fastmcp/server/providers/proxy.py:1070
↓ 6 callers
Method
_make_token
(scopes: list[str])
tests/server/middleware/test_caching.py:720
↓ 6 callers
Function
_make_upstream_token_set
Create an UpstreamTokenSet with optional id_token.
tests/server/auth/test_oidc_proxy_token.py:47
↓ 6 callers
Function
_normalize_server_entry
Normalize editor-specific server config fields to MCPConfig format. Handles two known differences: - Claude Code uses ``type`` where MCPConfi
fastmcp_slim/fastmcp/cli/discovery.py:68
↓ 6 callers
Function
_parse_model_preferences
Convert model preferences to ModelPreferences object.
fastmcp_slim/fastmcp/server/sampling/run.py:118
↓ 6 callers
Function
_recall_snapshot
Return the snapshot bound for ``task_id`` in the current context. Returns ``None`` if nothing is bound, or if the bound entry belongs to a di
fastmcp_slim/fastmcp/server/tasks/context.py:206
↓ 6 callers
Method
_setup_expired_session
Set up a proxy JWT pointing at an expired upstream token. Returns the proxy JWT (access token) that can be passed to load_access_toke
tests/server/auth/oauth_proxy/test_tokens.py:1288
↓ 6 callers
Function
_tool
Build a real Tool component (a FastMCPComponent) with a version.
tests/server/versioning/test_versioning.py:89
↓ 6 callers
Function
_unwrap_result
Extract the logical return value from a ToolResult.
tests/experimental/transforms/test_code_mode.py:24
↓ 6 callers
Method
add_tools
(self, fastmcp: FastMCP, prefix: str = "")
tests/server/middleware/test_caching.py:153
↓ 6 callers
Method
apply_runtime_settings
Apply runtime settings like environment variables and working directory. Args: config_path: Path to config file for resolving rel
fastmcp_slim/fastmcp/utilities/mcp_server_config/v1/mcp_server_config.py:85
↓ 6 callers
Method
asend
(self, value)
tests/client/auth/test_oauth_client.py:305
↓ 6 callers
Method
bind
(self, address: tuple[str, int])
tests/client/auth/test_oauth_client.py:265
↓ 6 callers
Function
build_regex
Build regex pattern for URI template, handling RFC 6570 syntax. Supports: - `{var}` - simple path parameter - `{var*}` - wildcard path pa
fastmcp_slim/fastmcp/resources/template.py:43
↓ 6 callers
Function
build_transport
(config: RemoteConfig)
fastmcp_remote/fastmcp_remote/cli.py:228
↓ 6 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
↓ 6 callers
Method
call_tools_bulk
Call multiple tools registered on this MCP server in a single request. Each call can be for a different tool and can include differe
fastmcp_slim/fastmcp/contrib/bulk_tool_caller/bulk_tool_caller.py:72
↓ 6 callers
Method
connect
( self, **session_kwargs: Unpack[SessionKwargs] )
fastmcp_slim/fastmcp/client/transports/stdio.py:83
↓ 6 callers
Function
decode_jwt_payload
Decode JWT payload without signature verification. Use only for tokens received directly from trusted sources (e.g., IdP token endpoints). A
fastmcp_slim/fastmcp/utilities/auth.py:49
↓ 6 callers
Method
find_config
Find a fastmcp.json file in the specified directory. Args: start_path: Directory to look in (defaults to current directory)
fastmcp_slim/fastmcp/utilities/mcp_server_config/v1/mcp_server_config.py:323
↓ 6 callers
Method
get_calls
Get all recorded calls for a specific method or hook. Args: method: The method to filter by (e.g. "tools/list")
tests/server/middleware/test_middleware.py:47
← previous
next →
301–400 of 10,312, ranked by callers