Skip to main content

Flamapy MCP server to expose MCP tools to execute flamapy operations

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flamapy_mcp-0.1.1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flamapy_mcp-0.1.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file flamapy_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: flamapy_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for flamapy_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 eae345a409d3bc04afe98dbab3df78ad0915c0f4584ddd563b038717e8fe272c
MD5 88c45ea676f86e7f77d64e5d1aab04e5
BLAKE2b-256 e7dd7ada4c1e1eab347fbb865394027e9691a2c5aec5948aa9b1df5f06f11418

See more details on using hashes here.

File details

Details for the file flamapy_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: flamapy_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for flamapy_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be99e1e9ac2930b98291d70a3ac97effea201d527e8c9928a8a02be759be85f9
MD5 731e6d9233e04d871f024fa8044a4213
BLAKE2b-256 76e5075e0597e5de9817425d197798b86b0a752afdd3f592903cbf08314e2777

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page