Cover image
IAC  - 内存MCP-Server-Project
Public

IAC - 内存MCP-Server-Project

Try Now
2025-01-27

这是一个个人项目,用于确定Claude 3.5十四行诗是否可以编写适中复杂的MCP服务器代码(Python)。

3 years

Works with Finder

1

Github Watches

3

Github Forks

5

Github Stars

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.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Andris Teikmanis
  • Latvian GPT assistant for developing GPT applications

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Khalid kalib
  • Write professional emails

  • https://tovuti.be
  • Oede knorrepot die vasthoudt an de goeie ouwe tied van 't boerenleven

  • ANGEL LEON
  • A world class elite tech co-founder entrepreneur, expert in software development, entrepreneurship, marketing, coaching style leadership and aligned with ambition for excellence, global market penetration and worldy perspectives.

  • Gil kaminski
  • Make sure you are post-ready before you post on social media

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

  • zhaoyunxing92
  • MCP(消息连接器协议)服务

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

    Reviews

    3 (1)
    Avatar
    user_1tIvEbiI
    2025-04-16

    I recently started using the iac-memory-mcp-server-project by AgentWong, and it has significantly streamlined my workflow. The server's robust capabilities and efficient memory management make it a reliable choice for my projects. The documentation is clear, and the welcoming information helps new users get started quickly. Highly recommend checking it out on GitHub!