docs/python-sdk/fastmcp-cli-install-claude_code.mdx
fastmcp.cli.install.claude_codeClaude Code integration for FastMCP install using Cyclopts.
find_claude_command <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/cli/install/claude_code.py#L20" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>find_claude_command() -> str | None
Find the Claude Code CLI command.
Checks common installation locations since 'claude' is often a shell alias that doesn't work with subprocess calls.
check_claude_code_available <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/cli/install/claude_code.py#L68" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>check_claude_code_available() -> bool
Check if Claude Code CLI is available.
install_claude_code <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/cli/install/claude_code.py#L73" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>install_claude_code(file: Path, server_object: str | None, name: str) -> bool
Install FastMCP server in Claude Code.
Args:
file: Path to the server fileserver_object: Optional server object name (for :object suffix)name: Name for the server in Claude Codewith_editable: Optional list of directories to install in editable modewith_packages: Optional list of additional packages to installenv_vars: Optional dictionary of environment variablespython_version: Optional Python version to usewith_requirements: Optional requirements file to install fromproject: Optional project directory to run withinReturns:
claude_code_command <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/cli/install/claude_code.py#L155" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>claude_code_command(server_spec: str) -> None
Install an MCP server in Claude Code.
Args:
server_spec: Python file to install, optionally with :object suffix