CLI reference¶
pycli-mcp¶
Run an MCP server using a list of import paths to commands or callable objects that return a command:
Filtering is supported. For example, if you have a CLI named foo and you only want to expose the subcommands bar and baz, excluding the baz subcommands sub2 and sub3, you can do:
Raises: ValueError: If a command spec or per-target option is invalid.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--aggregate, -a | choice (root | group | none) | The level of aggregation to use, with less improving type information at the expense of more tools (default: root). Multiple specs make the format: spec=aggregation | Sentinel.UNSET |
--name, -n | text | The expected name of the executable, overriding the default (name of the callback). Multiple specs make the format: spec=name | Sentinel.UNSET |
--include, -i | text | The regular expression filter to include subcommands. Multiple specs make the format: spec=regex | Sentinel.UNSET |
--exclude, -e | text | The regular expression filter to exclude subcommands. Multiple specs make the format: spec=regex | Sentinel.UNSET |
--strict-types | boolean | Error on unknown types | False |
--debug | boolean | Enable debug mode | False |
--host | text | The host used to run the server (default: 127.0.0.1) | Sentinel.UNSET |
--port | integer | The port used to run the server (default: 8000) | Sentinel.UNSET |
--log-level | text | The log level used to run the server (default: info) | Sentinel.UNSET |
--log-config | text | The path to a file passed to the logging.config.fileConfig function | Sentinel.UNSET |
--option, -o | Arbitrary server options (multiple allowed) e.g. -o key1 value1 -o key2 value2 | Sentinel.UNSET | |
--help, -h | boolean | Show this message and exit. | False |