-
Notifications
You must be signed in to change notification settings - Fork 6
CLI Usage
The QuickMCP CLI provides a command-line interface for generating, configuring, and serving MCP servers. This document details the commands, options, and usage patterns for the CLI tool.
dotnet tool install -g QuickMCP.CLIThe QuickMCP CLI has the following command structure:
quickmcp [OPTIONS] <COMMAND>
Display help information about available commands.
quickmcp --helpDisplay the version of QuickMCP CLI.
quickmcp --versionThe serve command starts an MCP server based on an API specification or configuration file.
quickmcp serve --spec-url https://petstore.swagger.io/v2/swagger.jsonquickmcp serve --spec-path ./swagger/petstore.jsonquickmcp serve --config-path ./config/mcp_server_config.json| Option | Alias | Description | Default |
|---|---|---|---|
--help |
-h |
Prints help information | - |
--config-path |
-c |
The path to the configuration file | - |
--config-env-var |
-e |
The environment variable name pointing to the configuration file | - |
--spec-url |
-s |
The URL of the OpenAPI or Google Discovery specification | - |
--spec-path |
-p |
The Path of the OpenAPI or Google Discovery specification | - |
--server-id |
-i |
The ID of the server to use | - |
--api-base-url |
-a |
Base URL for the API | - |
--logging |
-l |
Enable verbose console logging | false |
# Serve with a configuration file
quickmcp serve -c mcp_server_config.jsonThe build command generates configuration files for MCP servers.
quickmcp build config --spec-url https://petstore.swagger.io/v2/swagger.json --output-path ./configquickmcp build spec -d url_to_documentation| Option | Alias | Description | Default |
|---|---|---|---|
--help |
-h |
Prints help information | - |
--api-type |
-t |
API Specification type OpenAPI (openapi) or Google discovery (discovery) | - |
--spec-url |
-s |
The URL of the OpenAPI or Google Discovery specification | - |
--spec-path |
-p |
The Path of the OpenAPI or Google Discovery specification | - |
--server-name |
-n |
The name of the server to use | - |
--api-base-url |
-a |
Base URL for the API | - |
--auth |
- | The type of authentication to use | - |
--exclude-paths |
-x |
Exclude api paths from the generated client | - |
--only-for-paths |
-f |
Only generate api paths for the specified paths | - |
--output-path |
-o |
Output directory path for the generated client | - |
--ai-metadata |
-m |
Generate AI metadata for the methods and parameters | false |
--ai-api-key |
-k |
Google Gemini API Key for the metadata generation | - |
--skip-auth-config |
- | Skip the authentication configuration at the end of build | false |
# Build with a specific API type
quickmcp build config --api-type openapi --spec-url https://petstore.swagger.io/v2/swagger.json
# Build with path filtering
quickmcp build config --spec-url https://petstore.swagger.io/v2/swagger.json --exclude-paths "/admin/*"
# Build with authentication
quickmcp build config --spec-url https://petstore.swagger.io/v2/swagger.json --auth apiKey
# Build specification from documentation
quickmcp build spec -d url_to_documentationThe list command shows available configuration options.
quickmcp list authquickmcp list server| Option | Alias | Description | Default |
|---|---|---|---|
--help |
-h |
Prints help information | - |
The add command adds new configuration options.
quickmcp add server /path/to/config.json -n MyServer| Option | Alias | Description | Default |
|---|---|---|---|
--help |
-h |
Prints help information | - |
--name |
-n |
Name of the server | - |
| Argument | Description |
|---|---|
configuration file |
Path to the configuration file |
The delete command removes configuration options.
quickmcp delete server MyServer| Option | Alias | Description | Default |
|---|---|---|---|
--help |
-h |
Prints help information | - |
| Argument | Description |
|---|---|
server name |
Server name or ID |
The CLI supports the following authentication types:
API Key Authentication adds the API key to the header or query.
Required settings:
-
apiKey: The API Key used for authentication -
paramName: The name of the parameter (default is X-API-Key) - Optional -
location: The location where the API key will be added (header or query) - Optional
Basic Authentication adds a Base64 encoded username and password to the Authorization header.
Required settings:
-
username: The username for authentication -
password: The password for authentication
Bearer Token Authentication adds the token to the Authorization header.
Required settings:
-
token: The bearer token for authentication
Custom Header Authentication adds a specified header with a value to the request.
Required settings:
-
headerName: The name of the header -
headerValue: The value of the header
OAuth 2.0 Client Credentials Authentication using token endpoint.
Required settings:
-
tokenUrl: The URL used to retrieve an access token -
clientId: The client ID for authentication -
clientSecret: The client secret for authentication -
scope: Optional access scope, defaults to 'client_credentials' - Optional
The CLI supports environment variables for configuration:
| Environment Variable | Description |
|---|---|
QUICKMCP_CONFIG_PATH |
Path to the configuration file (can be specified with --config-env-var) |
The configuration files generated by the build config command are JSON files with server settings.
quickmcp serve --spec-url https://petstore.swagger.io/v2/swagger.jsonquickmcp build config --spec-url https://api.weather.gov/openapi.json --output-path ./weather-configquickmcp add server /path/to/config.json -n WeatherAPIquickmcp delete server WeatherAPI- API Specification not found: Verify the URL or file path is correct and accessible.
- Authentication failures: Check that your authentication details are correct.
Enable verbose logging to diagnose issues:
quickmcp serve --spec-url https://petstore.swagger.io/v2/swagger.json --loggingFor additional help:
quickmcp --help
quickmcp serve --help
quickmcp build --help
quickmcp list --help
quickmcp add --help
quickmcp delete --help