Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PrefectHQ/fastmcp
/ functions
Functions
11,669 in github.com/PrefectHQ/fastmcp
⨍
Functions
11,669
◇
Types & classes
1,774
↳
Endpoints
123
↓ 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:33
↓ 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
Function
_cached_server
An SDK MCPServer whose tools/list carries a positive ttlMs hint at 2026.
tests/client/client/test_response_cache.py:28
↓ 6 callers
Function
_decode
(value: Any)
fastmcp_tasks/fastmcp_tasks/input_store.py:127
↓ 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
_exists
Whether a session record exists for this `(principal, session_id)`. True only once `create_session` has written the creation marker. A raw
fastmcp_slim/fastmcp/server/sessions.py:237
↓ 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
_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:614
↓ 6 callers
Method
_get_visibility_rules
Load visibility rule dicts from session state.
fastmcp_slim/fastmcp/server/context.py:1189
↓ 6 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
↓ 6 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:131
↓ 6 callers
Method
_load_raw
Read the session's full stored dict, or `None` when the key is unset.
fastmcp_slim/fastmcp/server/sessions.py:215
↓ 6 callers
Method
_log_error
Log error with appropriate detail level.
fastmcp_slim/fastmcp/server/middleware/error_handling.py:57
↓ 6 callers
Function
_loop_thread_id
()
tests/tools/test_tool_run_in_thread.py:22
↓ 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_env_var
Parse environment variable string in format KEY=VALUE.
fastmcp_slim/fastmcp/cli/cli.py:62
↓ 6 callers
Method
_prepare_scopes_for_token_exchange
Prepare scopes for Azure authorization code exchange. Azure requires scopes during token exchange (AADSTS28003 error if missing). Azu
fastmcp_slim/fastmcp/server/auth/providers/azure.py:491
↓ 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:1388
↓ 6 callers
Function
_start_flow
Register client and start auth; returns (txn_id, consent_url).
tests/server/auth/test_oauth_consent_page.py:67
↓ 6 callers
Function
_texts
Text from CallToolResult.content blocks (TextContent).
tests/server/test_protocol_eras.py:78
↓ 6 callers
Function
_tools_result
()
tests/client/client/test_kv_response_cache.py:34
↓ 6 callers
Method
aclose
(self)
fastmcp_slim/fastmcp/utilities/asgi_transport.py:66
↓ 6 callers
Method
add_tools
(self, fastmcp: FastMCP, prefix: str = "")
tests/server/middleware/test_caching.py:154
↓ 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
Function
assert_task_matches_sync
Run a tool sync and as a task; assert the inlined results are identical.
tests/tasks/server/test_task_return_types.py:60
↓ 6 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:446
↓ 6 callers
Method
bind
(self, address: tuple[str, int])
tests/client/auth/test_oauth_client.py:359
↓ 6 callers
Function
build_injected_server
Server whose cart tools inject a per-user `session: UserSession`.
tests/server/test_session_provider.py:70
↓ 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:46
↓ 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
Function
client_supports_extension
Check whether the connected client supports a given MCP extension. Inspects the ``extensions`` capability on ``ClientCapabilities`` sent by the
fastmcp_slim/fastmcp/server/low_level.py:111
↓ 6 callers
Function
create_oauth_callback_server
Create an OAuth callback server. Args: port: The port to run the server on callback_path: The path to listen for OAuth redir
fastmcp_slim/fastmcp/client/oauth_callback.py:114
↓ 6 callers
Function
current_principal
The authenticated principal for the current request as a compact JSON string. Returns the `(client_id, issuer, subject)` triple encoded as compac
fastmcp_slim/fastmcp/server/sessions.py:139
↓ 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
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:1235
↓ 6 callers
Method
disconnect
(self)
fastmcp_slim/fastmcp/client/transports/stdio.py:169
↓ 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
form
()
tests/server/providers/test_prefab_roundtrip.py:269
↓ 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:48
↓ 6 callers
Method
get_client
Get client information by ID. This is generally the random ID provided to the DCR client during registration, not the upstream client ID.
fastmcp_slim/fastmcp/server/auth/oauth_proxy/proxy.py:903
↓ 6 callers
Function
get_property
(tool: Tool, name: str)
tests/tools/tool_transform/test_args.py:21
↓ 6 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:1049
↓ 6 callers
Function
get_skill_manifest
Get the manifest for a specific skill. Args: client: Connected FastMCP client skill_name: Name of the skill Returns:
fastmcp_slim/fastmcp/utilities/skills.py:87
↓ 6 callers
Method
get_span_attributes
(self)
fastmcp_slim/fastmcp/server/providers/proxy.py:389
↓ 6 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_tasks/fastmcp_tasks/context.py:87
↓ 6 callers
Method
get_token_expiry
(self)
fastmcp_slim/fastmcp/client/auth/oauth.py:168
↓ 6 callers
Function
get_tracer
Get the FastMCP tracer for creating spans. Instrumentation is on by default. FastMCP uses only the OpenTelemetry API, so span creation is a n
fastmcp_slim/fastmcp/telemetry.py:128
↓ 6 callers
Function
install_cursor
Install FastMCP server in Cursor. Args: file: Path to the server file server_object: Optional server object name (for :object suf
fastmcp_slim/fastmcp/cli/install/cursor.py:143
↓ 6 callers
Function
issubclass_safe
Check if cls is a subclass of base, even if cls is a type variable.
fastmcp_slim/fastmcp/utilities/types.py:128
↓ 6 callers
Method
issue_refresh_token
Issue a minimal FastMCP refresh token. FastMCP refresh tokens are reference tokens containing only the minimal claims needed for vali
fastmcp_slim/fastmcp/server/auth/jwt_issuer.py:175
↓ 6 callers
Method
list_tools
Retrieve all tools available on the server. This method automatically fetches all pages if the server paginates results, returning th
fastmcp_slim/fastmcp/client/mixins/tools.py:90
↓ 6 callers
Function
make_restricted_tag_server
()
tests/server/auth/test_authorization.py:52
↓ 6 callers
Function
make_token
( *, subject: str = "user-a", client_id: str = "client-1" )
tests/server/test_sessions.py:27
↓ 6 callers
Function
native_spans_enabled
Whether FastMCP should create its own spans right now.
fastmcp_slim/fastmcp/telemetry.py:103
↓ 6 callers
Method
new
Create a new client instance with the same configuration but fresh session state. This creates a new client with the same transport, handlers
fastmcp_slim/fastmcp/client/client.py:746
↓ 6 callers
Method
new
(self)
fastmcp_slim/fastmcp/server/providers/proxy.py:1607
↓ 6 callers
Function
normalize_completion
Coerce a handler's return value into a wire ``Completion``. A returned ``str`` is rejected: it is almost always a mistake (the value would it
fastmcp_slim/fastmcp/server/completions.py:54
↓ 6 callers
Method
prepare
Prepare environment and source for execution. When output_dir is provided, creates a persistent uv project. When output_dir is None,
fastmcp_slim/fastmcp/utilities/mcp_server_config/v1/mcp_server_config.py:342
↓ 6 callers
Function
principal_string
(token: SDKAccessToken)
tests/server/test_sessions.py:39
↓ 6 callers
Function
require_docket
Raise ImportError with install instructions if docket not available. Args: feature: Description of what requires docket (e.g., "`task=Tru
fastmcp_tasks/fastmcp_tasks/dependencies.py:45
↓ 6 callers
Function
restrict_tag
Require scopes when the accessed component has a specific tag.
fastmcp_slim/fastmcp/utilities/authorization.py:197
↓ 6 callers
Method
send
(self, message: dict[str, Any])
tests/client/minimal_stdio_server.py:92
↓ 6 callers
Function
serialize_transport
Serialize a resolved transport to a Python expression string. Returns ``(expression, extra_imports)`` where *extra_imports* is a set of impor
fastmcp_slim/fastmcp/cli/generate.py:122
↓ 6 callers
Function
session_id_parameter_names
Names of a function's parameters annotated with `SessionId`. Scans resolved type hints for `Annotated[str, _SessionIdMarker()]` metadata. Ret
fastmcp_slim/fastmcp/server/sessions.py:343
↓ 6 callers
Function
session_storage_key
The single storage key holding a session's state dict. Keyed by `(principal, session_id)`: the principal is the isolation wall, the id organi
fastmcp_slim/fastmcp/server/sessions.py:164
↓ 6 callers
Function
to_mcp_error
Translate a FastMCP exception into a wire-format ``MCPError``. Central mapping from FastMCP's public exception types to the JSON-RPC error co
fastmcp_slim/fastmcp/exceptions.py:122
↓ 6 callers
Method
to_mcp_result
( self, )
fastmcp_slim/fastmcp/tools/base.py:165
↓ 6 callers
Method
to_transport
(self)
tests/test_mcp_config.py:99
↓ 6 callers
Method
unwrap
(self)
fastmcp_slim/fastmcp/server/middleware/caching.py:140
↓ 6 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:602
↓ 5 callers
Method
__init__
(self)
tests/server/middleware/test_initialization_middleware.py:120
↓ 5 callers
Method
_backend
()
tests/server/providers/test_prefab_roundtrip.py:186
↓ 5 callers
Function
_backfill_boolean_defaults
Fill in missing boolean fields with their model defaults. HTML checkboxes omit the field entirely when unchecked, so the submitted data dict
fastmcp_slim/fastmcp/apps/form.py:67
↓ 5 callers
Function
_build_stdio_from_command
Shell-split a command string into a ``StdioTransport``.
fastmcp_slim/fastmcp/cli/client.py:115
↓ 5 callers
Function
_claude_code_config
Build a minimal ~/.claude.json structure.
tests/cli/test_discovery.py:258
↓ 5 callers
Method
_collect_list_results
Collect successful list results, logging any exceptions. Emits a warning when the same MCP identity is returned by more than one prov
fastmcp_slim/fastmcp/server/providers/aggregate.py:118
↓ 5 callers
Method
_construct_and_capture_timeout
Construct a provider with mocked discovery, returning the timeout used.
tests/server/auth/test_oidc_proxy.py:888
↓ 5 callers
Method
_convert_tool_choice_to_anthropic
Convert MCP tool_choice to Anthropic format. Returns None for "none" mode, signaling that tools should be omitted from the request en
fastmcp_slim/fastmcp/client/sampling/handlers/anthropic.py:387
↓ 5 callers
Method
_create
Write the initial record so the session exists (called by `create_session`).
fastmcp_slim/fastmcp/server/sessions.py:247
↓ 5 callers
Method
_create_test_auth_provider
Helper to create a test RemoteAuthProvider with StaticTokenVerifier.
tests/server/auth/test_remote_auth_provider.py:235
↓ 5 callers
Method
_disconnect
Disconnect from session using reference counting. This method implements proper cleanup for reentrant context managers: - De
fastmcp_slim/fastmcp/client/client.py:1031
↓ 5 callers
Method
_ensure_setup
Lazily register tools and resources on first access.
fastmcp_slim/fastmcp/apps/generative.py:99
↓ 5 callers
Method
_extract_scopes
Extract scopes from JWT claims. Supports both 'scope' and 'scp' claims. Checks the `scope` claim first (standard OAuth2 clai
fastmcp_slim/fastmcp/server/auth/providers/jwt.py:442
↓ 5 callers
Function
_find_azure_provider
Extract an AzureProvider from an auth provider, unwrapping MultiAuth if needed.
fastmcp_slim/fastmcp/server/auth/providers/azure.py:820
↓ 5 callers
Function
_guard_status
( *, host: str, origin: str | None = None, server: tuple[str, int] | None = None, mode: Li
tests/server/http/test_http_auth_middleware.py:36
↓ 5 callers
Function
_input_required
( requests: dict[str, mcp_types.ElicitRequest], request_state: str | None = None, )
tests/tasks/server/test_guard_reentrant.py:55
↓ 5 callers
Function
_is_loopback_host
(host: str)
fastmcp_slim/fastmcp/server/http.py:133
↓ 5 callers
Method
_list_tools
(self)
fastmcp_slim/fastmcp/server/providers/filesystem.py:192
↓ 5 callers
Function
_make_dev_app
Build the Starlette dev server application.
fastmcp_slim/fastmcp/cli/apps_dev.py:1385
↓ 5 callers
Function
_make_resolver
Create a CallTool resolver that addresses peer tools by identity. ``app_name`` is the FastMCPApp's name, known at serialization time from the
fastmcp_slim/fastmcp/apps/app.py:56
↓ 5 callers
Function
_parse_call_tool_result
Parse an mcp_types.CallToolResult into our CallToolResult dataclass. Args: name: Tool name (for schema lookup) result: Raw MCP pr
fastmcp_slim/fastmcp/client/mixins/tools.py:334
↓ 5 callers
Function
_proxy_upstream_error
Report an unreachable backend the same way however the failure arrived. Depending on where the dead connection is noticed, the proxy sees either
fastmcp_slim/fastmcp/server/providers/proxy.py:118
↓ 5 callers
Method
_resolve_ref
Resolves a reference to its target definition.
fastmcp_slim/fastmcp/utilities/openapi/parser.py:160
↓ 5 callers
Method
_resource_server
()
tests/server/test_mrtr_guards_components.py:127
↓ 5 callers
Function
_sanitize_untrusted_text
Escape rich markup and encode control chars for terminal-safe output.
fastmcp_slim/fastmcp/cli/client.py:409
↓ 5 callers
Function
_scan_cursor_workspace
Walk up from *start_dir* looking for ``.cursor/mcp.json``.
fastmcp_slim/fastmcp/cli/discovery.py:204
↓ 5 callers
Function
_scan_gemini
Scan Gemini CLI settings for MCP servers. Checks both user-level ``~/.gemini/settings.json`` and project-level ``.gemini/settings.json``.
fastmcp_slim/fastmcp/cli/discovery.py:231
← previous
next →
401–500 of 11,669, ranked by callers