MCPcopy Create free account

hub / github.com/PrefectHQ/fastmcp / functions

Functions13,374 in github.com/PrefectHQ/fastmcp

↓ 14 callersMethodaclose
(self)
fastmcp_slim/fastmcp/server/auth/oauth_proxy/upstream.py:63
↓ 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:113
↓ 14 callersMethodcall_tool
Call a namespaced tool through the client that advertised it.
fastmcp_slim/fastmcp/client/group.py:274
↓ 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:297
↓ 14 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:516
↓ 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 callersMethodlist_tools
List tools from every client with namespaced names. An explicit call is the group's catalog-refresh mechanism, so it defaults to `cac
fastmcp_slim/fastmcp/client/group.py:183
↓ 14 callersFunctionmake_session
(server: FastMCP, principal: str | None, session_id: str)
tests/server/test_sessions.py:55
↓ 14 callersMethodmatch
(self, request: httpx2.Request)
tests/utilities/httpx2_mock.py:65
↓ 14 callersFunctionmock_github
( monkeypatch: pytest.MonkeyPatch, prs: list[dict[str, Any]], permission: str = "write", maint
tests/scripts/test_release_contributor_credit.py:54
↓ 14 callersFunctionparse_args
(argv: Sequence[str] | None = None)
fastmcp_remote/fastmcp_remote/cli.py:186
↓ 14 callersFunctionpr_metadata
( number: int, author: str = "maintainer", coauthors: tuple[str, ...] = (), reporters: tuple[s
tests/scripts/test_release_contributor_credit.py:13
↓ 14 callersMethodread
(a: str, b: str = "")
tests/resources/test_resource_template.py:1544
↓ 14 callersMethodset_mcp_path
Propagate MCP path to the server and all verifiers.
fastmcp_slim/fastmcp/server/auth/auth.py:772
↓ 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
↓ 14 callersMethodwait
Poll until the task reaches `state` (or any terminal state if `None`). Does not answer input prompts: a caller that wants automatic answering
fastmcp_tasks/fastmcp_tasks/client.py:437
↓ 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:92
↓ 13 callersFunction_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:152
↓ 13 callersMethod_hash_token
Return the SHA-256 hex digest of *token*.
fastmcp_slim/fastmcp/utilities/token_cache.py:146
↓ 13 callersFunction_search
(mcp: FastMCP, query: str)
tests/experimental/transforms/test_jev_search.py:117
↓ 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:56
↓ 13 callersMethodapply
Create a TransformedTool from a provided tool and this transformation configuration.
fastmcp_slim/fastmcp/tools/tool_transform.py:1001
↓ 13 callersMethodclose
(self)
fastmcp_slim/fastmcp/client/client.py:1393
↓ 13 callersFunctioncreate_openapi_server
Helper to create a FastMCP server with OpenAPIProvider.
tests/server/providers/openapi/test_comprehensive.py:18
↓ 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:44
↓ 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 callersMethodread_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:215
↓ 13 callersFunctionresolve_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:444
↓ 13 callersFunctionscan_notes
( notes: str, prs: dict[int, dict[str, Any]] | None = None )
scripts/release_contributor_credit.py:147
↓ 13 callersMethodsupports_tasks
Check if this component supports task execution.
fastmcp_slim/fastmcp/utilities/tasks.py:60
↓ 13 callersFunctiontask_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_tasks/fastmcp_tasks/keys.py:197
↓ 13 callersMethodvalidate
(token: str)
tests/server/auth/providers/test_debug.py:31
↓ 12 callersMethod_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:456
↓ 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 callersFunction_parse_mcp_config
Parse an mcpServers-style JSON file into discovered servers.
fastmcp_slim/fastmcp/cli/discovery.py:129
↓ 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:522
↓ 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:2063
↓ 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 callersFunctioncall
Invoke a tool the way an agent does, so the result is a ToolMessage with its artifact.
tests/downstream/smoke_langchain_mcp.py:76
↓ 12 callersMethodcomplete
Send a completion request to the server. Args: ref (mcp_types.ResourceTemplateReference | mcp_types.PromptReference): The referen
fastmcp_slim/fastmcp/client/client.py:1495
↓ 12 callersMethodconvert_result
Convert a raw result to ToolResult. Handles ToolResult passthrough and converts raw values using the tool's attributes (output_schema
fastmcp_slim/fastmcp/tools/base.py:367
↓ 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 callersFunctionentry
(number: int, author: str = "maintainer")
tests/scripts/test_release_contributor_credit.py:50
↓ 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:290
↓ 12 callersMethodgenerate
Generate an RSA key pair for testing. Returns: RSAKeyPair: Generated key pair
fastmcp_slim/fastmcp/server/auth/providers/jwt.py:103
↓ 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 callersMethodget_request
( self, *, url: str | re.Pattern[str] | httpx2.URL | None = None, method: str
tests/utilities/httpx2_mock.py:189
↓ 12 callersMethodissue_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
↓ 12 callersFunctionmake_server
()
tests/tasks/server/test_task_catalog_transforms.py:28
↓ 12 callersFunctionmake_upstream
()
tests/server/providers/proxy/test_server_metadata.py:141
↓ 12 callersFunctionparse_task_key
Parse Docket task key to extract metadata. Args: task_key: Encoded task key from Docket Returns: Dict with keys: ``task_scop
fastmcp_tasks/fastmcp_tasks/keys.py:118
↓ 12 callersFunctionparse_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 callersMethodping
()
tests/client/client/test_mode_negotiation.py:97
↓ 12 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:74
↓ 12 callersFunctionuse_horizon_api
( monkeypatch: pytest.MonkeyPatch, )
tests/cli/deploy/test_command.py:84
↓ 12 callersFunctionvalidate_url
Validate URL for SSRF and resolve to IPs. Args: url: URL to validate require_path: If True, require non-root path (for CIMD)
fastmcp_slim/fastmcp/server/auth/ssrf.py:278
↓ 11 callersFunction_adder
()
tests/server/middleware/test_message_visibility.py:59
↓ 11 callersMethod_app
(marker: str = "x", app_name: str = "contacts")
tests/server/providers/test_prefab_roundtrip.py:261
↓ 11 callersMethod_convert_to_anthropic_messages
( messages: Sequence[SamplingMessage], )
fastmcp_slim/fastmcp/client/sampling/handlers/anthropic.py:177
↓ 11 callersFunction_idp_jwks
Build a JWKS document from an RSA key pair's public key.
tests/server/auth/oauth_proxy/test_identity_assertion.py:47
↓ 11 callersFunction_schema_section
(schema: dict[str, Any] | None, title: str)
fastmcp_slim/fastmcp/server/transforms/search/base.py:191
↓ 11 callersFunction_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 callersFunctionbuild_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_tasks/fastmcp_tasks/keys.py:79
↓ 11 callersFunctiondownload_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
↓ 11 callersMethodenable_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:1199
↓ 11 callersFunctionget_http_request
Get the current HTTP request. Tries MCP SDK's request_ctx first, then falls back to FastMCP's HTTP context.
fastmcp_slim/fastmcp/server/dependencies.py:579
↓ 11 callersMethodinitialize
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:893
↓ 11 callersFunctionload_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:124
↓ 11 callersFunctionmake_m2m_responder
Build a responder for the standard M2M discovery + token exchange flow. Returns the responder and a dict that captures the token request and the
tests/client/auth/test_client_credentials.py:39
↓ 11 callersFunctionmock_transport
( handler: Callable[[httpx2.Request], httpx2.Response], )
tests/cli/deploy/test_horizon_client.py:21
↓ 11 callersMethodread
Read the resource by calling the wrapped function.
fastmcp_slim/fastmcp/resources/function_resource.py:201
↓ 11 callersMethodreport_progress
(self, phase: str, done: int, total: int)
scripts/rank_issues_tui.py:348
↓ 11 callersFunctionrequire_roles
Require all of the given roles, read from the token's claims. Roles and groups are not part of OIDC, so every identity provider puts them som
fastmcp_slim/fastmcp/utilities/authorization.py:148
↓ 11 callersMethodstart_as_current_span
( self, name: str, context: Context | None = None, kind: SpanKind = SpanKind.I
fastmcp_slim/fastmcp/telemetry.py:66
↓ 11 callersMethodstore_event
Store an event and return its ID. Args: stream_id: ID of the stream the event belongs to message: The JSON-RPC messag
fastmcp_slim/fastmcp/server/event_store.py:120
↓ 11 callersFunctionuser_meta
Strip the SDK's `serverInfo` stamp from a result's `_meta`. Every 2026-era result carries `io.modelcontextprotocol/serverInfo` (spec #3002),
tests/conftest.py:27
↓ 11 callersFunctionvalidate_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:427
↓ 11 callersFunctionwith_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 callersMethod_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:271
↓ 10 callersMethod_convert_to_openai_messages
( system_prompt: str | None, messages: Sequence[SamplingMessage] )
fastmcp_slim/fastmcp/client/sampling/handlers/openai.py:183
↓ 10 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:249
↓ 10 callersFunction_mock_httpx_client
Build a mock httpx2.AsyncClient whose stream() yields a canned response. The returned client's ``.stream.call_args`` exposes the request that was
tests/server/auth/test_ssrf_protection.py:24
↓ 10 callersFunctionapp_config_to_meta_dict
Convert an AppConfig or dict to the wire-format dict for ``meta["ui"]``.
fastmcp_slim/fastmcp/apps/config.py:190
↓ 10 callersFunctionasgi_client
Serve a FastMCP server over HTTP in-process and yield a connected `Client`. This is the shortest path to testing a server over a real HTTP s
fastmcp_slim/fastmcp/utilities/tests.py:409
↓ 10 callersFunctionbuild_transport
(config: RemoteConfig)
fastmcp_remote/fastmcp_remote/cli.py:252
↓ 10 callersFunctioncall_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 callersFunctioncreate_callback_html
Create a styled HTML response for OAuth callbacks.
fastmcp_slim/fastmcp/client/oauth_callback.py:34
↓ 10 callersFunctiondiscriminator_spec
A parent schema with a discriminator mapping onto two allOf subtypes.
tests/server/providers/openapi/test_openapi_discriminator.py:21
↓ 10 callersMethodexecute
Execute tool calls using Python code.
fastmcp_slim/fastmcp/experimental/transforms/code_mode.py:702
↓ 10 callersMethodfetch_token
Exchange an authorization grant for tokens at the token endpoint. Falsy parameters are dropped from the request body, matching authlib.
fastmcp_slim/fastmcp/server/auth/oauth_proxy/upstream.py:111
↓ 10 callersFunctionget_http_headers
Return HTTP headers from an ambient server request, when available. The standalone client package has no server request context. When the full
fastmcp_slim/fastmcp/client/dependencies.py:19
↓ 10 callersMethodget_session_id
Get the session ID for this transport, if available.
fastmcp_slim/fastmcp/client/transports/base.py:133
← previousnext →201–300 of 13,374, ranked by callers