Typical workflow

The following steps outline a standard workflow for generating profiles, exploring APIs, and deploying MCP configurations. Each step includes the command and its purpose:
  1. Use the up command to quickly create a profile with TLS enabled and an OpenAPI specification:
    ./mcpgen up --quick --tls --spec <openapi.yml>

    This command initializes a new profile using the provided OpenAPI specification.

  2. Run the list command to verify that the container is active:
    ./mcpgen list --wide

    This command displays all running containers with extended details.

  3. To list available tools with names and descriptions, run:
    ./mcpgen client myprof

    This output provides a quick overview of all tools in the profile.

    For full metadata of all tools:
    ./mcpgen client myprof --list-details

    This command retrieves detailed schema information for every tool.

  4. To view complete details for a single tool, for example getInventoryRecords, run:
    ./mcpgen client myprof --list-details --tool getInventoryRecords

    This command focuses on one tool and displays its schema and parameters.

  5. To execute a tool with arguments:
    ./mcpgen client myprof --tool listProducts --args '{"limit":3}'

    This command runs the tool and returns results based on the specified arguments.

  6. Optionally, create additional tokens for different access levels:
    ./mcpgen sa-token myprof --name admin --scopes service_account mcp_access mcp_admin
    ./mcpgen sa-token myprof --name readonly --scopes service_account mcp_access

    These commands generate service account tokens with defined scopes.

    To test with a specific token:
    ./mcpgen client myprof --sa-token admin

    This applies the selected token for the client session.

  7. Enable debug mode to inspect HTTP exchanges:
    ./mcpgen client myprof --tool getOrders --args '{}' --debug

    This command helps troubleshooting issues by showing detailed request and response data.

  8. Export the profile for production:
    ./mcpgen export myprof --bundle prod

    This command creates a production-ready bundle.

  9. Deploy on another host using the generated Docker Compose file or helper script.

API discovery workflow

Follow these steps to explore and test APIs:
  1. See all available tools:
    ./mcpgen client myprof
  2. Explore all tool schemas:
    ./mcpgen client myprof --list-details
  3. View complete details:
    ./mcpgen client myprof --list-details --tool getWarehouseMemos
  4. Invoke with sample data:
    ./mcpgen client myprof --tool getWarehouseMemos --args '{"filter":"Warehouse_ID=\"STL01\""}'
  5. See full HTTP exchange:
    ./mcpgen client myprof --tool getWarehouseMemos --args '{}' --debug