MCPcopy Create free account

hub / github.com/PrefectHQ/fastmcp / functions

Functions11,669 in github.com/PrefectHQ/fastmcp

↓ 21 callersMethodbuild_command
Build complete uv run command with environment args and command to execute. Args: command: Command to execute (e.g., ["fastmcp",
fastmcp_slim/fastmcp/utilities/mcp_server_config/v1/environments/uv.py:49
↓ 21 callersFunctioncall_tool_without_optin
Run a `tools/call` with no tasks opt-in (synchronous unless mode=required).
tests/tasks/task_helpers.py:128
↓ 21 callersMethodfrom_dict
Parse MCP configuration from dictionary format.
fastmcp_slim/fastmcp/mcp_config.py:334
↓ 21 callersMethodissue_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
↓ 21 callersFunctionresolve_server_spec
Turn CLI inputs into something ``Client()`` accepts. Exactly one of ``server_spec`` or ``command`` should be provided. Resolution order for
fastmcp_slim/fastmcp/cli/client.py:43
↓ 21 callersMethodvalidate_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:235
↓ 20 callersFunction_parse_tool_result
Extract tool list from a ToolResult's structured content.
tests/server/transforms/test_search.py:30
↓ 20 callersMethodassert_not_called
Assert that a hook was not called.
tests/server/middleware/test_middleware.py:104
↓ 20 callersMethodcount
()
tests/server/versioning/test_mounting.py:23
↓ 20 callersFunctionget_context
Get the current FastMCP Context instance directly.
fastmcp_slim/fastmcp/server/dependencies.py:442
↓ 20 callersMethodget_meta
Get the meta information about the component. Returns a dict that always includes a `fastmcp` key containing: - `tags`: sorted list o
fastmcp_slim/fastmcp/utilities/components.py:161
↓ 20 callersMethodget_tool
( self, name: str, call_next: GetToolNext, *, version: VersionSpec | None = None )
tests/server/transforms/test_catalog.py:46
↓ 20 callersFunctionmatch_uri_template
Match URI against template and extract both path and query parameters. Supports RFC 6570 URI templates: - Path params: `{var}`, `{var*}`
fastmcp_slim/fastmcp/resources/template.py:83
↓ 20 callersFunctionparse_docstring
Parse a function's docstring into a summary and parameter descriptions. Tries Google, NumPy, and Sphinx parsers in order, using the first one tha
fastmcp_slim/fastmcp/utilities/docstring_parsing.py:35
↓ 20 callersFunctionparse_openapi_to_http_routes
Parses an OpenAPI schema dictionary into a list of HTTPRoute objects using the openapi-pydantic library. Supports both OpenAPI 3.0.x and
fastmcp_slim/fastmcp/utilities/openapi/parser.py:56
↓ 20 callersMethodraise_for_status
()
tests/server/providers/openapi/test_comprehensive.py:657
↓ 20 callersMethodrun
Run the tool with arguments. This method is not implemented in the base Tool class and must be implemented by subclasses.
fastmcp_slim/fastmcp/tools/base.py:335
↓ 20 callersFunctionssrf_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:370
↓ 20 callersMethodverify_token
Verify a Clerk OAuth token via introspection and userinfo. Calls the introspection endpoint first to validate the token and retrieve
fastmcp_slim/fastmcp/server/auth/providers/clerk.py:94
↓ 19 callersMethod_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:187
↓ 19 callersFunctionasgi_server
Serve a FastMCP server's HTTP app in-process, with no socket and no uvicorn. This is the fastest way to test a FastMCP server over HTTP. The
fastmcp_slim/fastmcp/utilities/tests.py:335
↓ 19 callersMethodcall_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:139
↓ 19 callersMethodfetch
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 callersFunctionis_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
↓ 19 callersMethodping
Send a ping request.
fastmcp_slim/fastmcp/client/client.py:1348
↓ 19 callersMethodset_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:750
↓ 19 callersMethodset_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:1120
↓ 18 callersMethodadd_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:373
↓ 18 callersFunctiongather
( awaitables: Iterable[Awaitable[T]], *, return_exceptions: Literal[True], )
fastmcp_slim/fastmcp/utilities/async_utils.py:38
↓ 18 callersMethodstart_soon
(self, func: Any, *args: Any)
tests/utilities/test_async_utils.py:124
↓ 17 callersMethod_await_with_session_monitoring
Await a coroutine while monitoring the session task for errors. When using HTTP transports, server errors (4xx/5xx) are raised in the
fastmcp_slim/fastmcp/client/client.py:1112
↓ 17 callersFunctionclient_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
↓ 17 callersFunctioncoerce_value
Coerce a string CLI value according to a JSON-Schema type hint.
fastmcp_slim/fastmcp/cli/client.py:264
↓ 17 callersFunctiondereference_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:180
↓ 17 callersMethodget_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:1162
↓ 17 callersFunctionget_task
Call the `tasks/get` handler within the given auth scope.
tests/tasks/task_helpers.py:140
↓ 16 callersMethod_list_tools
(self)
fastmcp_slim/fastmcp/apps/app.py:407
↓ 16 callersMethod_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 callersFunction_server
The lowlevel Server the SDK client connects to in-process.
tests/server/test_protocol_eras.py:73
↓ 16 callersFunction_tasks_server
()
tests/tasks/server/test_extension.py:50
↓ 16 callersFunction_tool_refs
Every tool name the rendered UI would call, in document order.
tests/server/providers/test_prefab_roundtrip.py:29
↓ 16 callersMethodassert_called
Assert that a hook was called a specific number of times.
tests/server/middleware/test_middleware.py:74
↓ 16 callersMethodclient
Create a test client for the FastMCP server.
tests/contrib/test_component_manager.py:46
↓ 16 callersMethoddelete
Remove `key` from this session, if present (preserves the marker).
fastmcp_slim/fastmcp/server/sessions.py:270
↓ 16 callersFunctionis_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:138
↓ 16 callersMethodset
(self, key: CacheKey, entry: CacheEntry)
fastmcp_slim/fastmcp/client/caching.py:166
↓ 16 callersFunctiontwo_question_server
A guard tool that asks two dependent questions across three rounds. Round 1 (no responses): ask for a destination. Round 2 (destination answe
tests/server/test_mrtr_guards.py:81
↓ 16 callersMethodvalidate_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 callersFunction_tool_function_source
Generate the source for a single ``@call_tool_app.command`` function.
fastmcp_slim/fastmcp/cli/generate.py:166
↓ 15 callersFunctionget_elicitation_schema
Get the schema for an elicitation response. Args: response_type: The type of the response
fastmcp_slim/fastmcp/server/elicitation.py:369
↓ 15 callersMethodrun
(self, arguments: dict[str, Any])
tests/server/test_providers.py:27
↓ 14 callersFunction_start_flow
Register client and start auth; returns (txn_id, consent_url).
tests/server/auth/test_oauth_consent_flow.py:134
↓ 14 callersFunction_two_answer_handler
(asked: list[str])
tests/server/test_mrtr_guards.py:116
↓ 14 callersMethodaclose
(self)
fastmcp_slim/fastmcp/server/auth/oauth_proxy/upstream.py:64
↓ 14 callersFunctionbind_request_context
Bind a ``FastMCPRequestContext`` for the duration of a handler. Constructs the wrapper from the SDK's per-request context and sets/resets the
fastmcp_slim/fastmcp/server/dependencies.py:104
↓ 14 callersMethodclient
(self)
tests/tools/tool/test_results.py:16
↓ 14 callersMethodfrom_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 callersFunctionis_redirect_uri_allowed_for_application_type
Check a redirect URI against RFC 7591 / SEP-837 `application_type` rules. `application_type` governs which redirect URIs a Dynamically Registered
fastmcp_slim/fastmcp/server/auth/redirect_validation.py:369
↓ 14 callersMethodload_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:459
↓ 14 callersFunctionmake_session
(server: FastMCP, principal: str | None, session_id: str)
tests/server/test_sessions.py:55
↓ 14 callersFunctionparse_args
(argv: Sequence[str] | None = None)
fastmcp_remote/fastmcp_remote/cli.py:185
↓ 14 callersMethodset
Store a *successful* verification result. Only successful verifications should be cached. Failures (inactive tokens, missing scopes,
fastmcp_slim/fastmcp/utilities/token_cache.py:118
↓ 14 callersMethodverify_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 callersFunction_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:66
↓ 13 callersFunction_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:208
↓ 13 callersMethod_hash_token
Return the SHA-256 hex digest of *token*.
fastmcp_slim/fastmcp/utilities/token_cache.py:146
↓ 13 callersMethod_lifespan_manager
(self: FastMCP)
fastmcp_slim/fastmcp/server/mixins/lifespan.py:169
↓ 13 callersFunction_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 callersMethodapply
Create a TransformedTool from a provided tool and this transformation configuration.
fastmcp_slim/fastmcp/tools/tool_transform.py:1036
↓ 13 callersFunctioncall_tool_task
Call a tool as a background task and return a `ToolTask` handle immediately. Unlike `client.call_tool` (which polls to completion transparently),
fastmcp_tasks/fastmcp_tasks/client.py:520
↓ 13 callersMethodclose
(self)
fastmcp_slim/fastmcp/client/client.py:1342
↓ 13 callersFunctioncreate_openapi_server
Helper to create a FastMCP server with OpenAPIProvider.
tests/server/providers/openapi/test_comprehensive.py:18
↓ 13 callersFunctionexpand_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:122
↓ 13 callersFunctiongenerate_skill_content
Generate a SKILL.md file for a generated CLI script.
fastmcp_slim/fastmcp/cli/generate.py:619
↓ 13 callersMethodget_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:786
↓ 13 callersFunctionhash_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:39
↓ 13 callersMethodis_connected
Check if the client is currently connected.
fastmcp_slim/fastmcp/client/client.py:742
↓ 13 callersMethodkey
The globally unique lookup key for this resource.
fastmcp_slim/fastmcp/resources/base.py:480
↓ 13 callersMethodmake_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
↓ 13 callersFunctionmake_server_request_context
Build a minimal SDK ServerRequestContext for direct handler unit tests. The v2 SDK hands handlers a ``ServerRequestContext`` argument. Tests that
tests/conftest.py:42
↓ 13 callersMethodmatch
(self, request: httpx2.Request)
tests/utilities/httpx2_mock.py:65
↓ 13 callersMethodresult
Drive the task to completion and return its parsed result. Answers any input prompts through the client's elicitation handler. Raises
fastmcp_tasks/fastmcp_tasks/client.py:478
↓ 13 callersMethodrun_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
↓ 13 callersMethodset_mcp_path
Propagate MCP path to the server and all verifiers.
fastmcp_slim/fastmcp/server/auth/auth.py:772
↓ 13 callersMethodto_json
Serialize to JSON for Redis storage.
fastmcp_tasks/fastmcp_tasks/context.py:209
↓ 12 callersFunction_extract_csrf
Extract CSRF token from HTML form.
tests/server/auth/test_oauth_consent_flow.py:164
↓ 12 callersFunction_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 callersFunction_make_token
( *, token: str = "tok", client_id: str = "client-1", scopes: list[str] | None = None, exp
tests/utilities/test_token_cache.py:11
↓ 12 callersMethod_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:125
↓ 12 callersMethod_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:521
↓ 12 callersFunction_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 callersMethodadd_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:2096
↓ 12 callersMethodassert_called
Assert that a hook was called a specific number of times.
tests/server/middleware/test_middleware_nested.py:76
↓ 12 callersFunctionauth_scope
Bind (or clear) the auth context so `get_task_scope` sees a caller.
tests/tasks/task_helpers.py:72
↓ 12 callersFunctioncreate_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 callersFunctiondrive_auth_flow
Drive an httpx auth flow to completion, feeding each yield to responder.
tests/client/auth/test_client_credentials.py:98
↓ 12 callersFunctionextract_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 callersFunctiongenerate_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 callersFunctionget_log_lines
Get log lines from a caplog fixture.
tests/server/middleware/test_logging.py:27
↓ 12 callersFunctionget_server
Get the current FastMCP server instance directly. In a background-task worker the tasks extension's resolver is consulted first, so a mounted
fastmcp_slim/fastmcp/server/dependencies.py:452
← previousnext →101–200 of 11,669, ranked by callers