MCPcopy Create free account

hub / github.com/PrefectHQ/fastmcp / functions

Functions10,312 in github.com/PrefectHQ/fastmcp

↓ 1,067 callersMethodcall_tool
( self, name: str, arguments: dict[str, Any] | None = None, *, version
fastmcp_slim/fastmcp/server/server.py:1151
↓ 846 callersMethodget
Look up a cached verification result. Returns: ``(True, AccessToken)`` on a cache hit, ``(False, None)`` on a miss or
fastmcp_slim/fastmcp/utilities/token_cache.py:95
↓ 454 callersMethodlist_tools
List all enabled tools from providers. Overrides Provider.list_tools() to add visibility filtering, auth filtering, and middleware ex
fastmcp_slim/fastmcp/server/server.py:623
↓ 416 callersMethodget
(self, url: str)
tests/server/auth/providers/test_scalekit.py:198
↓ 334 callersMethodfrom_function
Create a Tool from a function.
fastmcp_slim/fastmcp/tools/base.py:231
↓ 236 callersMethoddebug
Send a `DEBUG`-level message to the connected MCP Client. Messages sent to Clients are also logged to the `fastmcp.server.context.to_client`
fastmcp_slim/fastmcp/server/context.py:720
↓ 194 callersMethodmount
Mount another FastMCP server on this server with an optional namespace. Unlike importing (with import_server), mounting establishes a dynamic
fastmcp_slim/fastmcp/server/server.py:2073
↓ 174 callersMethodread_resource
(self, uri: str)
tests/utilities/test_skills.py:35
↓ 173 callersMethodadd_transform
Add a server-level transform. Server-level transforms are applied after all providers are aggregated. They transform tools, resources
fastmcp_slim/fastmcp/server/server.py:571
↓ 164 callersMethodlist_resources
List all enabled resources from providers. Overrides Provider.list_resources() to add visibility filtering, auth filtering, and middl
fastmcp_slim/fastmcp/server/server.py:757
↓ 149 callersMethodresult
Wait for and return the task result. Must be implemented by subclasses to return the appropriate result type.
fastmcp_slim/fastmcp/client/tasks.py:203
↓ 146 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
↓ 118 callersMethodadd_middleware
(self, middleware: Middleware)
fastmcp_slim/fastmcp/server/server.py:499
↓ 118 callersMethodlist_prompts
List all enabled prompts from providers. Overrides Provider.list_prompts() to add visibility filtering, auth filtering, and middlewar
fastmcp_slim/fastmcp/server/server.py:1028
↓ 114 callersMethodjson
(self)
tests/server/auth/providers/test_scalekit.py:183
↓ 113 callersMethoddecode
Decode cursor from an opaque string. Raises: ValueError: If the cursor is invalid or malformed.
fastmcp_slim/fastmcp/utilities/pagination.py:31
↓ 110 callersMethodfrom_tool
( cls, tool: Tool | Callable[..., Any], *, name: str | None = None, ti
fastmcp_slim/fastmcp/tools/base.py:424
↓ 107 callersMethoddisable
Disable components matching all specified criteria. Adds a visibility transform that marks matching components as disabled. Component
fastmcp_slim/fastmcp/server/providers/base.py:613
↓ 105 callersFunctionget_logger
Get a logger nested under FastMCP namespace. Args: name: the name of the logger, which will be prefixed with 'FastMCP.' Returns:
fastmcp_slim/fastmcp/utilities/logging.py:14
↓ 104 callersFunctionjson_schema_to_type
Convert JSON schema to appropriate Python type with validation. Args: schema: A JSON Schema dictionary defining the type structure and va
fastmcp_slim/fastmcp/utilities/json_schema_type.py:164
↓ 103 callersFunctioncall_next
( name: str, *, version: VersionSpec | None = None )
tests/cli/test_fastmcp_remote.py:171
↓ 101 callersMethodassert_called
Assert that a hook was called a specific number of times.
tests/server/middleware/test_middleware_nested.py:74
↓ 100 callersMethodget_prompt
Get a prompt by name, filtering disabled prompts. Overrides Provider.get_prompt() to add visibility filtering after all transforms (i
fastmcp_slim/fastmcp/server/server.py:1100
↓ 98 callersMethodread_resource
( self, uri: str, *, version: VersionSpec | None = None, run_middlewar
fastmcp_slim/fastmcp/server/server.py:1315
↓ 95 callersMethodadd_provider
Add a provider for dynamic tools, resources, and prompts. Providers are queried in registration order. The first provider to return a
fastmcp_slim/fastmcp/server/server.py:502
↓ 90 callersMethodrun
(self, arguments: dict[str, Any])
examples/providers/sqlite/server.py:40
↓ 89 callersMethodwait
Wait for task to reach a specific state or complete. Uses event-based waiting when notifications are available (fast), with fallback
fastmcp_slim/fastmcp/client/tasks.py:210
↓ 85 callersMethodrun
(self, arguments: dict[str, Any])
tests/server/test_providers.py:26
↓ 83 callersMethodwarning
Send a `WARNING`-level message to the connected MCP Client. Messages sent to Clients are also logged to the `fastmcp.server.context.to_client
fastmcp_slim/fastmcp/server/context.py:752
↓ 79 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:892
↓ 73 callersMethodcreate_token
Generate a test JWT token using symmetric key for testing purposes. Args: subject: Subject claim (usually user ID)
tests/server/auth/test_jwt_provider.py:28
↓ 71 callersMethoderror
Send a `ERROR`-level message to the connected MCP Client. Messages sent to Clients are also logged to the `fastmcp.server.context.to_client`
fastmcp_slim/fastmcp/server/context.py:768
↓ 65 callersMethodhttp_app
Create a Starlette app using the specified HTTP transport. Args: path: The path for the HTTP endpoint middleware: A l
fastmcp_slim/fastmcp/server/mixins/transport.py:313
↓ 64 callersMethodencode
Encode cursor state to an opaque string.
fastmcp_slim/fastmcp/utilities/pagination.py:25
↓ 64 callersMethodmatches
Check if a version matches this spec. Args: version: The version to check, or None for unversioned. match_none: Wheth
fastmcp_slim/fastmcp/utilities/versions.py:55
↓ 59 callersMethodelicit
( self, message: str, response_type: None, *, response_title: str | No
fastmcp_slim/fastmcp/server/context.py:1023
↓ 57 callersMethodbuild
(self, documents: list[str])
fastmcp_slim/fastmcp/server/transforms/search/bm25.py:36
↓ 57 callersMethodget_tool
Get a tool by name, filtering disabled tools. Overrides Provider.get_tool() to add visibility filtering after all transforms (includi
fastmcp_slim/fastmcp/server/server.py:703
↓ 54 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:147
↓ 52 callersMethodload_access_token
(self, token: str)
tests/server/test_auth_integration.py:172
↓ 51 callersMethodassert_called
Assert that a hook was called a specific number of times.
tests/server/middleware/test_middleware.py:73
↓ 50 callersMethodverify_token
Mock token verification.
tests/server/auth/oauth_proxy/conftest.py:268
↓ 44 callersMethodadd_tool
Add a tool to the server. The tool function can optionally request a Context object by adding a parameter with the Context type annot
fastmcp_slim/fastmcp/server/server.py:1599
↓ 43 callersMethodcopy
Create a copy of the component.
fastmcp_slim/fastmcp/utilities/components.py:223
↓ 42 callersMethodrender_prompt
( self, name: str, arguments: dict[str, Any] | None = None, *, version
fastmcp_slim/fastmcp/server/server.py:1492
↓ 42 callersMethodsample
Overload: With result_type, returns SamplingResult[ResultT].
fastmcp_slim/fastmcp/server/context.py:917
↓ 41 callersMethodread
Read the resource content. Subclasses implement this to return resource data. Supported return types: - str: Text content
fastmcp_slim/fastmcp/resources/base.py:299
↓ 41 callersMethodreset
Reset all state for next test.
tests/server/auth/oauth_proxy/conftest.py:249
↓ 39 callersMethodadd
Add two numbers.
tests/tools/tool/test_tool.py:21
↓ 39 callersFunctioncompress_schema
Compress and optimize a JSON schema for MCP compatibility. Args: schema: The schema to compress prune_params: List of parame
fastmcp_slim/fastmcp/utilities/json_schema.py:645
↓ 38 callersFunctionconvert_openapi_schema_to_json_schema
Convert an OpenAPI schema to JSON Schema format. This is a clean, systematic approach that: 1. Removes OpenAPI-specific fields 2. Co
fastmcp_slim/fastmcp/utilities/openapi/json_schema_converter.py:40
↓ 38 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:736
↓ 37 callersMethodimport_server
Import the MCP objects from another FastMCP server into this one, optionally with a given prefix. .. deprecated::
fastmcp_slim/fastmcp/server/server.py:2179
↓ 37 callersMethodrender
Render the prompt with arguments. Subclasses must implement this method. Return one of: - str: Wrapped as single user Message
fastmcp_slim/fastmcp/prompts/base.py:272
↓ 36 callersFunction_combine_schemas_and_map_params
Combines parameter and request body schemas into a single schema. Handles parameter name collisions by adding location suffixes. Also ret
fastmcp_slim/fastmcp/utilities/openapi/schemas.py:223
↓ 36 callersMethodlist_tools
(self)
examples/providers/sqlite/server.py:78
↓ 36 callersFunctionmake_token
Create a test access token.
tests/server/auth/test_authorization.py:29
↓ 35 callersMethodget_routes
Delegate route creation to the server.
fastmcp_slim/fastmcp/server/auth/auth.py:620
↓ 35 callersMethodregister_client
(self, client_info: OAuthClientInformationFull)
tests/server/test_auth_integration.py:44
↓ 35 callersFunctionrun_auth_checks
Run auth checks with AND logic.
fastmcp_slim/fastmcp/utilities/authorization.py:76
↓ 34 callersFunctionhashed_backend_name
Format the universal name for a backend tool: ``<hash>_<local_name>``.
fastmcp_slim/fastmcp/server/providers/addressing.py:38
↓ 33 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:45
↓ 33 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:271
↓ 32 callersFunction_write_config
(path: Path, data: dict[str, Any])
tests/cli/test_discovery.py:56
↓ 31 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:1291
↓ 31 callersMethodmodel_copy
Override to preserve _backend_name when name changes.
fastmcp_slim/fastmcp/server/providers/proxy.py:139
↓ 31 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:66
↓ 31 callersFunctionrun_server_async
Start a FastMCP server as an asyncio task for in-process async testing. This is the recommended way to test FastMCP servers. It runs the ser
fastmcp_slim/fastmcp/utilities/tests.py:143
↓ 30 callersFunction_make_server_with_tools
()
tests/server/transforms/test_search.py:36
↓ 30 callersFunctionget_access_token
Get the FastMCP access token from the current context. This function first tries to get the token from the current HTTP request's scope, whic
fastmcp_slim/fastmcp/server/dependencies.py:467
↓ 30 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:378
↓ 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:273
↓ 29 callersMethodcancel
Cancel this task, transitioning it to cancelled state. Sends a tasks/cancel protocol request. The server will attempt to halt executi
fastmcp_slim/fastmcp/client/tasks.py:288
↓ 29 callersFunctioncreate_proxy
Create a FastMCP proxy server for the given target. This is the recommended way to create a proxy server. For lower-level control, use `FastM
fastmcp_slim/fastmcp/server/server.py:2436
↓ 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:299
↓ 29 callersMethodenable
Enable components matching all specified criteria. Adds a visibility transform that marks matching components as enabled. Later trans
fastmcp_slim/fastmcp/server/providers/base.py:564
↓ 29 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
↓ 29 callersMethodkey
The globally unique lookup key for this resource.
fastmcp_slim/fastmcp/resources/base.py:428
↓ 29 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:549
↓ 28 callersMethodping
Send a ping request.
fastmcp_slim/fastmcp/client/client.py:804
↓ 28 callersMethodstatus
Get current task status. If server executed immediately, returns synthetic completed status. Otherwise queries the server for current
fastmcp_slim/fastmcp/client/tasks.py:172
↓ 28 callersFunctiontemporary_settings
Temporarily override FastMCP setting values. Args: **kwargs: The settings to override, including nested settings. Example:
fastmcp_slim/fastmcp/utilities/tests.py:24
↓ 28 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:168
↓ 27 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:119
↓ 27 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:211
↓ 26 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
↓ 26 callersMethodgenerate
Generate an RSA key pair for testing. Returns: RSAKeyPair: Generated key pair
fastmcp_slim/fastmcp/server/auth/providers/jwt.py:93
↓ 26 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:1249
↓ 25 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:111
↓ 25 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
↓ 24 callersMethodas_proxy
Create a FastMCP proxy server for the given backend. .. deprecated:: Use :func:`fastmcp.server.create_proxy` instead.
fastmcp_slim/fastmcp/server/server.py:2385
↓ 24 callersMethodcount
()
tests/server/versioning/test_mounting.py:23
↓ 24 callersMethodfrom_function
Create a SamplingTool from a function. The function's signature is analyzed to generate a JSON schema for the tool's parameters. Type
fastmcp_slim/fastmcp/server/sampling/sampling_tool.py:84
↓ 24 callersMethodget_client
(self, client_id: str)
tests/server/test_auth_integration.py:41
↓ 23 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:711
↓ 23 callersFunctionmake_tool
Create a mock tool for testing.
tests/server/auth/test_authorization.py:40
↓ 23 callersFunctionrequire_scopes
Require all of the given OAuth scopes.
fastmcp_slim/fastmcp/utilities/authorization.py:50
↓ 23 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
↓ 23 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
↓ 22 callersFunction_parse_tool_result
Extract tool list from a ToolResult's structured content.
tests/server/transforms/test_search.py:30
next →1–100 of 10,312, ranked by callers