Iac Memoryproject
    Iac Memoryproject

    Iac Memoryproject

    This is a personal project to determine whether or not Claude 3.5 Sonnet can write moderately complex MCP Server code (Python).

    1.4

    GitHub Stats

    Stars

    5

    Forks

    4

    Release Date

    4/15/2025

    about 2 months ago

    Detailed Description

    iac memory mcp server

    a model context protocol (mcp) server that enhances claude ai's capabilities by providing persistent memory storage for infrastructure-as-code (iac) components, with a focus on version tracking and relationship mapping for terraform and ansible resources.

    [!note]
    this was a personal project to determine the state of ai's ability if the person using it (me) doesn't have subject matter expertise (lack of python knowledge). since it has become rather cost prohibitive, i do not intend to develop or maintain this project further.

    overview

    the iac memory mcp server addresses the challenge of maintaining accurate, version-aware context for iac components by providing:

    • persistent storage and version tracking for iac components
    • hierarchical resource organization with uri-based access
    • comprehensive relationship mapping between components
    • version-specific documentation management
    • schema validation and temporal metadata tracking
    • automated relationship analysis and insights

    core components

    resource management

    the server implements a sophisticated resource management system with hierarchical uris:

    resource uri structure

    resources://<platform>/<category>/<name>
    

    supported platforms:

    • terraform
    • ansible
    • iac (for general infrastructure entities)

    example uris:

    resources://terraform/providers/aws
    resources://terraform/resources/aws/s3_bucket
    resources://ansible/collections/community.aws
    resources://ansible/modules/community.aws/s3_bucket
    

    resource templates

    the server provides dynamic resource templates for standardized access patterns:

    • terraform provider information: resources://terraform/providers/{provider_name}
    • resource type details: resources://terraform/resources/{provider_name}/{resource_type}
    • ansible collection data: resources://ansible/collections/{collection_name}
    • module information: resources://ansible/modules/{collection_name}/{module_name}

    prompts

    the server implements four specialized prompts for iac component discovery and analysis:

    search_resources

    • purpose: search for iac resources
    • arguments:
      • provider: provider name
      • resource_type: resource type
    • returns: information about specific resources for the given provider

    analyze_entity

    • purpose: analyze an entity and its relationships
    • arguments:
      • entity_id: entity id
      • include_relationships: include relationships
    • returns: detailed entity analysis including name, type, and observations

    terraform_provider

    • purpose: get information about a terraform provider
    • arguments:
      • provider_name: name of the terraform provider (required)
      • version: specific version to query (optional)
    • returns: detailed provider information for the specified version

    ansible_module

    • purpose: get information about an ansible module
    • arguments:
      • collection_name: name of the ansible collection (required)
      • module_name: name of the module (required)
      • version: specific version to query (optional)
    • returns: detailed module information for the specified version

    tools

    the server implements comprehensive tooling for iac component management:

    terraform tools

    • get_terraform_provider_info: retrieve detailed provider information including version and resources
    • list_provider_resources: list all resources available for a specific provider
    • get_terraform_resource_info: get detailed information about a specific resource type
    • add_terraform_provider: register new providers with versioning
    • add_terraform_resource: add resource definitions with schemas
    • update_provider_version: update provider versions with new documentation

    ansible tools

    • get_ansible_collection_info: get detailed information about an ansible collection
    • list_ansible_collections: list all available ansible collections
    • get_collection_version_history: view version history of a collection
    • get_ansible_module_info: get detailed information about a specific module
    • list_collection_modules: list all modules in a collection
    • get_module_version_compatibility: check version compatibility of modules
    • add_ansible_collection: register new ansible collections
    • add_ansible_module: add new modules with validation and documentation

    entity operations

    • create_entity: create new infrastructure entities
    • update_entity: modify existing entity configurations
    • delete_entity: remove entities with relationship cleanup
    • view_relationships: analyze entity dependencies and relationships

    configuration

    the server supports configuration through environment variables:

    • database_url: sqlite database location
    • mcp_debug: enable debug logging when set
    • mcp_test_mode: enable test mode for database resets

    for development, create a .env file:

    database_url=sqlite:////path/to/db.sqlite
    mcp_debug=1
    mcp_test_mode=1
    

    integration with claude desktop

    development setup

    "mcpservers": {
      "iac-memory": {
        "command": "uv",
        "args": [
          "--directory",
          "/path/to/iac-memory-mcp-server",
          "run",
          "iac-memory-mcp-server"
        ]
        "env": {
              "database_url": "sqlite:////home/herman/iac.db"
          }
      }
    }
    

    production setup

    "mcpservers": {
      "iac-memory": {
        "command": "uvx",
        "args": [
            "--from",
            "git+https://github.com/agentwong/iac-memory-mcp-server.git",
            "python",
            "-m",
            "iac_memory_mcp_server"
        ],
        "env": {
              "database_url": "sqlite:////home/herman/iac.db"
          }
      }
    }
    

    development

    local development

    # install dependencies
    uv sync
    
    # run tests
    uv run pytest
    
    # development server with mcp inspector
    npx @modelcontextprotocol/inspector uv run iac-memory-mcp-server
    

    license

    this project is licensed under the mit license - see the license file for details.

    About the Project

    This app has not been claimed by its owner yet.

    Claim Ownership

    Receive Updates

    Security Updates

    Get notified about trust rating changes

    to receive email notifications.