MCPcopy Create free account

hub / github.com/PrefectHQ/fastmcp / functions

Functions15,974 in github.com/PrefectHQ/fastmcp

↓ 33 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:357
↓ 33 callersFunctioncreate_streamable_http_app
Return an instance of the StreamableHTTP server app. Args: server: The FastMCP server instance streamable_http_path: Path for Str
fastmcp_slim/fastmcp/server/http.py:632
↓ 33 callersMethodis_connected
Check if the client is currently connected.
fastmcp_slim/fastmcp/client/client.py:784
↓ 33 callersMethodlist_resource_templates
List all enabled resource templates from providers. Overrides Provider.list_resource_templates() to add visibility filtering, auth fi
fastmcp_slim/fastmcp/server/server.py:1236
↓ 33 callersFunctionmake_tool
Create a mock tool for testing.
tests/server/auth/test_authorization.py:62
↓ 33 callersFunctionmatches_allowed_pattern
Securely check if a URI matches an allowed pattern with wildcard support. This function parses both the URI and pattern as URLs, comparing each
fastmcp_slim/fastmcp/server/auth/redirect_validation.py:374
↓ 33 callersMethodreset
(self)
tests/utilities/httpx2_mock.py:202
↓ 32 callersMethodcancel
()
tests/utilities/test_async_utils.py:62
↓ 31 callersFunction_make_server_with_tools
()
tests/server/transforms/test_search.py:36
↓ 31 callersMethodto_mcp_tool
Convert the FastMCP tool to an MCP tool.
fastmcp_slim/fastmcp/tools/base.py:372
↓ 30 callersFunction_write_config
(path: Path, data: dict[str, Any])
tests/cli/test_discovery.py:56
↓ 30 callersFunctionfind_available_port
Find an available port by letting the OS assign one.
fastmcp_slim/fastmcp/utilities/http.py:4
↓ 30 callersFunctionget_context
Get the current FastMCP Context instance directly.
fastmcp_slim/fastmcp/server/dependencies.py:515
↓ 30 callersFunctionparse_scopes
Parse scopes from environment variables or settings values. Accepts either a JSON array string, a comma- or space-separated string, a list of
fastmcp_slim/fastmcp/utilities/auth.py:70
↓ 30 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:453
↓ 29 callersMethodadd_tool
Add a tool to this app programmatically. The tool is tagged with this app's name for routing. Names matching `__<12 lowercase hex>_<n
fastmcp_slim/fastmcp/apps/app.py:391
↓ 29 callersMethodcreate_resource
Create a resource from the template with the given parameters. The base implementation does not support background tasks. Use Functio
fastmcp_slim/fastmcp/resources/template.py:575
↓ 29 callersMethodinfo
Send a `INFO`-level message to the connected MCP Client. Messages sent to Clients are also logged to the `fastmcp.server.context.to_client` l
fastmcp_slim/fastmcp/server/context.py:874
↓ 29 callersFunctioninspect_fastmcp
Extract information from a FastMCP instance into a dataclass. This function automatically detects whether the instance is FastMCP v1.x or v2.x
fastmcp_slim/fastmcp/utilities/inspect.py:413
↓ 29 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:57
↓ 29 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:216
↓ 28 callersMethodcall_tool_mcp
Call a namespaced tool and return its raw MCP result.
fastmcp_slim/fastmcp/client/group.py:347
↓ 28 callersFunctioncoerce_value
Coerce a string CLI value according to a JSON-Schema type hint.
fastmcp_slim/fastmcp/cli/client.py:394
↓ 28 callersFunctionget_cached_typeadapter
TypeAdapters are heavy objects, and in an application context we'd typically create them once in a global scope and reuse them as often as po
fastmcp_slim/fastmcp/utilities/types.py:54
↓ 28 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:60
↓ 27 callersMethodauthorize
(self, client, params)
tests/server/auth/test_enhanced_error_responses.py:55
↓ 26 callersFunctioncall_tool_without_optin
Run a `tools/call` with no tasks opt-in (synchronous unless mode=required).
tests/tasks/task_helpers.py:128
↓ 26 callersFunctiongather
( awaitables: Iterable[Awaitable[T]], *, return_exceptions: Literal[True], )
fastmcp_slim/fastmcp/utilities/async_utils.py:38
↓ 26 callersFunctionimport_module_from_file
Import a Python file as a module. If the file is part of a package (directory has __init__.py), imports it as a proper package member (relati
fastmcp_slim/fastmcp/server/providers/filesystem_discovery.py:142
↓ 26 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
↓ 26 callersMethodlog
Send a log message to the client. Messages sent to Clients are also logged to the `fastmcp.server.context.to_client` logger with a level of `
fastmcp_slim/fastmcp/server/context.py:622
↓ 26 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:59
↓ 26 callersFunctionserver_with
(app: FastMCPApp)
tests/server/test_hashed_tool_dispatch.py:83
↓ 25 callersMethodcount
()
tests/server/versioning/test_mounting.py:23
↓ 25 callersFunctionis_enabled
Check if component is enabled. Returns True if: - No visibility mark exists (default is enabled) - Visibility mark is True Returns F
fastmcp_slim/fastmcp/server/transforms/visibility.py:285
↓ 25 callersFunctionrun_auth_checks
Run auth checks with AND logic, stopping at the first failure.
fastmcp_slim/fastmcp/utilities/authorization.py:304
↓ 25 callersMethodverify_token
Verify GitHub OAuth token by calling GitHub API.
fastmcp_slim/fastmcp/server/auth/providers/github.py:122
↓ 24 callersMethodput
(self, key: Hashable, value: _V, weight: int)
fastmcp_slim/fastmcp/utilities/json_schema_type.py:200
↓ 24 callersMethodstart_soon
(self, func: Any, *args: Any)
tests/utilities/test_async_utils.py:176
↓ 23 callersFunction_run_tool
( server: FastMCP, name: str, arguments: dict[str, Any] )
tests/experimental/transforms/test_code_mode_discovery.py:80
↓ 23 callersFunction_unwrap_string_result
Extract a string result from a ToolResult.
tests/experimental/transforms/test_code_mode_discovery.py:43
↓ 23 callersMethodassert_not_called
Assert that a hook was not called.
tests/server/middleware/test_middleware.py:104
↓ 23 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:316
↓ 23 callersMethodregister_client
Register a client locally When a client registers, we create a ProxyDCRClient that is more forgiving about validating redirect URIs,
fastmcp_slim/fastmcp/server/auth/oauth_proxy/proxy.py:1036
↓ 23 callersMethodsearch
( limit: Annotated[int | None, Field(description="How many.")] = None, )
tests/tools/tool/test_tool.py:284
↓ 23 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:825
↓ 22 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
↓ 22 callersMethodget
(self, key: Hashable)
fastmcp_slim/fastmcp/utilities/json_schema_type.py:192
↓ 22 callersFunctionget_task
Call the `tasks/get` handler within the given auth scope.
tests/tasks/task_helpers.py:140
↓ 22 callersFunctionmake_server
(name: str)
tests/client/group/test_client_group.py:36
↓ 22 callersMethodread
(path: str)
tests/resources/test_resource_security.py:351
↓ 22 callersMethodverify_token
Verify a token by trying the server, then each verifier in order. Each source is tried independently. Operational verification failures
fastmcp_slim/fastmcp/server/auth/auth.py:975
↓ 22 callersMethodverify_token
Mock token verification.
tests/server/auth/oauth_proxy/conftest.py:279
↓ 21 callersFunction_parse_tool_result
Extract tool list from a ToolResult's structured content.
tests/server/transforms/test_search.py:30
↓ 21 callersMethodclose
(self)
tests/client/client/test_client.py:1086
↓ 21 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:190
↓ 21 callersMethodget_tool
( self, name: str, call_next: GetToolNext, *, version: VersionSpec | None = None )
tests/server/test_hashed_tool_dispatch.py:395
↓ 21 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:73
↓ 21 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:373
↓ 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:259
↓ 21 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:104
↓ 20 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:1270
↓ 20 callersMethod_lifespan_manager
(self: FastMCP)
fastmcp_slim/fastmcp/server/mixins/lifespan.py:180
↓ 20 callersFunction_make_file
( name: str = "test.txt", content: str = "hello world", mime_type: str = "text/plain", )
tests/apps/test_file_upload.py:37
↓ 20 callersFunction_response
( status_code: int, text: str = "simulated", *, headers: dict[str, str] | None = None, jso
tests/server/auth/providers/test_github_transient_failures.py:16
↓ 20 callersFunction_start_flow
Register client and start auth; returns (txn_id, consent_url).
tests/server/auth/test_oauth_consent_flow.py:140
↓ 20 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:324
↓ 20 callersMethodhome
(self)
examples/smart_home/tests/test_fire_tv.py:29
↓ 20 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 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 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:16
↓ 19 callersMethoddelete
Remove `key` from this session, if present (preserves the marker).
fastmcp_slim/fastmcp/server/sessions.py:270
↓ 19 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:467
↓ 19 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:40
↓ 19 callersMethodmatch
(self, request: httpx2.Request)
tests/utilities/httpx2_mock.py:65
↓ 19 callersMethodraise_for_status
(self)
tests/server/auth/providers/test_auth0_mcp.py:253
↓ 19 callersMethodset
(self, key: CacheKey, entry: CacheEntry)
fastmcp_slim/fastmcp/client/caching.py:170
↓ 18 callersFunction_extract_csrf
Extract CSRF token from HTML form.
tests/server/auth/test_oauth_consent_flow.py:170
↓ 18 callersFunction_jwt_auth
( key_pair: RSAKeyPair, required_scopes: list[str] | None = None )
tests/contrib/test_component_manager.py:717
↓ 18 callersFunction_unwrap_result
Extract the logical return value from a ToolResult.
tests/experimental/transforms/test_code_mode.py:30
↓ 18 callersFunctionbuild_spec
( body_schema: dict[str, Any], components: dict[str, Any] )
tests/server/providers/openapi/test_body_ref_siblings.py:11
↓ 18 callersFunctioncall_make_thing
( spec: dict[str, Any], arguments: dict[str, Any] )
tests/server/providers/openapi/test_body_ref_siblings.py:33
↓ 18 callersMethodcall_tool
Call a namespaced tool through the client that advertised it.
fastmcp_slim/fastmcp/client/group.py:366
↓ 18 callersFunctiongenerate_cli_script
Generate the full CLI script source code.
fastmcp_slim/fastmcp/cli/generate.py:403
↓ 18 callersFunctiongenerate_skill_content
Generate a SKILL.md file for a generated CLI script.
fastmcp_slim/fastmcp/cli/generate.py:774
↓ 18 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:238
↓ 18 callersMethodrun
(self, arguments: dict[str, Any])
tests/server/providers/test_base_provider.py:20
↓ 18 callersMethodset_state
Set a value in the state store. By default, values are stored in the state store under `session_id`. They persist across requests on
fastmcp_slim/fastmcp/server/context.py:1148
↓ 18 callersMethodverify_token
Verify a Google OAuth token using the tokeninfo endpoint. Calls ``https://oauth2.googleapis.com/tokeninfo`` with bearer authorization
fastmcp_slim/fastmcp/server/auth/providers/google.py:117
↓ 17 callersMethod_list_tools
(self)
fastmcp_slim/fastmcp/apps/app.py:428
↓ 17 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:107
↓ 17 callersFunction_tool_refs
Every tool name the rendered UI would call, in document order.
tests/server/providers/test_prefab_roundtrip.py:29
↓ 17 callersMethodaclose
(self)
fastmcp_slim/fastmcp/server/auth/oauth_proxy/upstream.py:63
↓ 17 callersMethodclient
Create a test client for the FastMCP server.
tests/contrib/test_component_manager.py:54
↓ 17 callersMethodclose
(self)
fastmcp_slim/fastmcp/client/client.py:1511
↓ 17 callersMethodget_skill
Fetch one skill entry from the named server.
fastmcp_slim/fastmcp/client/group.py:298
↓ 17 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:538
↓ 17 callersFunctionmake_server
( provider: MemorySkillProvider, *, page_size: int | None = None, cached: bool = False, )
tests/skills/test_extension.py:118
↓ 17 callersFunctionrun_command
Run a MCP server or connect to a remote one. Args: server_spec: Python file, object specification (file:obj), config file, or URL
fastmcp_slim/fastmcp/cli/run.py:141
↓ 17 callersMethodto_json
Serialize to JSON for Redis storage.
fastmcp_tasks/fastmcp_tasks/context.py:232
← previousnext →101–200 of 15,974, ranked by callers