Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PrefectHQ/fastmcp
/ functions
Functions
11,669 in github.com/PrefectHQ/fastmcp
⨍
Functions
11,669
◇
Types & classes
1,774
↳
Endpoints
123
↓ 817 callers
Method
call_tool
Call a tool by name. This is the public API for executing tools. By default, middleware is applied. Args: name: The tool
fastmcp_slim/fastmcp/server/server.py:1357
↓ 454 callers
Method
list_tools
List all enabled tools from providers. Overrides Provider.list_tools() to add enabled filtering, auth filtering, and middleware execu
fastmcp_slim/fastmcp/server/server.py:827
↓ 368 callers
Method
get
(self, url)
tests/server/auth/providers/test_auth0_mcp.py:271
↓ 303 callers
Method
get
Return the value for `key`, or `default` when it is not set.
fastmcp_slim/fastmcp/server/sessions.py:254
↓ 300 callers
Method
from_function
Create a Tool from a function.
fastmcp_slim/fastmcp/tools/base.py:297
↓ 174 callers
Method
add_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:807
↓ 168 callers
Method
json
(self)
tests/server/auth/providers/test_auth0_mcp.py:256
↓ 151 callers
Method
mount
Mount another FastMCP server on this server with an optional namespace. Mounting establishes a dynamic connection between servers. When a cli
fastmcp_slim/fastmcp/server/server.py:2313
↓ 148 callers
Method
add_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:666
↓ 148 callers
Method
list_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:964
↓ 143 callers
Method
read_resource
(self, uri: str)
tests/utilities/test_skills.py:34
↓ 130 callers
Method
add_response
( self, status_code: int = 200, headers: Any = None, content: bytes | None = N
tests/utilities/httpx2_mock.py:98
↓ 129 callers
Method
debug
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:821
↓ 121 callers
Method
add_extension
Register a server extension (SEP-2133). An extension contributes a negotiated capability, additive request methods, a `tools/call` in
fastmcp_slim/fastmcp/server/server.py:594
↓ 119 callers
Function
running_task_server
Enter the server lifespan (Docket backend + worker) for the block.
tests/tasks/task_helpers.py:105
↓ 116 callers
Method
add_middleware
(self, middleware: Middleware)
fastmcp_slim/fastmcp/server/server.py:591
↓ 116 callers
Function
call_next
( name: str, *, version: VersionSpec | None = None )
tests/cli/test_fastmcp_remote.py:248
↓ 116 callers
Method
set
Store `value` under `key` in this session (read-modify-write). Preserves the creation marker: only the user-state sub-dict is touched.
fastmcp_slim/fastmcp/server/sessions.py:259
↓ 108 callers
Function
get_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
↓ 105 callers
Method
from_tool
( cls, tool: Tool | Callable[..., Any], *, name: str | None = None, ti
fastmcp_slim/fastmcp/tools/base.py:425
↓ 102 callers
Method
disable
Disable components matching all specified criteria. Adds a visibility transform that marks matching components as disabled. Component
fastmcp_slim/fastmcp/server/providers/base.py:622
↓ 100 callers
Method
list_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:1235
↓ 99 callers
Function
json_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
↓ 98 callers
Method
decode
Decode cursor from an opaque string. Raises: ValueError: If the cursor is invalid or malformed.
fastmcp_slim/fastmcp/utilities/pagination.py:31
↓ 89 callers
Method
run
(self, arguments: dict[str, Any])
examples/providers/sqlite/server.py:40
↓ 83 callers
Method
read_resource
Read a resource by URI. This is the public API for reading resources. By default, middleware is applied. Checks concrete resources fi
fastmcp_slim/fastmcp/server/server.py:1554
↓ 78 callers
Method
http_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:369
↓ 78 callers
Method
run
(self, arguments: dict[str, Any])
tests/tasks/server/test_custom_subclass_tasks.py:40
↓ 74 callers
Method
list_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:1099
↓ 72 callers
Function
submit_task
Run an opted-in `tools/call` through the interceptor and return its task.
tests/tasks/task_helpers.py:110
↓ 71 callers
Method
create_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:35
↓ 66 callers
Function
create_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:2506
↓ 66 callers
Method
get_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:1307
↓ 65 callers
Method
get
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
↓ 64 callers
Method
encode
Encode cursor state to an opaque string.
fastmcp_slim/fastmcp/utilities/pagination.py:25
↓ 63 callers
Method
get
(self, key: CacheKey)
fastmcp_slim/fastmcp/client/caching.py:152
↓ 63 callers
Method
warning
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:853
↓ 62 callers
Function
make_token
Create a test access token.
tests/server/auth/test_authorization.py:31
↓ 62 callers
Method
register_client
(self, client_info: OAuthClientInformationFull)
tests/server/test_auth_integration.py:44
↓ 57 callers
Method
build
(self, documents: list[str])
fastmcp_slim/fastmcp/server/transforms/search/bm25.py:36
↓ 56 callers
Method
load_access_token
(self, token: str)
tests/server/test_auth_integration.py:172
↓ 56 callers
Method
resolve
(identity: str)
fastmcp_slim/fastmcp/server/server.py:747
↓ 54 callers
Method
get_routes
Delegate route creation to the server.
fastmcp_slim/fastmcp/server/auth/auth.py:780
↓ 53 callers
Method
get_tool
Get a tool by name, filtering disabled tools. Overrides Provider.get_tool() to filter disabled tools after all transforms (including
fastmcp_slim/fastmcp/server/server.py:910
↓ 53 callers
Function
wait_for_task
Poll `tasks/get` until the task reaches one of `target_states`.
tests/tasks/task_helpers.py:174
↓ 52 callers
Method
reset
Reset all state for next test.
tests/server/auth/oauth_proxy/conftest.py:260
↓ 49 callers
Method
wait
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
↓ 46 callers
Function
hashed_backend_name
Format the universal name for a backend tool: ``<hash>_<local_name>``.
fastmcp_slim/fastmcp/server/providers/addressing.py:48
↓ 46 callers
Method
verify_token
Mock token verification.
tests/server/auth/oauth_proxy/conftest.py:279
↓ 42 callers
Function
_make_proxy
(identity_assertion: IdentityAssertion | None)
tests/server/auth/oauth_proxy/test_identity_assertion.py:104
↓ 39 callers
Function
compress_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:741
↓ 38 callers
Function
_post_token
POST a jwt-bearer grant to the proxy's /token endpoint via an ASGI app. When ``register`` is True the standard test client is registered first; p
tests/server/auth/oauth_proxy/test_identity_assertion.py:144
↓ 38 callers
Method
matches
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
↓ 37 callers
Function
_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:373
↓ 37 callers
Method
read
(path: str)
tests/resources/test_resource_security.py:351
↓ 37 callers
Function
set_token
Set the access token in the auth context var.
tests/server/auth/test_authorization.py:419
↓ 35 callers
Function
_mint_id_jag
Mint a fake ID-JAG JWT with full control over header and claims. `client_id` and `resource` default to values matching the standard test clie
tests/server/auth/oauth_proxy/test_identity_assertion.py:56
↓ 35 callers
Method
render_prompt
Render a prompt by name. This is the public API for rendering prompts. By default, middleware is applied. Use get_prompt() to retriev
fastmcp_slim/fastmcp/server/server.py:1720
↓ 34 callers
Function
convert_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:41
↓ 34 callers
Method
copy
Create a copy of the component.
fastmcp_slim/fastmcp/utilities/components.py:223
↓ 34 callers
Method
elicit
( self, message: str, response_type: type[T], *, response_title: str |
fastmcp_slim/fastmcp/server/context.py:959
↓ 34 callers
Method
error
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:869
↓ 33 callers
Method
get_client
(self, client_id: str)
tests/server/test_auth_integration.py:41
↓ 32 callers
Function
get_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:600
↓ 32 callers
Function
require_scopes
Require all of the given OAuth scopes.
fastmcp_slim/fastmcp/utilities/authorization.py:143
↓ 31 callers
Method
cancel
Send a cancellation notification for an in-progress request.
fastmcp_slim/fastmcp/client/client.py:1353
↓ 31 callers
Method
enable
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:573
↓ 31 callers
Function
make_tool
Create a mock tool for testing.
tests/server/auth/test_authorization.py:45
↓ 31 callers
Method
render
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:296
↓ 31 callers
Function
run_auth_checks
Run auth checks with AND logic, stopping at the first failure.
fastmcp_slim/fastmcp/utilities/authorization.py:304
↓ 31 callers
Function
run_server_async
Start a FastMCP server on a real port as an asyncio task. This runs a real uvicorn server in the current process, bound to a real TCP port,
fastmcp_slim/fastmcp/utilities/tests.py:175
↓ 30 callers
Function
_make_server_with_tools
()
tests/server/transforms/test_search.py:36
↓ 30 callers
Method
add_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:1800
↓ 30 callers
Method
list_tools
(self)
examples/providers/sqlite/server.py:78
↓ 30 callers
Method
model_copy
Override to preserve _backend_name when name changes.
fastmcp_slim/fastmcp/server/providers/proxy.py:268
↓ 30 callers
Function
parse_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
↓ 29 callers
Function
inspect_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 callers
Function
matches_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:302
↓ 27 callers
Function
_write_config
(path: Path, data: dict[str, Any])
tests/cli/test_discovery.py:56
↓ 27 callers
Method
add
Add two numbers.
tests/tools/tool/test_tool.py:21
↓ 27 callers
Method
create_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:296
↓ 27 callers
Function
get_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:50
↓ 26 callers
Method
info
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:837
↓ 25 callers
Function
_run_tool
( server: FastMCP, name: str, arguments: dict[str, Any] )
tests/experimental/transforms/test_code_mode.py:116
↓ 25 callers
Function
create_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:545
↓ 25 callers
Function
find_available_port
Find an available port by letting the OS assign one.
fastmcp_slim/fastmcp/utilities/http.py:4
↓ 25 callers
Method
reset
(self)
tests/utilities/httpx2_mock.py:202
↓ 24 callers
Function
import_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:140
↓ 24 callers
Function
is_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
↓ 24 callers
Function
temporary_settings
Temporarily override FastMCP setting values. Args: **kwargs: The settings to override, including nested settings. Example:
fastmcp_slim/fastmcp/utilities/tests.py:36
↓ 23 callers
Method
authorize
(self, client, params)
tests/server/auth/test_enhanced_error_responses.py:55
↓ 23 callers
Method
log
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:610
↓ 23 callers
Function
run_task
Submit a task and wait for it to reach a terminal state.
tests/tasks/task_helpers.py:197
↓ 23 callers
Method
to_mcp_tool
Convert the FastMCP tool to an MCP tool.
fastmcp_slim/fastmcp/tools/base.py:261
↓ 22 callers
Function
_run_tool
( server: FastMCP, name: str, arguments: dict[str, Any] )
tests/experimental/transforms/test_code_mode_discovery.py:80
↓ 22 callers
Function
_unwrap_string_result
Extract a string result from a ToolResult.
tests/experimental/transforms/test_code_mode_discovery.py:43
↓ 22 callers
Method
clear
(ctx: Context)
tests/server/test_session_visibility.py:468
↓ 22 callers
Method
get_requests
( self, *, url: str | re.Pattern[str] | httpx2.URL | None = None, method: str
tests/utilities/httpx2_mock.py:180
↓ 22 callers
Method
register_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:969
↓ 22 callers
Method
search
Search for available tools by query. Returns matching tools ranked by relevance.
fastmcp_slim/fastmcp/experimental/transforms/code_mode.py:276
next →
1–100 of 11,669, ranked by callers