Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PrefectHQ/fastmcp
/ functions
Functions
13,374 in github.com/PrefectHQ/fastmcp
⨍
Functions
13,374
◇
Types & classes
2,002
↳
Endpoints
150
↓ 14 callers
Method
aclose
(self)
fastmcp_slim/fastmcp/server/auth/oauth_proxy/upstream.py:63
↓ 14 callers
Function
bind_request_context
Bind a ``FastMCPRequestContext`` for the duration of a handler. Constructs the wrapper from the SDK's per-request context and sets/resets the
fastmcp_slim/fastmcp/server/dependencies.py:113
↓ 14 callers
Method
call_tool
Call a namespaced tool through the client that advertised it.
fastmcp_slim/fastmcp/client/group.py:274
↓ 14 callers
Method
from_b2c
Create an AzureProvider pre-configured for Azure AD B2C. Derives authority host, tenant path, and identifier URI from `tenant_name` a
fastmcp_slim/fastmcp/server/auth/providers/azure.py:297
↓ 14 callers
Function
get_server
Get the current FastMCP server instance directly. In a background-task worker the tasks extension's resolver is consulted first, so a mounted
fastmcp_slim/fastmcp/server/dependencies.py:516
↓ 14 callers
Function
is_redirect_uri_allowed_for_application_type
Check a redirect URI against RFC 7591 / SEP-837 `application_type` rules. `application_type` governs which redirect URIs a Dynamically Registered
fastmcp_slim/fastmcp/server/auth/redirect_validation.py:369
↓ 14 callers
Method
list_tools
List tools from every client with namespaced names. An explicit call is the group's catalog-refresh mechanism, so it defaults to `cac
fastmcp_slim/fastmcp/client/group.py:183
↓ 14 callers
Function
make_session
(server: FastMCP, principal: str | None, session_id: str)
tests/server/test_sessions.py:55
↓ 14 callers
Method
match
(self, request: httpx2.Request)
tests/utilities/httpx2_mock.py:65
↓ 14 callers
Function
mock_github
( monkeypatch: pytest.MonkeyPatch, prs: list[dict[str, Any]], permission: str = "write", maint
tests/scripts/test_release_contributor_credit.py:54
↓ 14 callers
Function
parse_args
(argv: Sequence[str] | None = None)
fastmcp_remote/fastmcp_remote/cli.py:186
↓ 14 callers
Function
pr_metadata
( number: int, author: str = "maintainer", coauthors: tuple[str, ...] = (), reporters: tuple[s
tests/scripts/test_release_contributor_credit.py:13
↓ 14 callers
Method
read
(a: str, b: str = "")
tests/resources/test_resource_template.py:1544
↓ 14 callers
Method
set_mcp_path
Propagate MCP path to the server and all verifiers.
fastmcp_slim/fastmcp/server/auth/auth.py:772
↓ 14 callers
Method
verify_token
Verify token using custom validation logic. Args: token: The token string to validate Returns: AccessToken i
fastmcp_slim/fastmcp/server/auth/providers/debug.py:77
↓ 14 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
↓ 13 callers
Function
_extract_mime_type_from_route
Extract the primary MIME type from an HTTPRoute's response definitions. Looks for the first successful response (2xx) and returns its content typ
fastmcp_slim/fastmcp/server/providers/openapi/components.py:92
↓ 13 callers
Function
_hash_token
Hash a token for secure storage lookup. Uses SHA-256 to create a one-way hash. The original token cannot be recovered from the hash, providin
fastmcp_slim/fastmcp/server/auth/oauth_proxy/models.py:152
↓ 13 callers
Method
_hash_token
Return the SHA-256 hex digest of *token*.
fastmcp_slim/fastmcp/utilities/token_cache.py:146
↓ 13 callers
Function
_search
(mcp: FastMCP, query: str)
tests/experimental/transforms/test_jev_search.py:117
↓ 13 callers
Function
_unwrap_string_result
Extract a string result from a ToolResult. String results are wrapped in ``{"result": "..."}`` by the structured-output convention.
tests/experimental/transforms/test_code_mode.py:56
↓ 13 callers
Method
apply
Create a TransformedTool from a provided tool and this transformation configuration.
fastmcp_slim/fastmcp/tools/tool_transform.py:1001
↓ 13 callers
Method
close
(self)
fastmcp_slim/fastmcp/client/client.py:1393
↓ 13 callers
Function
create_openapi_server
Helper to create a FastMCP server with OpenAPIProvider.
tests/server/providers/openapi/test_comprehensive.py:18
↓ 13 callers
Function
generate_skill_content
Generate a SKILL.md file for a generated CLI script.
fastmcp_slim/fastmcp/cli/generate.py:619
↓ 13 callers
Method
get_well_known_routes
Delegate well-known route creation to the server. This ensures that server-specific well-known route logic (e.g., OAuthProvider's RFC
fastmcp_slim/fastmcp/server/auth/auth.py:786
↓ 13 callers
Function
hash_tool
Deterministic hex hash for a tool in an app. Same inputs on every replica produce the same output.
fastmcp_slim/fastmcp/server/providers/addressing.py:44
↓ 13 callers
Method
make_key
Construct the lookup key for this component type. Args: identifier: The raw identifier (name for tools/prompts, uri for resources
fastmcp_slim/fastmcp/utilities/components.py:125
↓ 13 callers
Function
make_server_request_context
Build a minimal SDK ServerRequestContext for direct handler unit tests. The v2 SDK hands handlers a ``ServerRequestContext`` argument. Tests that
tests/conftest.py:42
↓ 13 callers
Method
read_resource_mcp
Send a resources/read request and return the complete MCP protocol result. Args: uri (AnyUrl | str): The URI of the resource to r
fastmcp_slim/fastmcp/client/mixins/resources.py:215
↓ 13 callers
Function
resolve_root_ref
Resolve $ref at root level to meet MCP spec requirements. MCP specification requires outputSchema to have "type": "object" at the root level.
fastmcp_slim/fastmcp/utilities/json_schema.py:444
↓ 13 callers
Function
scan_notes
( notes: str, prs: dict[int, dict[str, Any]] | None = None )
scripts/release_contributor_credit.py:147
↓ 13 callers
Method
supports_tasks
Check if this component supports task execution.
fastmcp_slim/fastmcp/utilities/tasks.py:60
↓ 13 callers
Function
task_redis_prefix
Return the Redis key prefix that owns a given scope. Authenticated tasks live under ``fastmcp:task:auth:{enc_scope}``; anonymous tasks live u
fastmcp_tasks/fastmcp_tasks/keys.py:197
↓ 13 callers
Method
validate
(token: str)
tests/server/auth/providers/test_debug.py:31
↓ 12 callers
Method
_get_resource_url
Get the actual resource URL being protected. Uses ``resource_base_url`` if set; otherwise falls back to ``base_url``. Args:
fastmcp_slim/fastmcp/server/auth/auth.py:456
↓ 12 callers
Function
_is_http_target
Return True if the resolved target will use an HTTP-based transport. MCPConfig dicts are excluded because ``MCPConfigTransport`` manages indi
fastmcp_slim/fastmcp/cli/client.py:158
↓ 12 callers
Function
_make_token
( *, token: str = "tok", client_id: str = "client-1", scopes: list[str] | None = None, exp
tests/utilities/test_token_cache.py:11
↓ 12 callers
Method
_matches
Check if this transform applies to the component. All specified criteria must match (intersection semantics). An empty rule (no crite
fastmcp_slim/fastmcp/server/transforms/visibility.py:125
↓ 12 callers
Function
_parse_mcp_config
Parse an mcpServers-style JSON file into discovered servers.
fastmcp_slim/fastmcp/cli/discovery.py:129
↓ 12 callers
Method
_prepare_scopes_for_upstream_refresh
Prepare scopes for Azure token refresh. Azure requires fully-qualified scopes and only allows ONE resource per token request (AADSTS2
fastmcp_slim/fastmcp/server/auth/providers/azure.py:522
↓ 12 callers
Method
add_prompt
Add a prompt to the server. Args: prompt: A Prompt instance or @prompt-decorated function to add Returns: Th
fastmcp_slim/fastmcp/server/server.py:2063
↓ 12 callers
Method
assert_called
Assert that a hook was called a specific number of times.
tests/server/middleware/test_middleware_nested.py:76
↓ 12 callers
Function
auth_scope
Bind (or clear) the auth context so `get_task_scope` sees a caller.
tests/tasks/task_helpers.py:72
↓ 12 callers
Function
call
Invoke a tool the way an agent does, so the result is a ToolMessage with its artifact.
tests/downstream/smoke_langchain_mcp.py:76
↓ 12 callers
Method
complete
Send a completion request to the server. Args: ref (mcp_types.ResourceTemplateReference | mcp_types.PromptReference): The referen
fastmcp_slim/fastmcp/client/client.py:1495
↓ 12 callers
Method
convert_result
Convert a raw result to ToolResult. Handles ToolResult passthrough and converts raw values using the tool's attributes (output_schema
fastmcp_slim/fastmcp/tools/base.py:367
↓ 12 callers
Function
create_command
Generate a CIMD document for hosting. Create a Client ID Metadata Document that you can host at an HTTPS URL. The URL where you host this doc
fastmcp_slim/fastmcp/cli/cimd.py:32
↓ 12 callers
Function
drive_auth_flow
Drive an httpx auth flow to completion, feeding each yield to responder.
tests/client/auth/test_client_credentials.py:98
↓ 12 callers
Function
entry
(number: int, author: str = "maintainer")
tests/scripts/test_release_contributor_credit.py:50
↓ 12 callers
Function
extract_components
Extract all MCP components from a module. Scans all module attributes for instances of Tool, Resource, ResourceTemplate, or Prompt objects cr
fastmcp_slim/fastmcp/server/providers/filesystem_discovery.py:290
↓ 12 callers
Method
generate
Generate an RSA key pair for testing. Returns: RSAKeyPair: Generated key pair
fastmcp_slim/fastmcp/server/auth/providers/jwt.py:103
↓ 12 callers
Function
generate_cli_command
Generate a standalone CLI script from an MCP server. Connects to the server, reads its tools/resources/prompts, and writes a Python script th
fastmcp_slim/fastmcp/cli/generate.py:670
↓ 12 callers
Function
get_log_lines
Get log lines from a caplog fixture.
tests/server/middleware/test_logging.py:27
↓ 12 callers
Method
get_request
( self, *, url: str | re.Pattern[str] | httpx2.URL | None = None, method: str
tests/utilities/httpx2_mock.py:189
↓ 12 callers
Method
issue_refresh_token
Issue a minimal FastMCP refresh token. FastMCP refresh tokens are reference tokens containing only the minimal claims needed for vali
fastmcp_slim/fastmcp/server/auth/jwt_issuer.py:175
↓ 12 callers
Function
make_server
()
tests/tasks/server/test_task_catalog_transforms.py:28
↓ 12 callers
Function
make_upstream
()
tests/server/providers/proxy/test_server_metadata.py:141
↓ 12 callers
Function
parse_task_key
Parse Docket task key to extract metadata. Args: task_key: Encoded task key from Docket Returns: Dict with keys: ``task_scop
fastmcp_tasks/fastmcp_tasks/keys.py:118
↓ 12 callers
Function
parse_tool_arguments
Build a tool-call argument dict from CLI inputs. A single JSON object argument is treated as the full argument dict. ``--input-json`` provide
fastmcp_slim/fastmcp/cli/client.py:298
↓ 12 callers
Method
ping
()
tests/client/client/test_mode_negotiation.py:97
↓ 12 callers
Method
run_async
Run the FastMCP server asynchronously. Args: transport: Transport protocol to use ("stdio", "http", "sse", or "streamable-http")
fastmcp_slim/fastmcp/server/mixins/transport.py:74
↓ 12 callers
Function
use_horizon_api
( monkeypatch: pytest.MonkeyPatch, )
tests/cli/deploy/test_command.py:84
↓ 12 callers
Function
validate_url
Validate URL for SSRF and resolve to IPs. Args: url: URL to validate require_path: If True, require non-root path (for CIMD)
fastmcp_slim/fastmcp/server/auth/ssrf.py:278
↓ 11 callers
Function
_adder
()
tests/server/middleware/test_message_visibility.py:59
↓ 11 callers
Method
_app
(marker: str = "x", app_name: str = "contacts")
tests/server/providers/test_prefab_roundtrip.py:261
↓ 11 callers
Method
_convert_to_anthropic_messages
( messages: Sequence[SamplingMessage], )
fastmcp_slim/fastmcp/client/sampling/handlers/anthropic.py:177
↓ 11 callers
Function
_idp_jwks
Build a JWKS document from an RSA key pair's public key.
tests/server/auth/oauth_proxy/test_identity_assertion.py:47
↓ 11 callers
Function
_schema_section
(schema: dict[str, Any] | None, title: str)
fastmcp_slim/fastmcp/server/transforms/search/base.py:191
↓ 11 callers
Function
_schema_to_python_type
Convert a JSON Schema to a Python type annotation. Returns (type_annotation, needs_json_parsing).
fastmcp_slim/fastmcp/cli/generate.py:69
↓ 11 callers
Function
build_task_key
Build Docket task key with embedded metadata. When ``task_scope`` is ``None`` the task is anonymous and lives in the ``anon`` keyspace. Othe
fastmcp_tasks/fastmcp_tasks/keys.py:79
↓ 11 callers
Function
download_skill
Download a skill and all its files to a local directory. Creates a subdirectory named after the skill containing all files. Args: cl
fastmcp_slim/fastmcp/utilities/skills.py:127
↓ 11 callers
Method
enable_components
Enable components matching criteria for this session only. Session rules override global transforms. Rules accumulate - each call add
fastmcp_slim/fastmcp/server/context.py:1199
↓ 11 callers
Function
get_http_request
Get the current HTTP request. Tries MCP SDK's request_ctx first, then falls back to FastMCP's HTTP context.
fastmcp_slim/fastmcp/server/dependencies.py:579
↓ 11 callers
Method
initialize
Send an initialize request to the server. This method performs the MCP initialization handshake with the server, exchanging capabilit
fastmcp_slim/fastmcp/client/client.py:893
↓ 11 callers
Function
load_mcp_server_config
Load a FastMCP configuration from a fastmcp.json file. Args: config_path: Path to fastmcp.json file Returns: MCPServerConfig
fastmcp_slim/fastmcp/cli/run.py:124
↓ 11 callers
Function
make_m2m_responder
Build a responder for the standard M2M discovery + token exchange flow. Returns the responder and a dict that captures the token request and the
tests/client/auth/test_client_credentials.py:39
↓ 11 callers
Function
mock_transport
( handler: Callable[[httpx2.Request], httpx2.Response], )
tests/cli/deploy/test_horizon_client.py:21
↓ 11 callers
Method
read
Read the resource by calling the wrapped function.
fastmcp_slim/fastmcp/resources/function_resource.py:201
↓ 11 callers
Method
report_progress
(self, phase: str, done: int, total: int)
scripts/rank_issues_tui.py:348
↓ 11 callers
Function
require_roles
Require all of the given roles, read from the token's claims. Roles and groups are not part of OIDC, so every identity provider puts them som
fastmcp_slim/fastmcp/utilities/authorization.py:148
↓ 11 callers
Method
start_as_current_span
( self, name: str, context: Context | None = None, kind: SpanKind = SpanKind.I
fastmcp_slim/fastmcp/telemetry.py:66
↓ 11 callers
Method
store_event
Store an event and return its ID. Args: stream_id: ID of the stream the event belongs to message: The JSON-RPC messag
fastmcp_slim/fastmcp/server/event_store.py:120
↓ 11 callers
Function
user_meta
Strip the SDK's `serverInfo` stamp from a result's `_meta`. Every 2026-era result carries `io.modelcontextprotocol/serverInfo` (spec #3002),
tests/conftest.py:27
↓ 11 callers
Function
validate_redirect_uri
Validate a redirect URI against allowed patterns. Args: redirect_uri: The redirect URI to validate allowed_patterns: List of allo
fastmcp_slim/fastmcp/server/auth/redirect_validation.py:427
↓ 11 callers
Function
with_argv
Temporarily replace sys.argv if args provided. This context manager is used at the CLI boundary to inject server arguments when needed, witho
fastmcp_slim/fastmcp/cli/cli.py:76
↓ 10 callers
Method
_bind
Bind this OAuth provider to a specific MCP server URL. Called automatically when mcp_url is provided to __init__, or by the transport
fastmcp_slim/fastmcp/client/auth/oauth.py:271
↓ 10 callers
Method
_convert_to_openai_messages
( system_prompt: str | None, messages: Sequence[SamplingMessage] )
fastmcp_slim/fastmcp/client/sampling/handlers/openai.py:183
↓ 10 callers
Function
_get_auth_context
Get auth context for the current request. Returns a tuple of (skip_auth, token) where: - skip_auth=True means auth checks should be skipped (
fastmcp_slim/fastmcp/server/server.py:249
↓ 10 callers
Function
_mock_httpx_client
Build a mock httpx2.AsyncClient whose stream() yields a canned response. The returned client's ``.stream.call_args`` exposes the request that was
tests/server/auth/test_ssrf_protection.py:24
↓ 10 callers
Function
app_config_to_meta_dict
Convert an AppConfig or dict to the wire-format dict for ``meta["ui"]``.
fastmcp_slim/fastmcp/apps/config.py:190
↓ 10 callers
Function
asgi_client
Serve a FastMCP server over HTTP in-process and yield a connected `Client`. This is the shortest path to testing a server over a real HTTP s
fastmcp_slim/fastmcp/utilities/tests.py:409
↓ 10 callers
Function
build_transport
(config: RemoteConfig)
fastmcp_remote/fastmcp_remote/cli.py:252
↓ 10 callers
Function
call_command
Call a tool, read a resource, or get a prompt on an MCP server. By default the target is treated as a tool name. If the target contains ``://
fastmcp_slim/fastmcp/cli/client.py:796
↓ 10 callers
Function
create_callback_html
Create a styled HTML response for OAuth callbacks.
fastmcp_slim/fastmcp/client/oauth_callback.py:34
↓ 10 callers
Function
discriminator_spec
A parent schema with a discriminator mapping onto two allOf subtypes.
tests/server/providers/openapi/test_openapi_discriminator.py:21
↓ 10 callers
Method
execute
Execute tool calls using Python code.
fastmcp_slim/fastmcp/experimental/transforms/code_mode.py:702
↓ 10 callers
Method
fetch_token
Exchange an authorization grant for tokens at the token endpoint. Falsy parameters are dropped from the request body, matching authlib.
fastmcp_slim/fastmcp/server/auth/oauth_proxy/upstream.py:111
↓ 10 callers
Function
get_http_headers
Return HTTP headers from an ambient server request, when available. The standalone client package has no server request context. When the full
fastmcp_slim/fastmcp/client/dependencies.py:19
↓ 10 callers
Method
get_session_id
Get the session ID for this transport, if available.
fastmcp_slim/fastmcp/client/transports/base.py:133
← previous
next →
201–300 of 13,374, ranked by callers