{"record":{"id":"dfd4e319654fe644","repo":"PrefectHQ/fastmcp","slug":"fastmcp-cli-support-is-not-installed-install-fas","errorCode":null,"errorMessage":"FastMCP CLI support is not installed. Install `fastmcp` or `fastmcp-slim[server]`.","messagePattern":"FastMCP CLI support is not installed\\. Install `fastmcp` or `fastmcp-slim\\[server\\]`\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"fastmcp_slim/fastmcp/cli/__init__.py","lineNumber":8,"sourceCode":"\"\"\"FastMCP CLI package.\"\"\"\n\ntry:\n    from .cli import app\nexcept ImportError as exc:\n    from fastmcp import _install_hints\n\n    raise ImportError(_install_hints.CLI_SUPPORT) from exc\n","sourceCodeStart":1,"sourceCodeEnd":9,"githubUrl":"https://github.com/PrefectHQ/fastmcp/blob/1f021142978e0861cd910c8df4e8074bc7cf3978/fastmcp_slim/fastmcp/cli/__init__.py#L1-L9","documentation":"fastmcp/cli/__init__.py wraps the import of the CLI app in try/except ImportError and re-raises with an install hint: either install the full `fastmcp` package or fastmcp-slim with the `[server]` extra. The slim distribution ships without CLI dependencies to stay minimal.","triggerScenarios":"`from fastmcp.cli import app` (or importing fastmcp.cli at all) in a fastmcp-slim install without the server extra; invoking the CLI entrypoint from a slim install.","commonSituations":"Using fastmcp-slim in production images and then attempting fastmcp run/dev/install CLI commands; CI scripts assuming full fastmcp; partially-installed package where CLI deps were skipped.","solutions":["pip install fastmcp (full package) to get CLI support","Or pip install 'fastmcp-slim[server]' to add CLI deps to the slim build","Confirm the CLI entrypoint resolves: fastmcp --help"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"import importlib.util\ntry:\n    importlib.util.find_spec('fastmcp.cli')\nexcept Exception:\n    raise SystemExit('Install `fastmcp` or `fastmcp-slim[server]` for CLI support')","typeGuard":null,"tryCatchPattern":"try:\n    from fastmcp.cli import app\nexcept ImportError as exc:\n    if 'CLI support' in str(exc):\n        print('Install `fastmcp` or `fastmcp-slim[server]`')\n    else:\n        raise","preventionTips":["Use the full fastmcp package wherever the CLI is needed","Document that slim installs need fastmcp-slim[server] for CLI commands","Verify `fastmcp --help` works in your container image build"],"tags":["dependency","cli","optional-extra","install"],"backgroundTag":"missing-optional-dependency","analyzedSha":"1f021142978e0861cd910c8df4e8074bc7cf3978","analyzedAt":"2026-08-29T14:31:16.082Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}