PyPI / fastmcp / 4.1.3

fastmcp 4.1.3

Source
https://github.com/PrefectHQ/fastmcp
Tag scanned
v4.1.3
Compared with
v4.1.2 (0 signals introduced since)
Files
1025 scanned, 752 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 28 info
Scan time
16.9 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 28 of 28 warn and critical signals; 28 demoted to info.
Disclude version
4.0.0
Scanned (UTC)
2026-10-21 05:27

Signals

Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.

  1. info warn → info by review frame-introspection fastmcp_slim/fastmcp/client/transports/inference.py:41:13

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

        level = 1
        frame = sys._getframe(1)
        while frame is not None:
            if not frame.f_code.co_filename.startswith(_PACKAGE_ROOT):
    likely benign LLM, confidence 0.90 Walks the call stack via sys._getframe to locate the external caller's filename.
    Reasoning

    sys._getframe walking the call stack to find the first caller outside the package root is a common, legitimate technique for inferring the calling module in a client transport. No network, exec, or obfuscation involved.

  2. info warn → info by review dynamic-execution tests/cli/test_generate_cli.py:266:9

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            # Generated code should compile
            compile(source, "<test>", "exec")
    
        def test_array_of_strings_parameter(self):
    likely benign LLM, confidence 0.90 Test compiles generated CLI source to check for syntax errors.
    Reasoning

    compile() is applied to generated source code in a test to verify it has valid syntax. It is compile-only (not exec), operating on test-generated strings, so this is a legitimate syntax check.

  3. info warn → info by review dynamic-execution tests/cli/test_generate_cli.py:286:9

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            assert "json.loads" not in source
            compile(source, "<test>", "exec")
    
        def test_complex_object_parameter(self):
    likely benign LLM, confidence 0.90 Test compiles generated CLI source to verify syntax.
    Reasoning

    Same pattern: compile-only syntax validation of generated code within a unit test.

  4. info warn → info by review dynamic-execution tests/cli/test_generate_cli.py:319:9

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            assert "'metadata': metadata_parsed" in source
            compile(source, "<test>", "exec")
    
        def test_nested_array_parameter(self):
    likely benign LLM, confidence 0.90 Test compiles generated CLI source for syntax validation.
    Reasoning

    Compile-only syntax check of generated code in a test; no execution.

  5. info warn → info by review dynamic-execution tests/cli/test_generate_cli.py:346:9

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            )
            compile(source, "<test>", "exec")
    
        def test_complex_type_with_default(self):
    likely benign LLM, confidence 0.90 Test compiles generated CLI source for syntax validation.
    Reasoning

    Compile-only syntax check of generated code in a test; no execution.

  6. info warn → info by review dynamic-execution tests/cli/test_generate_cli.py:367:9

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            assert "isinstance(options, str)" in source
            compile(source, "<test>", "exec")
    
        def test_name_collision_detection(self):
    likely benign LLM, confidence 0.90 Test compiles generated CLI source for syntax validation.
    Reasoning

    Compile-only syntax check of generated code in a test; no execution.

  7. info warn → info by review dynamic-execution tests/cli/test_generate_cli.py:446:9

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            )
            compile(script, "<generated>", "exec")
    
        def test_contains_tool_functions(self):
    likely benign LLM, confidence 0.90 Test compiles generated script to verify it is valid Python.
    Reasoning

    Compile of generated script string in a test to ensure validity; compile alone does not run code.

  8. info warn → info by review dynamic-execution tests/cli/test_generate_cli.py:492:9

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            )
            compile(script, "<generated>", "exec")
            assert "call_tool_app" in script
    likely benign LLM, confidence 0.90 Test compiles generated script for syntax validity.
    Reasoning

    Compile-only validation of generated script in a test.

  9. info warn → info by review dynamic-execution tests/cli/test_generate_cli.py:505:9

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            # Should compile without syntax errors
            compile(script, "<generated>", "exec")
            # App name should have escaped quotes
            assert r'app = cyclopts.App(name="test-\"server\"-name"' in script
    likely benign LLM, confidence 0.90 Test compiles generated script to check escaped-quote handling.
    Reasoning

    Compile-only validation of generated script with escaped quotes; test-only.

  10. info warn → info by review dynamic-execution tests/cli/test_generate_cli.py:529:9

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            )
            compile(script, "<generated>", "exec")
    
        @pytest.mark.parametrize(
    likely benign LLM, confidence 0.90 Test compiles generated script for syntax validity.
    Reasoning

    Compile-only validation of generated script in a test.

  11. info warn → info by review dynamic-execution tests/cli/test_generate_cli.py:562:9

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            )
            compile(script, "<generated>", "exec")
    likely benign LLM, confidence 0.90 Test compiles generated script for syntax validity.
    Reasoning

    Compile-only validation of generated script in a test.

  12. info warn → info by review dynamic-execution tests/cli/test_generate_cli.py:622:9

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            content = output.read_text(encoding="utf-8")
            compile(content, str(output), "exec")
    
        @pytest.mark.usefixtures("_patch_client")
    likely benign LLM, confidence 0.90 Test compiles generated output file to verify syntax.
    Reasoning

    Compile-only check of a generated output file read from tmp_path in a test.

  13. info warn → info by review dynamic-execution tests/cli/test_generate_cli.py:701:9

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            script = output.read_bytes().decode("utf-8")
            compile(script, str(output), "exec")
            assert "temperature in °C → rounded" in script
            skill = (tmp_path / "SKILL.md").read_bytes().decode("utf-8")
    likely benign LLM, confidence 0.90 Test compiles generated output file to verify syntax.
    Reasoning

    Compile-only check of generated output in a test; the string literal includes a non-ASCII arrow and degree sign, which is just test content.

  14. info warn → info by review encoding-base64 tests/conformance/server.py:43:6

    base64-like blob (40 bytes, compression ratio 1.27) (raw pass, confidence 0.60)

        "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4"
        "nGP4z8BQDwAEgAF/pooBPQAAAABJRU5ErkJggg=="
    )
    likely benign LLM, confidence 0.90 Base64-encoded PNG image bytes in a conformance test server.
    Reasoning

    The string is a PNG image header (iVBORw0KGgo... with IHDR/IDAT/IEND markers) encoded as base64 for a conformance test fixture. Standard embedded image data, not a payload.

  15. info critical → info by review dynamic-import tests/docs/test_doc_examples.py:80:25

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

                        try:
                            __import__(alias.name)
                        except ImportError:
                            errors.append(
    likely benign LLM, confidence 0.85 Test attempts to import module names parsed from documentation examples to validate them.
    Reasoning

    __import__ is used to check whether modules imported in documentation examples are importable, with the module name taken from parsed AST import nodes of doc files. This is a test verifying doc accuracy, not malicious execution, though the dynamic name is a minor smell.

  16. info critical → info by review dynamic-import tests/docs/test_doc_examples.py:89:27

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

                    try:
                        mod = __import__(node.module, fromlist=names)
                    except ImportError:
                        errors.append(
    likely benign LLM, confidence 0.85 Test dynamically imports modules referenced in doc examples to catch broken imports.
    Reasoning

    Dynamic __import__ of node.module from parsed doc-example ImportFrom nodes, collecting ImportError failures; a doc validation test, with the module name coming from the repo's own docs.

  17. info warn → info by review dynamic-execution tests/docs/test_upgrade_guide_equivalence.py:45:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        namespace: dict[str, Any] = {"__name__": "fastmcp_docs_example"}
        exec(compile(matches[0].source, str(path), "exec"), namespace)
        return namespace
    likely benign LLM, confidence 0.85 Test harness executes code examples extracted from upgrade docs.
    Reasoning

    exec of compiled source extracted from documentation code blocks in the repo's own test suite. Dynamic execution is the purpose of a doc-example test harness; the source comes from local markdown files, not from untrusted input.

  18. info warn → info by review dynamic-execution tests/docs/test_upgrade_guide_equivalence.py:45:10

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

        namespace: dict[str, Any] = {"__name__": "fastmcp_docs_example"}
        exec(compile(matches[0].source, str(path), "exec"), namespace)
        return namespace
    likely benign LLM, confidence 0.85 compile() of doc-extracted example source feeding the exec call above.
    Reasoning

    compile of the same doc-extracted source; part of the same benign doc-test harness.

  19. info warn → info by review dynamic-execution tests/docs/test_upgrade_guide_examples.py:101:9

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

            warnings.simplefilter("ignore")
            exec(compile(example.source, str(example.path), "exec"), namespace)
    likely benign LLM, confidence 0.85 Test executes upgrade-guide example code blocks.
    Reasoning

    Executes documentation examples in a test with warnings suppressed; a standard doc-testing pattern operating on repo files.

  20. info warn → info by review dynamic-execution tests/docs/test_upgrade_guide_examples.py:101:14

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            warnings.simplefilter("ignore")
            exec(compile(example.source, str(example.path), "exec"), namespace)
    likely benign LLM, confidence 0.85 compile() of upgrade-guide example source before exec.
    Reasoning

    compile of the example source in the same doc-test harness.

  21. info warn → info by review encoding-base64 tests/downstream/server.py:38:6

    base64-like blob (96 bytes, compression ratio 0.99) (raw pass, confidence 0.60)

    PNG = base64.b64decode(
        "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg=="
    )
    WAV = (
    likely benign LLM, confidence 0.90 Base64-encoded tiny PNG image fixture.
    Reasoning

    Base64 of a small valid 1x1 PNG image used as test fixture data in a test server; the content is a standard tiny image, not a payload.

  22. info warn → info by review dynamic-execution tests/experimental/transforms/test_code_mode.py:93:9

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

    
            exec(wrapped, namespace, namespace)
            return await namespace["__test_main__"]()
    likely benign LLM, confidence 0.90 Test executes generated wrapper code in a namespace for code-mode testing.
    Reasoning

    Test helper executes wrapped code that the test itself constructs for code-mode sandbox testing; no external input reaches it.

  23. info warn → info by review dynamic-execution tests/experimental/transforms/test_code_mode_discovery.py:76:9

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

    
            exec(wrapped, namespace, namespace)
            return await namespace["__test_main__"]()
    likely benign LLM, confidence 0.90 Test executes generated wrapper code for code-mode discovery testing.
    Reasoning

    Same pattern as the sibling test_code_mode helper; a test-local exec of constructed code.

  24. info warn → info by review encoding-base64 tests/server/auth/test_private_key_jwt_auth.py:144:21

    base64-like blob (68 bytes, compression ratio 1.16) (raw pass, confidence 0.60)

            # Non-object headers must fail before reaching JWKS key selection.
            "WyJhbGciXQ.eyJzdWIiOiAiaHR0cHM6Ly9jbGllbnQuZXhhbXBsZS5jb20vbWV0YWRhdGEuanNvbiJ9.c2ln",
            "ImFsZyI.eyJzdWIiOiAiaHR0cHM6Ly9jbGllbnQuZXhhbXBsZS5jb20vbWV0YWRhdGEuanNvbiJ9.c2ln",
    likely benign LLM, confidence 0.90 Malformed JWT test vector strings for auth negative tests.
    Reasoning

    Deliberately malformed JWT-like strings used as negative test cases for private_key_jwt header validation; fragments are short and not a payload.

  25. info warn → info by review encoding-base64 tests/server/auth/test_private_key_jwt_auth.py:145:18

    base64-like blob (68 bytes, compression ratio 1.16) (raw pass, confidence 0.60)

            "WyJhbGciXQ.eyJzdWIiOiAiaHR0cHM6Ly9jbGllbnQuZXhhbXBsZS5jb20vbWV0YWRhdGEuanNvbiJ9.c2ln",
            "ImFsZyI.eyJzdWIiOiAiaHR0cHM6Ly9jbGllbnQuZXhhbXBsZS5jb20vbWV0YWRhdGEuanNvbiJ9.c2ln",
            "WyJhbGciLCAiYjY0Il0.eyJzdWIiOiAiaHR0cHM6Ly9jbGllbnQuZXhhbXBsZS5jb20vbWV0YWRhdGEuanNvbiJ9.c2ln",
        ],
    likely benign LLM, confidence 0.90 Malformed JWT test vector for auth negative tests.
    Reasoning

    Same set of intentionally invalid JWT test vectors in the parametrized list.

  26. info warn → info by review encoding-base64 tests/server/auth/test_private_key_jwt_auth.py:146:30

    base64-like blob (68 bytes, compression ratio 1.16) (raw pass, confidence 0.60)

            "ImFsZyI.eyJzdWIiOiAiaHR0cHM6Ly9jbGllbnQuZXhhbXBsZS5jb20vbWV0YWRhdGEuanNvbiJ9.c2ln",
            "WyJhbGciLCAiYjY0Il0.eyJzdWIiOiAiaHR0cHM6Ly9jbGllbnQuZXhhbXBsZS5jb20vbWV0YWRhdGEuanNvbiJ9.c2ln",
        ],
    )
    likely benign LLM, confidence 0.90 Malformed JWT test vector for auth negative tests.
    Reasoning

    Same intentionally malformed JWT test vector list; base64 fragments decode to ordinary JSON-ish headers used for validation tests.

  27. info warn → info by review payload-bytes-literal tests/tools/test_tool_future_annotations.py:48:16

    bytes literal contains 41 `\xNN` escapes (85% of content) — binary payload shape (ast pass, confidence 0.85)

        # Create a simple 1x1 white pixel PNG
        png_data = b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x02\x00\x00\x00\x90wS\xde\x00\x00\x00\x0cIDATx\x9cc\xf8\x0f\x00\x00\x01\x01\x00\x05\x18\xd4c\x00\x00\x00\x00IEND\xaeB`\x82"
        return Image(data=png_data, format="png")
    likely benign LLM, confidence 0.90 Inline bytes literal of a 1x1 PNG for an Image test fixture.
    Reasoning

    A bytes literal encoding a minimal 1x1 PNG built in a test to create an Image object; binary literal of a valid small image is expected here.

  28. info warn → info by review encoding-base64 tests/utilities/test_inspect_icons.py:244:43

    base64-like blob (96 bytes, compression ratio 1.00) (raw pass, confidence 0.60)

    
            data_uri = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
    
            mcp = FastMCP("DataURIServer")
    likely benign LLM, confidence 0.90 Data URI of a tiny PNG icon used in a test.
    Reasoning

    Base64 data URI for a tiny PNG used as an icon fixture in an inspection test; standard test data.

Reproduce This Scan

Run disclude locally to verify. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.

cargo install disclude --version 4.0.0
git clone https://github.com/PrefectHQ/fastmcp fastmcp && cd fastmcp
git checkout v4.1.3
disclude scan --severity info --diff v4.1.2 .