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
1027 scanned, 750 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 28 info
Scan time
18.8 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 28 of 28 warn and critical signals; 28 demoted to info.
Disclude version
4.1.0
Scanned (UTC)
2026-10-22 08: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.80 Client transport code walks the call stack to locate the first frame outside the package.
    Reasoning

    Walking the call stack with sys._getframe(1) and comparing co_filename against the package root is a common way to find the external caller of a library API. Nothing in the snippet is hidden, encoded, or executes fetched content.

  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 syntax.
    Reasoning

    compile() on generated source inside a test checks that the code generator emits valid Python. The source is produced locally and never executed.

  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 check syntax.
    Reasoning

    compile() on generated source inside a test checks that the code generator emits valid Python. The source is produced locally and never executed.

  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 to check syntax.
    Reasoning

    compile() on generated source inside a test checks that the code generator emits valid Python. The source is produced locally and never executed.

  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 to check syntax.
    Reasoning

    compile() on generated source inside a test checks that the code generator emits valid Python. The source is produced locally and never executed.

  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 to check syntax.
    Reasoning

    compile() on generated source inside a test checks that the code generator emits valid Python. The source is produced locally and never executed.

  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 CLI script to check syntax.
    Reasoning

    compile() on generated script inside a test checks that the code generator emits valid Python. The source is produced locally and never executed.

  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 CLI script to check syntax.
    Reasoning

    compile() on generated script inside a test checks that the code generator emits valid Python. The source is produced locally and never executed.

  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 CLI script to check syntax and escaping.
    Reasoning

    compile() on generated script inside a test checks that the code generator emits valid Python, including escaped quotes in the app name. The source is produced locally and never executed.

  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 CLI script to check syntax.
    Reasoning

    compile() on generated script inside a test checks that the code generator emits valid Python. The source is produced locally and never executed.

  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 CLI script to check syntax.
    Reasoning

    compile() on generated script inside a test checks that the code generator emits valid Python. The source is produced locally and never executed.

  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 content to check syntax.
    Reasoning

    compile() on generated output read back from a test file checks syntax. The compiled code is never executed.

  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 content to check syntax.
    Reasoning

    compile() on generated output read back from a test file checks syntax. The compiled code is never executed, and the non-ASCII string is ordinary test data.

  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 embedded in a conformance test server.
    Reasoning

    The blob is a small PNG image (its base64 begins with the PNG signature) used as a fixture in a conformance server. The raw-pass base64 flag is a false positive for embedded image data.

  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 imports module names extracted from documentation examples to verify they resolve.
    Reasoning

    __import__ runs on module names parsed from documentation examples inside a test, to check that the documented imports resolve. It is a dynamic import, but the names come from the repository's own docs and it is not a dropper.

  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 imports a documented module with fromlist to verify the example resolves.
    Reasoning

    __import__ with fromlist runs on module names parsed from documentation examples inside a test, to check that documented imports resolve. The names come from the repository's own docs, so this is not a dropper.

  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 helper executes Python example code extracted from upgrade docs.
    Reasoning

    exec of compiled source extracted from documentation code blocks in a test harness; the source comes from repo docs, not from attacker input or the network. Standard doc-example testing pattern.

  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 example source inside test helper.
    Reasoning

    compile of doc-extracted source within the same test helper; same benign doc-testing pattern.

  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 runs upgrade-guide code examples via exec.
    Reasoning

    Executes example.source extracted from repository documentation during tests; benign doc-verification harness.

  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 in test harness.
    Reasoning

    compile of repository doc example source in a test; benign.

  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 1x1 PNG constant in downstream test server.
    Reasoning

    Base64 of a small valid 1x1 PNG image used as test fixture data; high-entropy-looking but a legitimate image constant.

  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.85 Test executes wrapped sandbox code to validate code mode.
    Reasoning

    exec of wrapped test code generated by the code-mode transform within a test; the code is internal test fixture, not external payload.

  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.85 Discovery test executes wrapped code via exec.
    Reasoning

    Same pattern as the sibling test: exec of internally wrapped test code in a discovery test.

  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 strings flagged as base64 blobs.
    Reasoning

    Dotted JWT-like strings with base64 segments used as malformed token test inputs; test data, 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 fixture flagged as base64.
    Reasoning

    Same malformed JWT fixture list in an auth test; benign test data.

  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 fixture flagged as base64.
    Reasoning

    Same JWT-shaped invalid-token fixtures; benign.

  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 PNG bytes literal used as test image data.
    Reasoning

    A bytes literal encoding a minimal 1x1 PNG header and data for an Image test; binary fixture with legitimate purpose.

  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 containing a tiny PNG used in icon test.
    Reasoning

    Data URI with a tiny PNG for an icon inspection test; standard test fixture.

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.1.0
git clone https://github.com/PrefectHQ/fastmcp fastmcp && cd fastmcp
git checkout v4.1.3
disclude scan --severity info --diff v4.1.2 .