IaC Memory MCP Server

IaC Memory MCP Server

Mirror of

MCP-Mirror

研究与数据
访问服务器

README

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.

推荐服务器

Crypto Price & Market Analysis MCP Server

Crypto Price & Market Analysis MCP Server

一个模型上下文协议 (MCP) 服务器,它使用 CoinCap API 提供全面的加密货币分析。该服务器通过一个易于使用的界面提供实时价格数据、市场分析和历史趋势。 (Alternative, slightly more formal and technical translation): 一个模型上下文协议 (MCP) 服务器,利用 CoinCap API 提供全面的加密货币分析服务。该服务器通过用户友好的界面,提供实时价格数据、市场分析以及历史趋势数据。

精选
TypeScript
MCP PubMed Search

MCP PubMed Search

用于搜索 PubMed 的服务器(PubMed 是一个免费的在线数据库,用户可以在其中搜索生物医学和生命科学文献)。 我是在 MCP 发布当天创建的,但当时正在度假。 我看到有人在您的数据库中发布了类似的服务器,但还是决定发布我的。

精选
Python
mixpanel

mixpanel

连接到您的 Mixpanel 数据。从 Mixpanel 分析查询事件、留存和漏斗数据。

精选
TypeScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

这个服务器通过将复杂问题分解为顺序步骤来促进结构化的问题解决,支持修订,并通过完整的 MCP 集成来实现多条解决方案路径。

精选
Python
Nefino MCP Server

Nefino MCP Server

为大型语言模型提供访问德国可再生能源项目新闻和信息的能力,允许按地点、主题(太阳能、风能、氢能)和日期范围进行筛选。

官方
Python
Vectorize

Vectorize

将 MCP 服务器向量化以实现高级检索、私有深度研究、Anything-to-Markdown 文件提取和文本分块。

官方
JavaScript
Mathematica Documentation MCP server

Mathematica Documentation MCP server

一个服务器,通过 FastMCP 提供对 Mathematica 文档的访问,使用户能够从 Wolfram Mathematica 检索函数文档和列出软件包符号。

本地
Python
kb-mcp-server

kb-mcp-server

一个 MCP 服务器,旨在实现便携性、本地化、简易性和便利性,以支持对 txtai “all in one” 嵌入数据库进行基于语义/图的检索。任何 tar.gz 格式的 txtai 嵌入数据库都可以被加载。

本地
Python
Research MCP Server

Research MCP Server

这个服务器用作 MCP 服务器,与 Notion 交互以检索和创建调查数据,并与 Claude Desktop Client 集成以进行和审查调查。

本地
Python
Cryo MCP Server

Cryo MCP Server

一个API服务器,实现了模型补全协议(MCP),用于Cryo区块链数据提取。它允许用户通过任何兼容MCP的客户端查询以太坊区块链数据。

本地
Python