Skip to main content

flamapy-mcp: A Flamapy MCP server

Overview

A Model Context Protocol server for Flamapy operations. This server provides tools to analyze, validate, and interact with UVL (Universal Variability Language) feature models via Large Language Models.

Please note that flamapy-mcp is currently in early development. The functionality and available tools are subject to change and expansion as we continue to develop and improve the server.

Tools

  1. atomic_sets

    • Identifies atomic sets, which are groups of features that always appear together in all valid configurations.
    • Input:
      • content (string): UVL (universal variability language) feature model content.
    • Returns: A list of lists, where each inner list represents an atomic set of features.
  2. average_branching_factor

    • Calculates the average number of child features per parent feature, indicating model complexity.
    • Input:
      • content (string): UVL feature model content.
    • Returns: The average branching factor as a floating-point number.
  3. commonality

    • Measures the frequency of a feature in valid configurations, expressed as a percentage.
    • Inputs:
      • content (string): UVL feature model content.
      • config_file (string): The name of the feature to calculate commonality for.
    • Returns: The commonality of the specified feature as a float.
  4. configurations

    • Generates all possible valid configurations from the feature model.
    • Input:
      • content (string): UVL feature model content.
    • Returns: A list of all valid configurations.
  5. configurations_number

    • Returns the total number of valid configurations for the feature model.
    • Input:
      • content (string): UVL feature model content.
    • Returns: The total number of valid configurations as an integer.
  6. conflict_detection

    • Identifies conflicting constraints in the feature model. Useful for debugging model consistency.
    • Input:
      • content (string): UVL feature model content.
    • Returns: Details about the conflicting constraints found.
  7. core_features

    • Identifies features that are present in all valid configurations (mandatory features).
    • Input:
      • content (string): UVL feature model content.
    • Returns: A list of core feature names.
  8. count_leafs

    • Counts the number of leaf features (features with no children) in the model.
    • Input:
      • content (string): UVL feature model content.
    • Returns: The number of leaf features as an integer.
  9. dead_features

    • Identifies features that cannot be included in any valid configuration, often indicating model errors.
    • Input:
      • content (string): UVL feature model content.
    • Returns: A list of dead feature names.
  10. diagnosis

    • Helps find explanations for an invalid configuration by identifying conflicting constraints.
    • Input:
      • content (string): UVL feature model content.
    • Returns: A diagnosis of the issues in the feature model.
  11. estimated_number_of_configurations

    • Estimates the total number of configurations by considering all feature combinations, ignoring constraints.
    • Input:
      • content (string): UVL feature model content.
    • Returns: The estimated number of configurations as an integer.
  12. false_optional_features

    • Identifies features that seem optional but are mandatory due to model constraints.
    • Input:
      • content (string): UVL feature model content.
    • Returns: A list of false optional feature names.
  13. feature_ancestors

    • Returns all ancestor features for a given feature in the model hierarchy.
    • Inputs:
      • content (string): UVL feature model content.
      • config_file (string): The feature name for which to find ancestors.
    • Returns: A list of ancestor feature names.
  14. feature_inclusion_probability

    • Calculates the probability of each feature being included in a random valid configuration.
    • Input:
      • content (string): UVL feature model content.
    • Returns: A dictionary mapping each feature to its inclusion probability.
  15. filter

    • Filters and selects a subset of configurations based on specified criteria.
    • Inputs:
      • content (string): UVL feature model content.
      • config_file (string): The filtering criteria.
    • Returns: A list of configurations that match the criteria.
  16. homogeneity

    • Measures the similarity of configurations. A higher value (closer to 1) indicates more similar configurations.
    • Input:
      • content (string): UVL feature model content.
    • Returns: The homogeneity score as a float.
  17. leaf_features

    • Identifies all leaf features in the model (features with no children).
    • Input:
      • content (string): UVL feature model content.
    • Returns: A list of leaf feature names.
  18. max_depth

    • Finds the maximum depth of the feature tree, indicating the longest path from root to leaf.
    • Input:
      • content (string): UVL feature model content.
    • Returns: The maximum depth as an integer.
  19. sampling

    • Generates a sample of valid configurations from the feature model.
    • Input:
      • content (string): UVL feature model content.
    • Returns: A list of sample configurations.
  20. satisfiability

    • Checks if the feature model is valid and can produce at least one valid configuration.
    • Input:
      • content (string): UVL feature model content.
    • Returns: A boolean indicating if the model is satisfiable.
  21. satisfiable_configuration

    • Checks if a given configuration is valid according to the model's constraints.
    • Inputs:
      • content (string): UVL feature model content.
      • config_file (string): The configuration content to validate.
    • Returns: A boolean indicating if the configuration is satisfiable.
  22. unique_features

    • Identifies features that are part of a unique variability point.
    • Input:
      • content (string): UVL feature model content.
    • Returns: A list of unique feature names.
  23. variability

    • Calculates the ratio of variant features to the total number of features.
    • Input:
      • content (string): UVL feature model content.
    • Returns: The variability ratio as a float.
  24. variant_features

    • Identifies features that are neither core nor dead (i.e., truly optional).
    • Input:
      • content (string): UVL feature model content.
    • Returns: A list of variant feature names.

Installation

Using uv (recommended)

When using uv no specific installation is needed. We will use uvx to directly run flamapy-mcp.

Using PIP

Alternatively you can install flamapy-mcp via pip:

pip install flamapy-mcp

After installation, you can run it as a script using:

python -m flamapy_mcp

Configuration

Usage with Claude Desktop

Add this to your claude_desktop_config.json:

Using uvx
"mcpServers": {
  "flamapy": {
    "command": "uvx",
    "args": ["flamapy-mcp"]
  }
}
Using pip installation
"mcpServers": {
  "flamapy": {
    "command": "python",
    "args": ["-m", "flamapy_mcp"]
  }
}

Usage with VS Code

For quick installation, use one of the one-click install buttons below...

Install with UV in VS Code Install with UV in VS Code Insiders

For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open Settings (JSON).

Optionally, you can add it to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.

Note that the mcp key is not needed in the .vscode/mcp.json file.

{
  "mcp": {
    "servers": {
      "flamapy": {
        "command": "uvx",
        "args": ["flamapy-mcp"]
      }
    }
  }
}

Usage with Zed

Add to your Zed settings.json:

Using uvx
"context_servers": [
  "flamapy-mcp": {
    "command": {
      "path": "uvx",
      "args": ["flamapy-mcp"]
    }
  }
],
Using pip installation
"context_servers": {
  "flamapy-mcp": {
    "command": {
      "path": "python",
      "args": ["-m", "flamapy_mcp"]
    }
  }
},

Usage with Zencoder

  1. Go to the Zencoder menu (...)
  2. From the dropdown menu, select Agent Tools
  3. Click on the Add Custom MCP
  4. Add the name (i.e. flamapy) and server configuration from below, and make sure to hit the Install button
Using uvx
{
    "command": "uvx",
    "args": ["flamapy-mcp"]
}

Debugging

You can use the MCP inspector to debug the server. For uvx installations:

npx @modelcontextprotocol/inspector uvx flamapy-mcp

Running tail -n 20 -f ~/Library/Logs/Claude/mcp*.log will show the logs from the server and may help you debug any issues.

Development

If you are doing local development, you can test your changes using the MCP inspector. See Debugging for run instructions.

Collaborators

Created in collaboration with the Laboratorio de Bases de Datos (Database Lab), LBD.

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Metadata

Release files for flamapy-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flamapy-mcp 0.1.1
File Size Uploaded
flamapy_mcp-0.1.1.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flamapy-mcp 0.1.1
File Interpreter ABI Platform
flamapy_mcp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 19.8 kB

Release files / flamapy_mcp-0.1.1.tar.gz

Download URL flamapy_mcp-0.1.1.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
eae345a409d3bc04afe98dbab3df78ad0915c0f4584ddd563b038717e8fe272c
BLAKE2b-256 checksum
How to use checksums
e7dd7ada4c1e1eab347fbb865394027e9691a2c5aec5948aa9b1df5f06f11418
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Release files / flamapy_mcp-0.1.1-py3-none-any.whl

Download URL flamapy_mcp-0.1.1-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be99e1e9ac2930b98291d70a3ac97effea201d527e8c9928a8a02be759be85f9
BLAKE2b-256 checksum
How to use checksums
76e5075e0597e5de9817425d197798b86b0a752afdd3f592903cbf08314e2777
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page