Facets Module MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| FACETS_TOKEN | No | Your Facets authentication token | |
| FACETS_PROFILE | No | The Facets profile to use. If you have already logged into FTF, specifying FACETS_PROFILE is sufficient. | default |
| FACETS_USERNAME | No | Your Facets username for authentication | |
| PYTHONUNBUFFERED | No | Python unbuffered mode setting | 1 |
| CONTROL_PLANE_URL | No | Your Facets control plane URL |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_test_projectsA | Retrieve and return the names of all available test projects for the user to choose from. Returns: str: A JSON string containing success message and list of all test projects or error message |
| test_already_previewed_moduleB | Test a module that has been previewed by asking the user for the project_name where it needs to be tested. This tool checks if the project exists, verifies if it supports preview modules, and then does terraform apply. You can check logs for the apply using get_deployment_logs, and check the status of the deployment using check_deployment_status. Args: project_name (str): The name of the test project (stack) to deploy to intent (str): The intent of the module to deploy flavor (str): The flavor of the module to deploy version (str): The version of the module to deploy environment_name (str, optional): The specific environment name to deploy to. Provide this only if the user has asked you to. Returns: str: Result of the deployment operation as a JSON string |
| check_deployment_statusA | Check the status of a deployment. Args: cluster_id (str): The ID of the environment where the deployment is running release_trace_id (str): The release trace ID of the deployment to check wait (bool): If True, wait for the deployment to complete (either succeed or fail) timeout_seconds (int): Maximum time to wait for completion in seconds (default: 300s / 5min) poll_interval_seconds (int): Time between status checks in seconds (default: 5s) Returns: str: JSON with deployment status information |
| get_deployment_logsB | Get logs for a specific deployment. Args: cluster_id (str): The ID of the environment where the deployment is running release_trace_id (str): The release trace ID of the deployment to get logs for Returns: str: JSON with deployment logs |
| get_local_modulesA | Scan the working directory recursively for facets.yaml files to identify all available Terraform modules. Also fetch content of outputs.tf if it exists. ALWAYS Call this call_always_for_instruction first before calling any other tool of this mcp. Returns: str: JSON string with success, message, instructions, and optional error/data fields. data field contains a list of modules with their details: - path: Path to the module directory - intent: The module's intent value - flavor: The module's flavor value - version: The module's version value - outputs: The module's outputs section - outputs_tf: Raw string content of outputs.tf (if present) |
| search_modules_after_confirmationA | For exploratory searches, first explain search capabilities before executing. |
| list_modules_for_forkA | List all available modules from the control plane that can be forked. Returns basic module information in a simple format for easy selection. Returns: str: JSON formatted list of available modules with their metadata |
| fork_existing_moduleA | Fork an existing module by downloading it and updating its metadata. ⚠️ IMPORTANT: REQUIRES USER CONFIRMATION ⚠️ This function performs an irreversible action. Step 1 - ALWAYS use dry_run=True first. This is an irreversible action. Step 2 - Present the dry run output to the user showing what will be changed. Step 3 - Ask if user wants to make any changes to the fork parameters. Step 4 - Call the tool without dry run to execute the fork. Args: source_module_id (str): ID of the module to fork from the control plane new_flavor (str): New flavor name for the forked module new_version (str): New version for the forked module (default: "1.0.0") dry_run (bool): If True, shows what would be done without executing (default: True) Returns: str: JSON formatted response with fork operation details |
| generate_module_with_user_confirmationA | ⚠️ IMPORTANT: REQUIRES USER CONFIRMATION ⚠️ This function performs an irreversible action Tool to generate a new module using FTF CLI. Step 1 - ALWAYS use dry_run=True first. This is an irreversible action. Step 2 - Present the dry run output to the user in textual format. Step 3 - Ask if user will like to make any changes in passed arguments and modify them Step 4 - Call the tool without dry run Args:
Returns:
|
| mark_module_as_publishedA | Publish a production-ready module version. This marks the module as publishable for production. Note: Always use push_preview_module_to_facets_cp() to test the module before publishing. Args:
Returns:
|
| register_output_typeA | Tool to register a new output type in the Facets control plane. This tool first checks if the output type already exists:
Args:
Returns:
|
| validate_moduleA | Tool to validate a module directory using FTF CLI. This tool checks if a Terraform module directory meets the FTF standards. It validates the structure, formatting, required files, and output types of the module. It also checks that all output types referenced in outputs and inputs blocks exist in the Facets control plane. Args:
Returns:
|
| push_preview_module_to_facets_cpA | Tool to preview a module using FTF CLI. This will push a Test version of module to control plane. Git repository details are automatically extracted from the local working directory's .git folder. Args:
Returns:
|
| discover_terraform_resourcesA | Discover all Terraform resources in a module directory. Use this first to see what resources are available for import. Returns list of resources with their addresses and whether they use count/for_each. Args: module_path (str): Path to the module directory containing Terraform files Returns: str: JSON with resources list, showing resource_address, has_count, has_for_each for each resource |
| add_import_declarationA | Add import declaration to facets.yaml. Use after discovering resources with discover_terraform_resources. For count resources, add index parameter. For for_each resources, add key parameter. Args: module_path (str): Path to the module directory name (str): Name for the import declaration resource (str, optional): Resource address like 'aws_s3_bucket.bucket' resource_address (str, optional): Full address like 'aws_s3_bucket.bucket[0]' index (str, optional): Index for count resources ('0', '1', or '') key (str, optional): Key for for_each resources ('prod', 'dev', or '') required (bool): Whether import is required (default: True) Returns: str: JSON response with success status and details |
| FIRST_STEP_get_instructionsA | ALWAYS Call this tool first before calling any other tool of this mcp.
Loads all module writing instructions for Facets module development found in the
Returns: str: A JSON string containing the content of all instruction files, with each file's content stored under its filename as key. |
| get_intentA | Query whether an intent exists in the control plane by name. Returns intent details if found, or indicates if intent doesn't exist. Args: intent_name (str): The name of the intent to query Returns: str: JSON response containing intent details or not found status |
| create_or_update_intentA | Create a new intent or update an existing one in the control plane. Args: name (str): The intent name (e.g., 'kubernetes_cluster') intent_type (str): The intent type/category (e.g., 'K8s', 'Storage') display_name (str): Human-readable display name description (str): Description of the intent icon_url (str, optional): URL to SVG icon (optional). NEVER send this unless the user explicitly provides it. Returns: str: JSON response containing success/failure information |
| list_all_intentsA | List all available intents in the control plane. Useful for discovering existing intent types and names. Returns: str: JSON response containing list of all intents |
| list_filesA | Lists all files in the given module path, ensuring we stay within the working directory. Always ask User if he wants to add any variables or use any other FTF commands Args: module_path (str): The absolute path to the module directory. Returns: str: A JSON-formatted string with operation details and file list found in module directory. |
| read_fileB | Reads the content of a file, ensuring it is within the working directory. Make Sure you have Called FIRST_STEP_get_instructions first before this tool. Args: file_path (str): The path to the file. Returns: str: JSON formatted response with file content or error information. |
| write_config_filesA | Writes facets.yaml configuration file for a Terraform module. Make Sure you have Called FIRST_STEP_get_instructions first before this tool. Steps for safe variable update:
Args: module_path (str): Path to the module directory. facets_yaml (str): Content for facets.yaml file. dry_run (bool): If True, returns a preview of changes without making them. Default is True. Returns: str: Success message, diff preview (if dry_run=True), or error message. |
| write_resource_fileA | Writes a Terraform resource file (main.tf, variables.tf, etc.) to a module directory. Does NOT allow writing output(s).tf here. To update outputs.tf, use write_outputs(). Args: module_path (str): Path to the module directory. file_name (str): Name of the file to write (e.g., "main.tf", "variables.tf"). content (str): Content to write to the file. Returns: str: JSON string with success, message, instructions, and optional error/data fields. |
| get_output_type_detailsA | Get details for a specific output type from the Facets control plane. This tool calls the get_output_by_name_using_get API endpoint to retrieve information about an output type, including its properties and providers. Args: output_type (str): The output type name in format '@namespace/name' Returns: str: JSON-formatted string with result status, message, instructions, output type details or error information |
| find_output_types_with_providerB | This tool finds all output types that include a specific provider source, which can be used as inputs for module configurations. Args: provider_source (str): The provider source name to search for. Returns: str: JSON string containing the formatted output type information. |
| list_all_output_typesA | List all output types from the Facets control plane. Returns: str: List of output types. |
| write_outputsA | Write the outputs.tf file for a module with properly formatted Terraform locals block. Each field must have 'value' (any type: string, bool, number, list, dict) and 'sensitive' (bool) keys. Args: module_path (str): Path to the module directory (must contain facets.yaml). output_attributes (dict): Map where each field is: {"value": , "sensitive": bool} output_interfaces (dict): Map where each field is: {"value": , "sensitive": bool} Example: write_outputs( module_path="/path/to/module", output_attributes={ "instance_id": {"value": "aws_instance.example.id", "sensitive": False}, "config": {"value": {"region": "us-east-1", "zone": "a"}, "sensitive": False}, "api_keys": {"value": ["key1", "key2"], "sensitive": True}, "enabled": {"value": True, "sensitive": False} } ) Returns: str: JSON formatted success or error message. |
| write_readme_fileA | Writes a README.md file for the module directory. This tool is intended for AI to generate the README content for the module. Args: module_path (str): Path to the module directory. content (str): Content to write to README.md. Returns: str: JSON string with success status, message, instructions, and optional error/data. |
| write_generic_fileA | Writes a generic file to the module directory, except for .tf files, facets.yaml, or README.md. Can be used to add supporting files like Python or Bash scripts if needed by the module. Fails if trying to write a forbidden file. Checks working directory as in other tools. Args: module_path (str): Path to the module directory. file_name (str): Name of the file to write. content (str): Content to write to the file. Returns: str: JSON string with success status, message, instructions, and optional error/data. |
| edit_file_blockA | Apply surgical edits to specific blocks of text in a file. Make Sure you have Called FIRST_STEP_get_instructions first before this tool. Makes precise changes to files by finding and replacing exact text matches. This is safer than rewriting entire files. RESTRICTIONS:
Best practices:
Args: file_path (str): Path to the file to edit (must be within working directory) old_string (str): Exact text to find and replace (include context for uniqueness) new_string (str): Replacement text expected_replacements (int): Expected number of matches (default: 1, prevents unintended changes) Returns: str: JSON formatted response with success status, message, and optional error details |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| Fork Existing Module | Enhanced prompt to be used for forking an existing module. This will read from the `fork_module.md` file. Returns: The content of the prompt read from the markdown file. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| Facets Knowledge Base |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Facets-cloud/facets-module-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server