fastmcp API reference
400 public APIs from fastmcp (PrefectHQ/fastmcp) — 152 classes, 97 functions, 151 methods. Signatures extracted by static analysis of the actual source.
Repository: PrefectHQ/fastmcp
| Kind | Count |
|---|---|
| Classes | 152 |
| Functions | 97 |
| Methods | 151 |
API list
class
fastmcp_slim.fastmcp._warnings.FastMCPDeprecationWarningDeprecation warning for FastMCP APIs.
class
fastmcp_slim.fastmcp.apps.app.FastMCPAppA Provider that represents an MCP application.
method
fastmcp_slim.fastmcp.apps.app.FastMCPApp.add_tool(tool:Tool | Callable[..., Any]) -> ToolAdd a tool to this app programmatically.
func
fastmcp_slim.fastmcp.apps.choice.Choice.choose(prompt:str, options:list[str], title:str | None=None) -> PrefabAppPresent the user with a set of options to choose from.
class
fastmcp_slim.fastmcp.apps.config.AppConfigConfiguration for MCP App tools and resources.
class
fastmcp_slim.fastmcp.apps.config.ResourceCSPContent Security Policy for MCP App resources.
class
fastmcp_slim.fastmcp.apps.config.ResourcePermissionsIframe sandbox permissions for MCP App resources.
func
fastmcp_slim.fastmcp.apps.file_upload.FileUpload.file_manager(ctx:Context) -> PrefabAppUpload and manage files.
func
fastmcp_slim.fastmcp.apps.file_upload.FileUpload.list_files(ctx:Context) -> list[dict]List all uploaded files with metadata.
method
fastmcp_slim.fastmcp.apps.file_upload.FileUpload.on_list(ctx:Context) -> list[dict[str, Any]]List all stored files.
method
fastmcp_slim.fastmcp.apps.file_upload.FileUpload.on_read(name:str, ctx:Context) -> dict[str, Any]Read a file's contents by name.
method
fastmcp_slim.fastmcp.apps.file_upload.FileUpload.on_store(files:list[dict[str, Any]], ctx:Context) -> list[dict[str, Any]]Store uploaded files and return summaries.
func
fastmcp_slim.fastmcp.apps.file_upload.FileUpload.read_file(name:str, ctx:Context) -> dictRead an uploaded file's contents by name.
func
fastmcp_slim.fastmcp.apps.file_upload.FileUpload.store_files(files:list[dict], ctx:Context) -> list[dict]Store uploaded files.
func
fastmcp_slim.fastmcp.apps.form.FormInput.collect_input(prompt:str, title:str | None=None, submit_text:str | None=None, default:dict[str, Any] | None=None) -> PrefabAppCollect structured input from the user.
func
fastmcp_slim.fastmcp.apps.form.FormInput.submit_form(data:dict[str, Any] | None=None) -> strValidate and process form submission.
func
fastmcp_slim.fastmcp.cli.apps_dev.api_logs(request:Request) -> ResponseReturn message log entries since a given id.
func
fastmcp_slim.fastmcp.cli.apps_dev.api_logs_clear(request:Request) -> ResponseClear the message log.
func
fastmcp_slim.fastmcp.cli.apps_dev.launch(request:Request) -> HTMLResponseHost page: GET /launch?tool=name&args={...}
func
fastmcp_slim.fastmcp.cli.apps_dev.picker_app(request:Request) -> HTMLResponsePrefab picker UI — tool list with one tab per UI tool.
func
fastmcp_slim.fastmcp.cli.apps_dev.serve_app_bridge_js(request:Request) -> ResponseServe the locally patched app-bridge.js.
func
fastmcp_slim.fastmcp.cli.apps_dev.ui_resource(request:Request) -> ResponseFetch an MCP resource server-side and return it as HTML.
func
fastmcp_slim.fastmcp.cli.cli.with_argv(args:list[str] | None)Temporarily replace sys.argv if args provided.
func
fastmcp_slim.fastmcp.cli.client.coerce_value(raw:str, schema:dict[str, Any]) -> AnyCoerce a string CLI value according to a JSON-Schema type hint.
method
fastmcp_slim.fastmcp.cli.discovery.DiscoveredServer.qualified_name() -> strFully qualified ``source:name`` identifier.
func
fastmcp_slim.fastmcp.cli.discovery.discover_servers(start_dir:Path | None=None) -> list[DiscoveredServer]Run all scanners and return the combined results.
func
fastmcp_slim.fastmcp.cli.generate.generate_cli_script(server_name:str, server_spec:str, transport_code:str, extra_imports:set[str], tools:list[mcp_types.Tool]) -> strGenerate the full CLI script source code.
func
fastmcp_slim.fastmcp.cli.install.claude_code.check_claude_code_available() -> boolCheck if Claude Code CLI is available.
func
fastmcp_slim.fastmcp.cli.install.claude_code.find_claude_command() -> str | NoneFind the Claude Code CLI command.
func
fastmcp_slim.fastmcp.cli.install.claude_desktop.get_claude_config_path(config_path:Path | None=None) -> Path | NoneGet the Claude config directory based on platform.
func
fastmcp_slim.fastmcp.cli.install.gemini_cli.check_gemini_cli_available() -> boolCheck if Gemini CLI is available.
func
fastmcp_slim.fastmcp.cli.install.gemini_cli.find_gemini_command() -> str | NoneFind the Gemini CLI command.
func
fastmcp_slim.fastmcp.cli.install.shared.parse_env_var(env_var:str) -> tuple[str, str]Parse environment variable string in format KEY=VALUE.
func
fastmcp_slim.fastmcp.cli.run.create_client_server(url:str) -> AnyCreate a FastMCP server from a client URL.
func
fastmcp_slim.fastmcp.cli.run.create_mcp_config_server(mcp_config_path:Path) -> FastMCP[None]Create a FastMCP server from a MCPConfig.
func
fastmcp_slim.fastmcp.cli.run.is_url(path:str) -> boolCheck if a string is a URL.
func
fastmcp_slim.fastmcp.cli.run.load_mcp_server_config(config_path:Path) -> MCPServerConfigLoad a FastMCP configuration from a fastmcp.json file.
func
fastmcp_slim.fastmcp.cli.run.run_v1_server_async(server:SDKServer, host:str | None=None, port:int | None=None, transport:TransportType | None=None) -> NoneRun a FastMCP 1.x server using async methods.
func
fastmcp_slim.fastmcp.cli.run.run_with_reload(cmd:list[str], reload_dirs:list[Path] | None=None, is_stdio:bool=False) -> NoneRun a command with file watching and auto-reload.
class
fastmcp_slim.fastmcp.client.client.CallToolResultParsed result from a tool call.
method
fastmcp_slim.fastmcp.client.client.Client.cancel(request_id:str | int, reason:str | None=None) -> NoneSend a cancellation notification for an in-progress request.
method
fastmcp_slim.fastmcp.client.client.Client.initialize(timeout:datetime.timedelta | float | int | None=None) -> mcp_types.InitializeResultSend an initialize request to the server.
method
fastmcp_slim.fastmcp.client.client.Client.is_connected() -> boolCheck if the client is currently connected.
method
fastmcp_slim.fastmcp.client.client.Client.ping() -> boolSend a ping request.
method
fastmcp_slim.fastmcp.client.client.Client.progress(progress_token:str | int, progress:float, total:float | None=None, message:str | None=None) -> NoneSend a progress notification.
method
fastmcp_slim.fastmcp.client.client.Client.send_roots_list_changed() -> NoneSend a roots/list_changed notification.
method
fastmcp_slim.fastmcp.client.client.Client.session() -> ClientSessionGet the current active session.
method
fastmcp_slim.fastmcp.client.client.Client.set_elicitation_callback(elicitation_callback:ElicitationHandler) -> NoneSet the elicitation callback for the client.
method
fastmcp_slim.fastmcp.client.client.Client.set_logging_level(level:mcp_types.LoggingLevel) -> NoneSend a logging/setLevel request.
method
fastmcp_slim.fastmcp.client.client.Client.set_roots(roots:RootsList | RootsHandler) -> NoneSet the roots for the client.
class
fastmcp_slim.fastmcp.client.mixins.prompts.ClientPromptsMixinMixin providing prompt-related methods for Client.
class
fastmcp_slim.fastmcp.client.mixins.tools.ClientToolsMixinMixin providing tool-related methods for Client.
method
fastmcp_slim.fastmcp.client.mixins.tools.ClientToolsMixin.list_tools(max_pages:int=AUTO_PAGINATION_MAX_PAGES) -> list[mcp_types.Tool]Retrieve all tools available on the server.
func
fastmcp_slim.fastmcp.client.progress.default_progress_handler(progress:float, total:float | None, message:str | None) -> NoneDefault handler for progress notifications.
class
fastmcp_slim.fastmcp.client.sampling.handlers.openai.OpenAISamplingHandlerSampling handler that uses the OpenAI API.
class
fastmcp_slim.fastmcp.client.transports.base.TransportOptionsHow one client wants its connection built.
class
fastmcp_slim.fastmcp.client.transports.memory.FastMCPTransportIn-memory transport for FastMCP servers.
class
fastmcp_slim.fastmcp.client.transports.stdio.NodeStdioTransportTransport for running Node.js scripts.
class
fastmcp_slim.fastmcp.client.transports.stdio.NpxStdioTransportTransport for running commands via the npx tool.
class
fastmcp_slim.fastmcp.client.transports.stdio.PythonStdioTransportTransport for running Python scripts.
class
fastmcp_slim.fastmcp.client.transports.stdio.UvStdioTransportTransport for running commands via the uv tool.
class
fastmcp_slim.fastmcp.client.transports.stdio.UvxStdioTransportTransport for running commands via the uvx tool.
func
fastmcp_slim.fastmcp.contrib.bulk_tool_caller.example.echo_tool(text:str) -> strEcho the input text
func
fastmcp_slim.fastmcp.contrib.component_manager.example.get_greeting() -> strProvides a simple greeting message.
func
fastmcp_slim.fastmcp.contrib.component_manager.example.get_info() -> strProvides a simple info.
method
fastmcp_slim.fastmcp.contrib.mcp_mixin.example.Sample.first_prompt()First prompt description.
method
fastmcp_slim.fastmcp.contrib.mcp_mixin.example.Sample.first_resource()First resource description.
method
fastmcp_slim.fastmcp.contrib.mcp_mixin.example.Sample.first_tool()First tool description.
class
fastmcp_slim.fastmcp.decorators.HasFastMCPMetaProtocol for callables decorated with FastMCP metadata.
func
fastmcp_slim.fastmcp.decorators.resolve_task_config(task:bool | TaskConfig | None) -> bool | TaskConfigResolve task config, defaulting None to False.
class
fastmcp_slim.fastmcp.exceptions.AuthorizationErrorError when authorization check fails.
class
fastmcp_slim.fastmcp.exceptions.ClientErrorError in client operations.
class
fastmcp_slim.fastmcp.exceptions.DisabledErrorObject is disabled.
class
fastmcp_slim.fastmcp.exceptions.FastMCPErrorBase error for FastMCP.
class
fastmcp_slim.fastmcp.exceptions.InvalidSignatureInvalid signature for use with FastMCP.
class
fastmcp_slim.fastmcp.exceptions.MCPErrorFallback used when MCP dependencies are not installed.
class
fastmcp_slim.fastmcp.exceptions.NotFoundErrorObject not found.
class
fastmcp_slim.fastmcp.exceptions.PromptErrorError in prompt operations.
class
fastmcp_slim.fastmcp.exceptions.ResourceErrorError in resource operations.
class
fastmcp_slim.fastmcp.exceptions.ToolErrorError in tool operations.
class
fastmcp_slim.fastmcp.exceptions.ValidationErrorError in validating parameters or return values.
class
fastmcp_slim.fastmcp.experimental.transforms.code_mode.MontySandboxProviderSandbox provider backed by `pydantic-monty`.
class
fastmcp_slim.fastmcp.mcp_config.CanonicalMCPConfigCanonical MCP configuration format.
method
fastmcp_slim.fastmcp.mcp_config.CanonicalMCPConfig.add_server(name:str, server:CanonicalMCPServerTypes) -> NoneAdd or update a server in the configuration.
method
fastmcp_slim.fastmcp.mcp_config.MCPConfig.add_server(name:str, server:MCPServerTypes) -> NoneAdd or update a server in the configuration.
method
fastmcp_slim.fastmcp.mcp_config.MCPConfig.from_dict(config:dict[str, Any]) -> SelfParse MCP configuration from dictionary format.
method
fastmcp_slim.fastmcp.mcp_config.MCPConfig.from_file(file_path:Path) -> SelfLoad configuration from JSON file.
method
fastmcp_slim.fastmcp.mcp_config.MCPConfig.write_to_file(file_path:Path) -> NoneWrite configuration to JSON file.
class
fastmcp_slim.fastmcp.mcp_config.RemoteMCPServerMCP server configuration for HTTP/SSE transport.
class
fastmcp_slim.fastmcp.mcp_config.StdioMCPServerMCP server configuration for stdio transport.
class
fastmcp_slim.fastmcp.mcp_config.TransformingRemoteMCPServerA Remote server with tool transforms.
class
fastmcp_slim.fastmcp.mcp_config.TransformingStdioMCPServerA Stdio server with tool transforms.
func
fastmcp_slim.fastmcp.mcp_config.infer_transport_type_from_url(url:str | AnyUrl) -> Literal['http', 'sse']Infer the appropriate transport type from the given URL.
class
fastmcp_slim.fastmcp.prompts.base.MessageWrapper for prompt message with auto-serialization.
method
fastmcp_slim.fastmcp.prompts.base.Message.to_mcp_prompt_message() -> PromptMessageConvert to MCP PromptMessage.
class
fastmcp_slim.fastmcp.prompts.base.PromptA prompt template that can be rendered with parameters.
method
fastmcp_slim.fastmcp.prompts.base.Prompt.convert_result(raw_value:Any) -> PromptResultConvert a raw return value to PromptResult.
method
fastmcp_slim.fastmcp.prompts.base.Prompt.render(arguments:dict[str, Any] | None=None) -> str | list[Message | str] | PromptResultRender the prompt with arguments.
method
fastmcp_slim.fastmcp.prompts.base.Prompt.to_mcp_prompt(**overrides:Any) -> SDKPromptConvert the prompt to an MCP prompt.
class
fastmcp_slim.fastmcp.prompts.base.PromptArgumentAn argument that can be passed to a prompt.
class
fastmcp_slim.fastmcp.prompts.base.PromptResultCanonical result type for prompt rendering.
method
fastmcp_slim.fastmcp.prompts.base.PromptResult.to_mcp_prompt_result() -> GetPromptResultConvert to MCP GetPromptResult.
class
fastmcp_slim.fastmcp.prompts.function_prompt.DecoratedPromptProtocol for functions decorated with @prompt.
class
fastmcp_slim.fastmcp.prompts.function_prompt.FunctionPromptA prompt that is a function.
method
fastmcp_slim.fastmcp.prompts.function_prompt.FunctionPrompt.render(arguments:dict[str, Any] | None=None) -> PromptResultRender the prompt with arguments.
class
fastmcp_slim.fastmcp.resources.base.ResourceBase class for all resources.
method
fastmcp_slim.fastmcp.resources.base.Resource.convert_result(raw_value:Any) -> ResourceResultConvert a raw result to ResourceResult.
method
fastmcp_slim.fastmcp.resources.base.Resource.key() -> strThe globally unique lookup key for this resource.
method
fastmcp_slim.fastmcp.resources.base.Resource.read() -> str | bytes | ResourceResultRead the resource content.
method
fastmcp_slim.fastmcp.resources.base.Resource.set_default_mime_type(mime_type:str | None) -> strSet default MIME type if not provided.
method
fastmcp_slim.fastmcp.resources.base.Resource.set_default_name() -> SelfSet default name from URI if not provided.
method
fastmcp_slim.fastmcp.resources.base.Resource.to_mcp_resource(**overrides:Any) -> SDKResourceConvert the resource to an SDKResource.
method
fastmcp_slim.fastmcp.resources.base.ResourceContent.to_mcp_resource_contents(uri:AnyUrl | str) -> mcp_types.TextResourceContents | mcp_types.BlobResourceContentsConvert to MCP resource contents type.
class
fastmcp_slim.fastmcp.resources.base.ResourceResultCanonical result type for resource reads.
method
fastmcp_slim.fastmcp.resources.base.ResourceResult.to_mcp_result(uri:AnyUrl | str) -> mcp_types.ReadResourceResultConvert to MCP ReadResourceResult.
class
fastmcp_slim.fastmcp.resources.function_resource.DecoratedResourceProtocol for functions decorated with @resource.
class
fastmcp_slim.fastmcp.resources.template.FunctionResourceTemplateA template for dynamically creating resources.
method
fastmcp_slim.fastmcp.resources.template.FunctionResourceTemplate.read(arguments:dict[str, Any]) -> str | bytes | ResourceResultRead the resource content.
class
fastmcp_slim.fastmcp.resources.template.ResourceTemplateA template for dynamically creating resources.
method
fastmcp_slim.fastmcp.resources.template.ResourceTemplate.convert_result(raw_value:Any) -> ResourceResultConvert a raw result to ResourceResult.
method
fastmcp_slim.fastmcp.resources.template.ResourceTemplate.key() -> strThe globally unique lookup key for this template.
method
fastmcp_slim.fastmcp.resources.template.ResourceTemplate.matches(uri:str) -> dict[str, Any] | NoneCheck if URI matches template and extract parameters.
method
fastmcp_slim.fastmcp.resources.template.ResourceTemplate.read(arguments:dict[str, Any]) -> str | bytes | ResourceResultRead the resource content.
method
fastmcp_slim.fastmcp.resources.template.ResourceTemplate.set_default_mime_type(mime_type:str | None) -> strSet default MIME type if not provided.
class
fastmcp_slim.fastmcp.resources.types.BinaryResourceA resource that reads from bytes.
method
fastmcp_slim.fastmcp.resources.types.BinaryResource.read() -> ResourceResultRead the binary content.
class
fastmcp_slim.fastmcp.resources.types.DirectoryResourceA resource that lists files in a directory.
method
fastmcp_slim.fastmcp.resources.types.DirectoryResource.list_files() -> list[Path]List files in the directory.
method
fastmcp_slim.fastmcp.resources.types.DirectoryResource.read() -> ResourceResultRead the directory listing.
method
fastmcp_slim.fastmcp.resources.types.DirectoryResource.validate_absolute_path(path:Path) -> PathEnsure path is absolute.
class
fastmcp_slim.fastmcp.resources.types.FileResourceA resource that reads from a file.
method
fastmcp_slim.fastmcp.resources.types.FileResource.read() -> ResourceResultRead the file content.
method
fastmcp_slim.fastmcp.resources.types.FileResource.validate_absolute_path(path:Path) -> PathEnsure path is absolute.
class
fastmcp_slim.fastmcp.resources.types.HttpResourceA resource that reads from an HTTP endpoint.
method
fastmcp_slim.fastmcp.resources.types.HttpResource.read() -> ResourceResultRead the HTTP content.
class
fastmcp_slim.fastmcp.resources.types.TextResourceA resource that reads from a string.
method
fastmcp_slim.fastmcp.resources.types.TextResource.read() -> ResourceResultRead the text content.
class
fastmcp_slim.fastmcp.server.auth.auth.AccessTokenAccessToken that includes all JWT claims.
class
fastmcp_slim.fastmcp.server.auth.auth.AuthProviderBase class for all FastMCP authentication providers.
method
fastmcp_slim.fastmcp.server.auth.auth.AuthProvider.get_routes(mcp_path:str | None=None) -> list[Route]Get all routes for this authentication provider.
method
fastmcp_slim.fastmcp.server.auth.auth.AuthProvider.set_mcp_path(mcp_path:str | None) -> NoneSet the MCP endpoint path and compute resource URL.
method
fastmcp_slim.fastmcp.server.auth.auth.AuthProvider.verify_token(token:str) -> AccessToken | NoneVerify a bearer token and return access info if valid.
class
fastmcp_slim.fastmcp.server.auth.auth.OAuthProviderOAuth Authorization Server provider.
method
fastmcp_slim.fastmcp.server.auth.auth.OAuthProvider.verify_token(token:str) -> AccessToken | NoneVerify a bearer token and return access info if valid.
class
fastmcp_slim.fastmcp.server.auth.auth.TokenVerifierBase class for token verifiers (Resource Servers).
method
fastmcp_slim.fastmcp.server.auth.auth.TokenVerifier.verify_token(token:str) -> AccessToken | NoneVerify a bearer token and return access info if valid.
class
fastmcp_slim.fastmcp.server.auth.cimd.CIMDClientManagerManages all CIMD client operations for OAuth proxy.
method
fastmcp_slim.fastmcp.server.auth.cimd.CIMDClientManager.is_cimd_client_id(client_id:str) -> boolCheck if client_id is a CIMD URL.
class
fastmcp_slim.fastmcp.server.auth.cimd.CIMDFetchErrorRaised when CIMD document fetching fails.
class
fastmcp_slim.fastmcp.server.auth.cimd.CIMDFetcherFetch and validate CIMD documents with SSRF protection.
method
fastmcp_slim.fastmcp.server.auth.cimd.CIMDFetcher.fetch(client_id_url:str) -> CIMDDocumentFetch and validate a CIMD document with SSRF protection.
method
fastmcp_slim.fastmcp.server.auth.cimd.CIMDFetcher.is_cimd_client_id(client_id:str) -> boolCheck if a client_id looks like a CIMD URL.
class
fastmcp_slim.fastmcp.server.auth.cimd.CIMDValidationErrorRaised when CIMD document validation fails.
class
fastmcp_slim.fastmcp.server.auth.identity_assertion.IdentityAssertionErrorRaised when an ID-JAG fails validation.
func
fastmcp_slim.fastmcp.server.auth.identity_assertion.server_url_has_query(url:str) -> boolCheck if a URL has query parameters.
class
fastmcp_slim.fastmcp.server.auth.oauth_proxy.models.JTIMappingMaps FastMCP token JTI to upstream token ID.
class
fastmcp_slim.fastmcp.server.auth.oauth_proxy.models.OAuthTransactionOAuth transaction state for consent flow.
class
fastmcp_slim.fastmcp.server.auth.oidc_proxy.OIDCConfigurationOIDC Configuration.
class
fastmcp_slim.fastmcp.server.auth.providers.auth0.Auth0JWTVerifierJWT verifier for Auth0 MCP access tokens.
class
fastmcp_slim.fastmcp.server.auth.providers.auth0.Auth0ProviderAn Auth0 provider implementation for FastMCP.
class
fastmcp_slim.fastmcp.server.auth.providers.aws.AWSCognitoProviderComplete AWS Cognito OAuth provider for FastMCP.
class
fastmcp_slim.fastmcp.server.auth.providers.aws.AWSCognitoTokenVerifierToken verifier for Cognito access tokens.
method
fastmcp_slim.fastmcp.server.auth.providers.azure.AzureProvider.close_obo_credentials() -> NoneClose all cached OBO credentials.
class
fastmcp_slim.fastmcp.server.auth.providers.clerk.ClerkProviderComplete Clerk OAuth provider for FastMCP.
class
fastmcp_slim.fastmcp.server.auth.providers.clerk.ClerkTokenVerifierToken verifier for Clerk OAuth tokens.
class
fastmcp_slim.fastmcp.server.auth.providers.debug.DebugTokenVerifierToken verifier with custom validation logic.
method
fastmcp_slim.fastmcp.server.auth.providers.debug.DebugTokenVerifier.verify_token(token:str) -> AccessToken | NoneVerify token using custom validation logic.
class
fastmcp_slim.fastmcp.server.auth.providers.discord.DiscordProviderComplete Discord OAuth provider for FastMCP.
class
fastmcp_slim.fastmcp.server.auth.providers.discord.DiscordTokenVerifierToken verifier for Discord OAuth tokens.
class
fastmcp_slim.fastmcp.server.auth.providers.github.GitHubProviderComplete GitHub OAuth provider for FastMCP.
class
fastmcp_slim.fastmcp.server.auth.providers.github.GitHubTokenVerifierToken verifier for GitHub OAuth tokens.
method
fastmcp_slim.fastmcp.server.auth.providers.github.GitHubTokenVerifier.verify_token(token:str) -> AccessToken | NoneVerify GitHub OAuth token by calling GitHub API.
class
fastmcp_slim.fastmcp.server.auth.providers.google.GoogleProviderComplete Google OAuth provider for FastMCP.
class
fastmcp_slim.fastmcp.server.auth.providers.google.GoogleTokenVerifierToken verifier for Google OAuth tokens.
class
fastmcp_slim.fastmcp.server.auth.providers.jwt.JWKDataJSON Web Key data structure.
class
fastmcp_slim.fastmcp.server.auth.providers.jwt.JWKSDataJSON Web Key Set data structure.
class
fastmcp_slim.fastmcp.server.auth.providers.jwt.RSAKeyPairRSA key pair for JWT testing.
method
fastmcp_slim.fastmcp.server.auth.providers.jwt.RSAKeyPair.generate() -> RSAKeyPairGenerate an RSA key pair for testing.
class
fastmcp_slim.fastmcp.server.auth.providers.workos.WorkOSProviderComplete WorkOS OAuth provider for FastMCP.
class
fastmcp_slim.fastmcp.server.auth.providers.workos.WorkOSTokenVerifierToken verifier for WorkOS OAuth tokens.
func
fastmcp_slim.fastmcp.server.auth.redirect_validation.is_loopback_host(host:str | None) -> boolCheck if a host is a loopback address.
class
fastmcp_slim.fastmcp.server.auth.ssrf.SSRFErrorRaised when an SSRF protection check fails.
class
fastmcp_slim.fastmcp.server.auth.ssrf.SSRFFetchErrorRaised when SSRF-safe fetch fails.
class
fastmcp_slim.fastmcp.server.auth.ssrf.SSRFFetchResponseResponse payload from an SSRF-safe fetch.
func
fastmcp_slim.fastmcp.server.auth.ssrf.format_ip_for_url(ip_str:str) -> strFormat IP address for use in URL (bracket IPv6 addresses).
func
fastmcp_slim.fastmcp.server.auth.ssrf.resolve_hostname(hostname:str, port:int=443) -> list[str]Resolve hostname to IP addresses using DNS.
func
fastmcp_slim.fastmcp.server.auth.ssrf.validate_url(url:str, require_path:bool=False) -> ValidatedURLValidate URL for SSRF and resolve to IPs.
class
fastmcp_slim.fastmcp.server.context.ContextContext object providing access to MCP capabilities.
method
fastmcp_slim.fastmcp.server.context.Context.client_id() -> str | NoneGet the client ID if available.
method
fastmcp_slim.fastmcp.server.context.Context.debug(message:str, logger_name:str | None=None, extra:Mapping[str, Any] | None=None) -> NoneSend a `DEBUG`-level message to the connected MCP Client.
method
fastmcp_slim.fastmcp.server.context.Context.delete_state(key:str) -> NoneDelete a value from the state store.
method
fastmcp_slim.fastmcp.server.context.Context.error(message:str, logger_name:str | None=None, extra:Mapping[str, Any] | None=None) -> NoneSend a `ERROR`-level message to the connected MCP Client.
method
fastmcp_slim.fastmcp.server.context.Context.fastmcp() -> FastMCPGet the FastMCP instance.
method
fastmcp_slim.fastmcp.server.context.Context.get_prompt(name:str, arguments:dict[str, Any] | None=None) -> GetPromptResultGet a prompt by name with optional arguments.
method
fastmcp_slim.fastmcp.server.context.Context.get_state(key:str) -> AnyGet a value from the state store.
method
fastmcp_slim.fastmcp.server.context.Context.info(message:str, logger_name:str | None=None, extra:Mapping[str, Any] | None=None) -> NoneSend a `INFO`-level message to the connected MCP Client.
method
fastmcp_slim.fastmcp.server.context.Context.lifespan_context() -> dict[str, Any]Access the server's lifespan context.
method
fastmcp_slim.fastmcp.server.context.Context.list_prompts() -> list[SDKPrompt]List all available prompts from the server.
method
fastmcp_slim.fastmcp.server.context.Context.list_resources() -> list[SDKResource]List all available resources from the server.
method
fastmcp_slim.fastmcp.server.context.Context.log(message:str, level:LoggingLevel | None=None, logger_name:str | None=None, extra:Mapping[str, Any] | None=None) -> NoneSend a log message to the client.
method
fastmcp_slim.fastmcp.server.context.Context.read_resource(uri:str | AnyUrl) -> ResourceResultRead a resource by URI.
method
fastmcp_slim.fastmcp.server.context.Context.report_progress(progress:float, total:float | None=None, message:str | None=None) -> NoneReport progress for the current operation.
method
fastmcp_slim.fastmcp.server.context.Context.request_context() -> FastMCPRequestContext | NoneAccess to the underlying request context.
method
fastmcp_slim.fastmcp.server.context.Context.request_id() -> strGet the unique ID for this request.
method
fastmcp_slim.fastmcp.server.context.Context.reset_visibility() -> NoneClear all session visibility rules.
method
fastmcp_slim.fastmcp.server.context.Context.send_notification(notification:mcp_types.ServerNotification) -> NoneSend a notification to the client immediately.
method
fastmcp_slim.fastmcp.server.context.Context.session_id() -> strGet the MCP session ID for ALL transports.
method
fastmcp_slim.fastmcp.server.context.Context.set_state(key:str, value:Any, *serializable:bool=True) -> NoneSet a value in the state store.
method
fastmcp_slim.fastmcp.server.context.Context.transport() -> TransportType | NoneGet the current transport type.
method
fastmcp_slim.fastmcp.server.context.Context.warning(message:str, logger_name:str | None=None, extra:Mapping[str, Any] | None=None) -> NoneSend a `WARNING`-level message to the connected MCP Client.
class
fastmcp_slim.fastmcp.server.context.LogDataData object for passing log arguments to client-side handlers.
func
fastmcp_slim.fastmcp.server.context.reset_transport(token:Token[TransportType | None]) -> NoneReset transport to previous value.
func
fastmcp_slim.fastmcp.server.context.set_transport(transport:TransportType) -> Token[TransportType | None]Set the current transport type.
func
fastmcp_slim.fastmcp.server.dependencies.CurrentContext() -> ContextGet the current FastMCP Context instance.
func
fastmcp_slim.fastmcp.server.dependencies.CurrentFastMCP() -> FastMCPGet the current FastMCP server instance.
func
fastmcp_slim.fastmcp.server.dependencies.CurrentHeaders() -> dict[str, str]Get the current HTTP request headers.
func
fastmcp_slim.fastmcp.server.dependencies.CurrentRequest() -> RequestGet the current HTTP request.
method
fastmcp_slim.fastmcp.server.dependencies.Progress.current() -> int | NoneCurrent progress value.
method
fastmcp_slim.fastmcp.server.dependencies.Progress.increment(amount:int=1) -> NoneAtomically increment the current progress value.
method
fastmcp_slim.fastmcp.server.dependencies.Progress.message() -> str | NoneCurrent progress message.
method
fastmcp_slim.fastmcp.server.dependencies.Progress.set_message(message:str | None) -> NoneUpdate the progress status message.
method
fastmcp_slim.fastmcp.server.dependencies.Progress.set_total(total:int) -> NoneSet the total/target value for progress tracking.
method
fastmcp_slim.fastmcp.server.dependencies.Progress.total() -> intTotal/target progress value.
class
fastmcp_slim.fastmcp.server.dependencies.ProgressLikeProtocol for progress tracking interface.
method
fastmcp_slim.fastmcp.server.dependencies.ProgressLike.current() -> int | NoneCurrent progress value.
method
fastmcp_slim.fastmcp.server.dependencies.ProgressLike.increment(amount:int=1) -> NoneAtomically increment the current progress value.
method
fastmcp_slim.fastmcp.server.dependencies.ProgressLike.message() -> str | NoneCurrent progress message.
method
fastmcp_slim.fastmcp.server.dependencies.ProgressLike.set_message(message:str | None) -> NoneUpdate the progress status message.
method
fastmcp_slim.fastmcp.server.dependencies.ProgressLike.set_total(total:int) -> NoneSet the total/target value for progress tracking.
method
fastmcp_slim.fastmcp.server.dependencies.ProgressLike.total() -> intTotal/target progress value.
func
fastmcp_slim.fastmcp.server.dependencies.TokenClaim(name:str) -> strGet a specific claim from the access token.
func
fastmcp_slim.fastmcp.server.dependencies.get_context() -> ContextGet the current FastMCP Context instance directly.
func
fastmcp_slim.fastmcp.server.dependencies.get_http_request() -> RequestGet the current HTTP request.
func
fastmcp_slim.fastmcp.server.dependencies.get_server() -> FastMCPGet the current FastMCP server instance directly.
func
fastmcp_slim.fastmcp.server.dependencies.get_session(session_id:str) -> SessionResolve and validate a `Session` for an explicit `session_id`.
class
fastmcp_slim.fastmcp.server.elicitation.AcceptedElicitationResult when user accepts the elicitation.
class
fastmcp_slim.fastmcp.server.elicitation.ElicitConfigConfiguration for an elicitation request.
func
fastmcp_slim.fastmcp.server.elicitation.get_elicitation_schema(response_type:type[T]) -> dict[str, Any]Get the schema for an elicitation response.
func
fastmcp_slim.fastmcp.server.elicitation.handle_elicit_accept(config:ElicitConfig, content:Any) -> AcceptedElicitation[Any]Handle an accepted elicitation response.
class
fastmcp_slim.fastmcp.server.event_store.EventEntryStored event entry.
class
fastmcp_slim.fastmcp.server.event_store.EventStoreEventStore implementation backed by AsyncKeyValue.
method
fastmcp_slim.fastmcp.server.event_store.EventStore.store_event(stream_id:StreamId, message:JSONRPCMessage | None) -> EventIdStore an event and return its ID.
class
fastmcp_slim.fastmcp.server.event_store.StreamEventListList of event IDs for a stream.
class
fastmcp_slim.fastmcp.server.extensions.MethodBindingA new request method an extension serves, e.g.
class
fastmcp_slim.fastmcp.server.lifespan.ComposedLifespanTwo lifespans composed together.
class
fastmcp_slim.fastmcp.server.lifespan.LifespanComposable lifespan wrapper.
func
fastmcp_slim.fastmcp.server.lifespan.lifespan(fn:LifespanFn) -> LifespanDecorator to create a composable lifespan.
class
fastmcp_slim.fastmcp.server.middleware.caching.CacheableMessageA wrapper for Message that can be cached.
class
fastmcp_slim.fastmcp.server.middleware.caching.CacheablePromptResultA wrapper for PromptResult that can be cached.
class
fastmcp_slim.fastmcp.server.middleware.caching.CacheableResourceResultA wrapper for ResourceResult that can be cached.
class
fastmcp_slim.fastmcp.server.middleware.caching.CallToolSettingsConfiguration options for Tool-related caching.
class
fastmcp_slim.fastmcp.server.middleware.caching.GetPromptSettingsConfiguration options for Prompt-related caching.
class
fastmcp_slim.fastmcp.server.middleware.caching.ListPromptsSettingsConfiguration options for Prompt-related caching.
class
fastmcp_slim.fastmcp.server.middleware.caching.ListToolsSettingsConfiguration options for Tool-related caching.
class
fastmcp_slim.fastmcp.server.middleware.caching.SharedMethodSettingsShared config for a cache method.
class
fastmcp_slim.fastmcp.server.middleware.logging.BaseLoggingMiddlewareBase class for logging middleware.
method
fastmcp_slim.fastmcp.server.middleware.logging.BaseLoggingMiddleware.on_message(context:MiddlewareContext[Any], call_next:CallNext[Any, Any]) -> AnyLog messages for configured methods.
class
fastmcp_slim.fastmcp.server.middleware.middleware.MiddlewareBase class for FastMCP middleware with dispatching hooks.
class
fastmcp_slim.fastmcp.server.middleware.middleware.MiddlewareContextUnified context for all middleware operations.
class
fastmcp_slim.fastmcp.server.middleware.rate_limiting.RateLimitErrorError raised when rate limit is exceeded.
class
fastmcp_slim.fastmcp.server.middleware.rate_limiting.SlidingWindowRateLimiterSliding window rate limiter implementation.
method
fastmcp_slim.fastmcp.server.middleware.rate_limiting.SlidingWindowRateLimiter.is_allowed() -> boolCheck if a request is allowed.
class
fastmcp_slim.fastmcp.server.middleware.rate_limiting.TokenBucketRateLimiterToken bucket implementation for rate limiting.
method
fastmcp_slim.fastmcp.server.middleware.rate_limiting.TokenBucketRateLimiter.consume(tokens:int=1) -> boolTry to consume tokens from the bucket.
method
fastmcp_slim.fastmcp.server.middleware.timing.TimingMiddleware.on_request(context:MiddlewareContext, call_next:CallNext) -> AnyTime request execution and log the results.
class
fastmcp_slim.fastmcp.server.mixins.lifespan.LifespanMixinMixin providing lifespan infrastructure for FastMCP.
method
fastmcp_slim.fastmcp.server.mixins.transport.TransportMixin.run(transport:Transport | None=None, show_banner:bool | None=None, **transport_kwargs:Any) -> NoneRun the FastMCP server.
method
fastmcp_slim.fastmcp.server.mixins.transport.TransportMixin.run_async(transport:Transport | None=None, show_banner:bool | None=None, **transport_kwargs:Any) -> NoneRun the FastMCP server asynchronously.
method
fastmcp_slim.fastmcp.server.mixins.transport.TransportMixin.run_stdio_async(show_banner:bool=True, log_level:str | None=None, stateless:bool=False) -> NoneRun the server using stdio transport.
func
fastmcp_slim.fastmcp.server.providers.addressing.hash_tool(app_name:str, tool_name:str) -> strDeterministic hex hash for a tool in an app.
func
fastmcp_slim.fastmcp.server.providers.addressing.hashed_resource_uri(app_name:str, tool_name:str) -> strPer-tool Prefab renderer resource URI.
func
fastmcp_slim.fastmcp.server.providers.addressing.parse_hashed_resource_uri(uri:str) -> str | NoneExtract the hash from a Prefab renderer URI, or None.
class
fastmcp_slim.fastmcp.server.providers.base.ProviderBase class for dynamic component providers.
method
fastmcp_slim.fastmcp.server.providers.base.Provider.add_transform(transform:Transform) -> NoneAdd a transform to this provider.
method
fastmcp_slim.fastmcp.server.providers.base.Provider.list_prompts() -> Sequence[Prompt]List prompts with all transforms applied.
method
fastmcp_slim.fastmcp.server.providers.base.Provider.list_resources() -> Sequence[Resource]List resources with all transforms applied.
method
fastmcp_slim.fastmcp.server.providers.base.Provider.list_tools() -> Sequence[Tool]List tools with all transforms applied.
class
fastmcp_slim.fastmcp.server.providers.fastmcp_provider.FastMCPProviderProvider that wraps a FastMCP server.
method
fastmcp_slim.fastmcp.server.providers.fastmcp_provider.FastMCPProvider.lifespan() -> AsyncIterator[None]Start the mounted server's lifespan.
class
fastmcp_slim.fastmcp.server.providers.filesystem_discovery.DiscoveryResultResult of filesystem discovery.
func
fastmcp_slim.fastmcp.server.providers.filesystem_discovery.discover_files(root:Path) -> list[Path]Recursively discover all Python files under a directory.
func
fastmcp_slim.fastmcp.server.providers.filesystem_discovery.extract_components(module:ModuleType) -> list[FastMCPComponent]Extract all MCP components from a module.
func
fastmcp_slim.fastmcp.server.providers.filesystem_discovery.import_module_from_file(file_path:Path, provider_root:Path | None=None) -> ModuleTypeImport a Python file as a module.
class
fastmcp_slim.fastmcp.server.providers.local_provider.local_provider.LocalProviderProvider for locally-defined components.
method
fastmcp_slim.fastmcp.server.providers.local_provider.local_provider.LocalProvider.remove_tool(name:str, version:str | None=None) -> NoneRemove tool(s) from this provider's storage.
class
fastmcp_slim.fastmcp.server.providers.openapi.components.OpenAPIResourceResource implementation for OpenAPI endpoints.
class
fastmcp_slim.fastmcp.server.providers.openapi.components.OpenAPIToolTool implementation for OpenAPI endpoints.
method
fastmcp_slim.fastmcp.server.providers.openapi.components.OpenAPITool.run(arguments:dict[str, Any]) -> ToolResultExecute the HTTP request using RequestDirector.
class
fastmcp_slim.fastmcp.server.providers.openapi.routing.MCPTypeType of FastMCP component to create from a route.
method
fastmcp_slim.fastmcp.server.providers.proxy.ProxyResource.model_copy(**kwargs:Any) -> ProxyResourceOverride to preserve _backend_uri when uri changes.
func
fastmcp_slim.fastmcp.server.providers.proxy.as_proxy_backend(c:Client) -> ClientApply proxy connection settings to a copy we own.
class
fastmcp_slim.fastmcp.server.providers.skills._common.SkillFileInfoInformation about a file within a skill.
class
fastmcp_slim.fastmcp.server.providers.skills._common.SkillInfoParsed information about a skill.
func
fastmcp_slim.fastmcp.server.providers.skills._common.compute_file_hash(path:Path) -> strCompute SHA256 hash of a file.
func
fastmcp_slim.fastmcp.server.providers.skills._common.parse_frontmatter(content:str) -> tuple[dict[str, Any], str]Parse YAML frontmatter from markdown content.
func
fastmcp_slim.fastmcp.server.providers.skills._common.scan_skill_files(skill_dir:Path) -> list[SkillFileInfo]Scan a skill directory for all files.
method
fastmcp_slim.fastmcp.server.providers.skills.skill_provider.SkillFileTemplate.read(arguments:dict[str, Any]) -> str | bytes | ResourceResultRead a file from the skill directory.
class
fastmcp_slim.fastmcp.server.providers.skills.vendor_providers.CursorSkillsProviderCursor skills from ~/.cursor/skills/.
class
fastmcp_slim.fastmcp.server.providers.skills.vendor_providers.GeminiSkillsProviderGemini skills from ~/.gemini/skills/.
class
fastmcp_slim.fastmcp.server.providers.skills.vendor_providers.GooseSkillsProviderGoose skills from ~/.config/agents/skills/.
class
fastmcp_slim.fastmcp.server.providers.skills.vendor_providers.VSCodeSkillsProviderVS Code skills from ~/.copilot/skills/.
class
fastmcp_slim.fastmcp.server.server.StateValueWrapper for stored context state values.
func
fastmcp_slim.fastmcp.server.server.default_lifespan(server:FastMCP[LifespanResultT]) -> AsyncIterator[Any]Default lifespan context manager that does nothing.
method
fastmcp_slim.fastmcp.server.sessions.Session.delete(key:str) -> NoneRemove `key` from this session, if present (preserves the marker).
method
fastmcp_slim.fastmcp.server.sessions.Session.get(key:str, default:Any=None) -> AnyReturn the value for `key`, or `default` when it is not set.
method
fastmcp_slim.fastmcp.server.sessions.Session.set(key:str, value:Any) -> NoneStore `value` under `key` in this session (read-modify-write).
class
fastmcp_slim.fastmcp.server.sessions.SessionProviderProvider contributing the session lifecycle tools.
class
fastmcp_slim.fastmcp.server.sessions.UserSessionAnnotation marker for the injected per-user session.
func
fastmcp_slim.fastmcp.server.sessions.create_session() -> strCreate a new session and return its identifier.
func
fastmcp_slim.fastmcp.server.sessions.end_session(session_id:SessionId) -> strEnd a session and delete all of its state.
func
fastmcp_slim.fastmcp.server.sessions.session_storage_key(principal:str | None, session_id:str) -> strThe single storage key holding a session's state dict.
func
fastmcp_slim.fastmcp.server.telemetry.record_span_exception(span:Span, e:Exception) -> NoneRecord an exception and error status on a span.
class
fastmcp_slim.fastmcp.server.transforms.GetPromptNextProtocol for get_prompt call_next functions.
class
fastmcp_slim.fastmcp.server.transforms.GetResourceNextProtocol for get_resource call_next functions.
class
fastmcp_slim.fastmcp.server.transforms.GetToolNextProtocol for get_tool call_next functions.
class
fastmcp_slim.fastmcp.server.transforms.TransformBase class for component transformations.
method
fastmcp_slim.fastmcp.server.transforms.Transform.get_prompt(name:str, call_next:GetPromptNext, *version:VersionSpec | None=None) -> Prompt | NoneGet a prompt by name.
method
fastmcp_slim.fastmcp.server.transforms.Transform.get_resource(uri:str, call_next:GetResourceNext, *version:VersionSpec | None=None) -> Resource | NoneGet a resource by URI.
method
fastmcp_slim.fastmcp.server.transforms.Transform.get_resource_template(uri:str, call_next:GetResourceTemplateNext, *version:VersionSpec | None=None) -> ResourceTemplate | NoneGet a resource template by URI.
method
fastmcp_slim.fastmcp.server.transforms.Transform.get_tool(name:str, call_next:GetToolNext, *version:VersionSpec | None=None) -> Tool | NoneGet a tool by name.
method
fastmcp_slim.fastmcp.server.transforms.Transform.list_prompts(prompts:Sequence[Prompt]) -> Sequence[Prompt]List prompts with transformation applied.
method
fastmcp_slim.fastmcp.server.transforms.Transform.list_resources(resources:Sequence[Resource]) -> Sequence[Resource]List resources with transformation applied.
method
fastmcp_slim.fastmcp.server.transforms.Transform.list_tools(tools:Sequence[Tool]) -> Sequence[Tool]List tools with transformation applied.
class
fastmcp_slim.fastmcp.server.transforms.namespace.NamespacePrefixes component names with a namespace.
method
fastmcp_slim.fastmcp.server.transforms.namespace.Namespace.get_prompt(name:str, call_next:GetPromptNext, *version:VersionSpec | None=None) -> Prompt | NoneGet prompt by namespaced name.
method
fastmcp_slim.fastmcp.server.transforms.namespace.Namespace.get_resource(uri:str, call_next:GetResourceNext, *version:VersionSpec | None=None) -> Resource | NoneGet resource by namespaced URI.
method
fastmcp_slim.fastmcp.server.transforms.namespace.Namespace.get_tool(name:str, call_next:GetToolNext, *version:VersionSpec | None=None) -> Tool | NoneGet tool by namespaced name.
method
fastmcp_slim.fastmcp.server.transforms.namespace.Namespace.list_prompts(prompts:Sequence[Prompt]) -> Sequence[Prompt]Prefix prompt names with namespace.
method
fastmcp_slim.fastmcp.server.transforms.namespace.Namespace.list_resources(resources:Sequence[Resource]) -> Sequence[Resource]Add namespace path segment to resource URIs.
method
fastmcp_slim.fastmcp.server.transforms.namespace.Namespace.list_tools(tools:Sequence[Tool]) -> Sequence[Tool]Prefix tool names with namespace.
func
fastmcp_slim.fastmcp.server.transforms.prompts_as_tools.PromptsAsTools.list_prompts() -> strList all available prompts.
func
fastmcp_slim.fastmcp.server.transforms.resources_as_tools.ResourcesAsTools.read_resource(uri:Annotated[str, 'The URI of the resource to read']) -> strRead a resource by its URI.
class
fastmcp_slim.fastmcp.server.transforms.search.base.BaseSearchTransformReplace the tool listing with a search interface.
class
fastmcp_slim.fastmcp.server.transforms.search.regex.RegexSearchTransformSearch transform using regex pattern matching.
class
fastmcp_slim.fastmcp.server.transforms.version_filter.VersionFilterFilters components by version range.
class
fastmcp_slim.fastmcp.server.transforms.visibility.VisibilitySets visibility state on matching components.
method
fastmcp_slim.fastmcp.server.transforms.visibility.Visibility.get_prompt(name:str, call_next:GetPromptNext, *version:VersionSpec | None=None) -> Prompt | NoneMark prompt if found.
method
fastmcp_slim.fastmcp.server.transforms.visibility.Visibility.get_resource(uri:str, call_next:GetResourceNext, *version:VersionSpec | None=None) -> Resource | NoneMark resource if found.
method
fastmcp_slim.fastmcp.server.transforms.visibility.Visibility.get_resource_template(uri:str, call_next:GetResourceTemplateNext, *version:VersionSpec | None=None) -> ResourceTemplate | NoneMark resource template if found.
method
fastmcp_slim.fastmcp.server.transforms.visibility.Visibility.get_tool(name:str, call_next:GetToolNext, *version:VersionSpec | None=None) -> Tool | NoneMark tool if found.
method
fastmcp_slim.fastmcp.server.transforms.visibility.Visibility.list_prompts(prompts:Sequence[Prompt]) -> Sequence[Prompt]Mark prompts by visibility state.
method
fastmcp_slim.fastmcp.server.transforms.visibility.Visibility.list_resources(resources:Sequence[Resource]) -> Sequence[Resource]Mark resources by visibility state.
method
fastmcp_slim.fastmcp.server.transforms.visibility.Visibility.list_tools(tools:Sequence[Tool]) -> Sequence[Tool]Mark tools by visibility state.
func
fastmcp_slim.fastmcp.server.transforms.visibility.create_visibility_transforms(rules:list[dict[str, Any]]) -> list[Visibility]Convert rule dicts to Visibility transforms.
func
fastmcp_slim.fastmcp.server.transforms.visibility.get_visibility_rules(context:Context) -> list[dict[str, Any]]Load visibility rule dicts from session state.
func
fastmcp_slim.fastmcp.server.transforms.visibility.is_enabled(component:FastMCPComponent) -> boolCheck if component is enabled.
func
fastmcp_slim.fastmcp.server.transforms.visibility.reset_visibility(context:Context) -> NoneClear all session visibility rules.
class
fastmcp_slim.fastmcp.settings.SettingsFastMCP settings.
method
fastmcp_slim.fastmcp.settings.Settings.get_setting(attr:str) -> AnyGet a setting.
method
fastmcp_slim.fastmcp.settings.Settings.set_setting(attr:str, value:Any) -> NoneSet a setting.
func
fastmcp_slim.fastmcp.telemetry.extract_trace_context(meta:dict[str, Any] | None) -> ContextExtract trace context from an MCP request meta dict.
func
fastmcp_slim.fastmcp.telemetry.get_tracer(version:str | None=None) -> TracerGet the FastMCP tracer for creating spans.
func
fastmcp_slim.fastmcp.telemetry.native_spans_enabled() -> boolWhether FastMCP should create its own spans right now.
func
fastmcp_slim.fastmcp.telemetry.record_span_error(span:Span, exception:BaseException) -> NoneRecord an exception on a span and set error status.
func
fastmcp_slim.fastmcp.utilities.auth.decode_jwt_header(token:str) -> dict[str, Any]Decode JWT header without signature verification.
func
fastmcp_slim.fastmcp.utilities.auth.decode_jwt_payload(token:str) -> dict[str, Any]Decode JWT payload without signature verification.
func
fastmcp_slim.fastmcp.utilities.auth.parse_scopes(value:Any) -> list[str] | NoneParse scopes from environment variables or settings values.
class
fastmcp_slim.fastmcp.utilities.authorization.AuthContextContext passed to auth check callables.
func
fastmcp_slim.fastmcp.utilities.authorization.require_scopes(*scopes:str) -> AuthCheckRequire all of the given OAuth scopes.
func
fastmcp_slim.fastmcp.utilities.components.get_fastmcp_metadata(meta:dict[str, Any] | None) -> FastMCPMetaExtract FastMCP metadata from a component's meta dict.
func
fastmcp_slim.fastmcp.utilities.http.find_available_port(host:str='127.0.0.1') -> intFind an available port by letting the OS assign one.
class
fastmcp_slim.fastmcp.utilities.inspect.FastMCPInfoInformation extracted from a FastMCP instance.
class
fastmcp_slim.fastmcp.utilities.inspect.InspectFormatOutput format for inspect command.
class
fastmcp_slim.fastmcp.utilities.inspect.PromptInfoInformation about a prompt.
class
fastmcp_slim.fastmcp.utilities.inspect.ResourceInfoInformation about a resource.
class
fastmcp_slim.fastmcp.utilities.inspect.TemplateInfoInformation about a resource template.
class
fastmcp_slim.fastmcp.utilities.inspect.ToolInfoInformation about a tool.
func
fastmcp_slim.fastmcp.utilities.inspect.format_fastmcp_info(info:FastMCPInfo) -> bytesFormat FastMCPInfo as FastMCP-specific JSON.
func
fastmcp_slim.fastmcp.utilities.inspect.format_mcp_info(mcp:FastMCP[Any] | SDKServer) -> bytesFormat server info as standard MCP protocol JSON.
func
fastmcp_slim.fastmcp.utilities.inspect.inspect_fastmcp_v2(mcp:FastMCP[Any]) -> FastMCPInfoExtract information from a FastMCP v2.x instance.
func
fastmcp_slim.fastmcp.utilities.logging.get_logger(name:str) -> logging.LoggerGet a logger nested under FastMCP namespace.
class
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.environments.base.EnvironmentBase class for environment configuration.
method
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.environments.base.Environment.build_command(command:list[str]) -> list[str]Build the full command with environment setup.
class
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.environments.uv.UVEnvironmentConfiguration for Python environment setup.
method
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.environments.uv.UVEnvironment.prepare(output_dir:Path | None=None) -> NonePrepare the Python environment using uv.
class
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.mcp_server_config.MCPServerConfigConfiguration for a FastMCP server.
method
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.mcp_server_config.MCPServerConfig.from_file(file_path:Path) -> MCPServerConfigLoad configuration from a JSON file.
method
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.mcp_server_config.MCPServerConfig.prepare(skip_source:bool=False, output_dir:Path | None=None) -> NonePrepare environment and source for execution.
method
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.mcp_server_config.MCPServerConfig.prepare_environment(output_dir:Path | None=None) -> NonePrepare the Python environment.
method
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.mcp_server_config.MCPServerConfig.prepare_source() -> NonePrepare the source for loading.
method
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.mcp_server_config.MCPServerConfig.run_server(**kwargs:Any) -> NoneLoad and run the server with this configuration.
class
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.sources.base.SourceAbstract base class for all source types.
method
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.sources.base.Source.load_server() -> AnyLoad and return the FastMCP server instance.
class
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.sources.filesystem.FileSystemSourceSource for local Python files.
method
fastmcp_slim.fastmcp.utilities.mcp_server_config.v1.sources.filesystem.FileSystemSource.load_server() -> AnyLoad server from filesystem.
func
fastmcp_slim.fastmcp.utilities.mime.resolve_ui_mime_type(uri:str, explicit_mime_type:str | None) -> str | NoneReturn the appropriate MIME type for a resource URI.
class
fastmcp_slim.fastmcp.utilities.openapi.models.ResponseInfoRepresents response information in our IR.
func
fastmcp_slim.fastmcp.utilities.openapi.parser.OpenAPIParser.collect(schema_name:str) -> NoneCollect a schema by name and recurse into its dependencies.
func
fastmcp_slim.fastmcp.utilities.openapi.parser.OpenAPIParser.find_refs(obj)Recursively find all $ref references.
class
fastmcp_slim.fastmcp.utilities.pagination.CursorStateInternal representation of pagination cursor state.
method
fastmcp_slim.fastmcp.utilities.pagination.CursorState.decode(cursor:str) -> CursorStateDecode cursor from an opaque string.
method
fastmcp_slim.fastmcp.utilities.pagination.CursorState.encode() -> strEncode cursor state to an opaque string.
func
fastmcp_slim.fastmcp.utilities.pagination.paginate_sequence(items:Sequence[T], cursor:str | None, page_size:int) -> tuple[list[T], str | None]Paginate a sequence of items.
func
fastmcp_slim.fastmcp.utilities.prefab.is_prefab_app(value:Any) -> boolReturn whether a value is a Prefab app.
func
fastmcp_slim.fastmcp.utilities.prefab.is_prefab_component(value:Any) -> boolReturn whether a value is a Prefab component.
func
fastmcp_slim.fastmcp.utilities.prefab.is_prefab_type(candidate:Any) -> boolReturn whether a type is a Prefab app or component type.
func
fastmcp_slim.fastmcp.utilities.prefab.prefab_app_from_component(component:Any) -> AnyWrap a Prefab component in a Prefab app.
class
fastmcp_slim.fastmcp.utilities.skills.SkillFileInformation about a file within a skill.
class
fastmcp_slim.fastmcp.utilities.skills.SkillManifestFull manifest of a skill including all files.
class
fastmcp_slim.fastmcp.utilities.skills.SkillSummarySummary information about a skill available on a server.
About this data
These signatures were extracted from the public source of PrefectHQ/fastmcp
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.