diff --git a/docs/clients/generate-cli.mdx b/docs/clients/generate-cli.mdx index ce8c45e04..a96fab507 100644 --- a/docs/clients/generate-cli.mdx +++ b/docs/clients/generate-cli.mdx @@ -30,7 +30,7 @@ fastmcp generate-cli weather -f fastmcp generate-cli weather my_cli.py -f ``` -Name-based resolution works here too, so if you have a server configured in Claude Desktop, Cursor, or any other supported editor, you can reference it by name: +Name-based resolution works here too, so if you have a server configured in Claude Desktop, Cursor, or any other supported editor, you can reference it by name. Run [`fastmcp discover`](/clients/cli#discovering-configured-servers) to see what's available. ```bash fastmcp generate-cli claude-code:my-server output.py @@ -99,4 +99,8 @@ The most common edit is changing `CLIENT_SPEC`. If you generated from a local de Beyond that, it's a regular Python file. You can add commands, change the output formatting, integrate it into a larger application, or strip out the parts you don't need. The helper functions (`_call_tool`, `_print_tool_result`) are thin wrappers around `fastmcp.Client` that are easy to adapt. -The generated script requires `fastmcp` and `cyclopts` as dependencies. +The generated script requires `fastmcp` as a dependency. If the script lives outside a project that already has fastmcp installed, `uv run` is the easiest way to run it without permanent installation: + +```bash +uv run --with fastmcp python cli.py call-tool get_forecast --city London +``` diff --git a/tests/cli/test_generate_cli.py b/tests/cli/test_generate_cli.py index 919dc8ee0..16edf0656 100644 --- a/tests/cli/test_generate_cli.py +++ b/tests/cli/test_generate_cli.py @@ -1,5 +1,6 @@ """Tests for fastmcp generate-cli command.""" +import sys from pathlib import Path from typing import Any from unittest.mock import patch @@ -396,6 +397,9 @@ class TestGenerateCliCommand: assert content != "existing" assert "async def greet(" in content + @pytest.mark.skipif( + sys.platform == "win32", reason="Unix executable bits N/A on Windows" + ) @pytest.mark.usefixtures("_patch_client") async def test_file_is_executable(self, tmp_path: Path): output = tmp_path / "cli.py"