Skip to main content
Glama
IaC Memory MCP Server
by AgentWong

IaC メモリ MCP サーバー

Terraform および Ansible リソースのバージョン追跡と関係マッピングに重点を置き、Infrastructure-as-Code (IaC) コンポーネントに永続的なメモリ ストレージを提供することで、Claude AI の機能を強化する Model Context Protocol (MCP) サーバーです。

[!注記]
これは、AIを使用する人(私)が専門知識(Pythonの知識不足)を持たない場合のAIの能力状態を判断するための個人的なプロジェクトでした。コストがかかりすぎるため、このプロジェクトをこれ以上開発・維持するつもりはありません。

概要

IaC メモリ MCP サーバーは、次の機能を提供することで、IaC コンポーネントの正確でバージョン対応のコンテキストを維持するという課題に対処します。

  • IaC コンポーネントの永続ストレージとバージョン追跡

  • URIベースのアクセスによる階層的なリソース構成

  • コンポーネント間の包括的な関係マッピング

  • バージョン固有のドキュメント管理

  • スキーマ検証と時間メタデータ追跡

  • 自動化された関係分析と洞察

Related MCP server: Chronos MCP

コアコンポーネント

リソース管理

サーバーは、階層型 URI を使用した高度なリソース管理システムを実装します。

リソースURI構造

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

サポートされているプラットフォーム:

  • テラフォーム

  • アンシブル

  • iac(一般インフラ事業体向け)

URIの例:

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

リソーステンプレート

サーバーは、標準化されたアクセス パターン用の動的なリソース テンプレートを提供します。

  • Terraform プロバイダー情報: resources://terraform/providers/{provider_name}

  • リソースタイプの詳細: resources://terraform/resources/{provider_name}/{resource_type}

  • Ansible コレクションデータ: resources://ansible/collections/{collection_name}

  • モジュール情報: resources://ansible/modules/{collection_name}/{module_name}

プロンプト

サーバーは、IaC コンポーネントの検出と分析のために 4 つの特殊なプロンプトを実装します。

検索リソース

  • 目的: IaC リソースの検索

  • 引数:

    • provider : プロバイダー名

    • resource_type : リソースタイプ

  • 戻り値: 指定されたプロバイダの特定のリソースに関する情報

エンティティを分析する

  • 目的: 実体とその関係を分析する

  • 引数:

    • entity_id : エンティティID

    • include_relationships : 関係を含める

  • 戻り値: 名前、タイプ、観察結果を含む詳細なエンティティ分析

terraform_provider

  • 目的: Terraformプロバイダーに関する情報を取得する

  • 引数:

    • provider_name : Terraformプロバイダーの名前(必須)

    • version : 照会する特定のバージョン(オプション)

  • 戻り値: 指定されたバージョンの詳細なプロバイダ情報

ansible_モジュール

  • 目的: Ansibleモジュールに関する情報を取得する

  • 引数:

    • collection_name : Ansibleコレクションの名前(必須)

    • module_name : モジュールの名前(必須)

    • version : 照会する特定のバージョン(オプション)

  • 戻り値: 指定されたバージョンの詳細なモジュール情報

ツール

サーバーは、IaC コンポーネント管理用の包括的なツールを実装します。

Terraformツール

  • get_terraform_provider_info : バージョンやリソースを含む詳細なプロバイダー情報を取得します

  • list_provider_resources : 特定のプロバイダーで利用可能なすべてのリソースを一覧表示する

  • get_terraform_resource_info : 特定のリソースタイプに関する詳細情報を取得する

  • add_terraform_provider : バージョン管理された新しいプロバイダーを登録する

  • add_terraform_resource : スキーマ付きのリソース定義を追加する

  • update_provider_version : 新しいドキュメントでプロバイダーのバージョンを更新します

Ansibleツール

  • get_ansible_collection_info : Ansibleコレクションの詳細情報を取得する

  • list_ansible_collections : 利用可能なすべてのAnsibleコレクションを一覧表示します

  • get_collection_version_history : コレクションのバージョン履歴を表示する

  • get_ansible_module_info : 特定のモジュールに関する詳細情報を取得する

  • list_collection_modules : コレクション内のすべてのモジュールを一覧表示する

  • get_module_version_compatibility : モジュールのバージョン互換性を確認する

  • add_ansible_collection : 新しいAnsibleコレクションを登録する

  • add_ansible_module : 検証とドキュメントを備えた新しいモジュールを追加する

エンティティ操作

  • create_entity : 新しいインフラストラクチャエンティティを作成する

  • update_entity : 既存のエンティティ構成を変更する

  • delete_entity : リレーションシップをクリーンアップしてエンティティを削除する

  • view_relationships : エンティティの依存関係と関係を分析する

構成

サーバーは環境変数による構成をサポートしています:

  • DATABASE_URL : SQLiteデータベースの場所

  • MCP_DEBUG : 設定するとデバッグログを有効にする

  • MCP_TEST_MODE : データベースリセットのテストモードを有効にする

開発用に、 .envファイルを作成します。

DATABASE_URL=sqlite:////path/to/db.sqlite
MCP_DEBUG=1
MCP_TEST_MODE=1

Claude Desktopとの統合

開発セットアップ

"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"
      }
  }
}

生産体制

"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"
      }
  }
}

発達

地域開発

# Install dependencies
uv sync

# Run tests
uv run pytest

# Development server with MCP Inspector
npx @modelcontextprotocol/inspector uv run iac-memory-mcp-server

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。

Available Tools

23 tools
add_ansible_collectionB

Add a new Ansible collection to the memory store with version and documentation information

Inputs: name (required), version (required), source_url (required), doc_url (required).

add_ansible_moduleC

Add a new Ansible module definition with its schema and version information

Inputs: collection (required), name (required), module_type (required), schema (required), +2 more.

add_terraform_providerB

Add a new Terraform provider to the memory store with version and documentation information

Inputs: name (required), version (required), source_url (required), doc_url (required).

add_terraform_resourceC

Add a new Terraform resource definition with its schema and version information

Inputs: name (required), resource_type (required), schema (required), version (required), +2 more.

create_entityC

Create a new entity in the knowledge graph with optional initial observations

Inputs: name (required), type (required), observation.

delete_entityC

Remove an entity and its relationships from the knowledge graph

Inputs: id (required).

get_ansible_collection_infoC

Retrieve comprehensive information about an Ansible collection

Inputs: collection_name (required).

get_ansible_module_infoC

Retrieve comprehensive information about an Ansible module including schema and documentation

Inputs: collection_name (required), module_name (required).

get_collection_version_historyA

Retrieve version history for a specific Ansible collection

Inputs: collection_name (required).

get_module_version_compatibilityC

Check module compatibility across collection versions

Inputs: collection_name (required), module_name (required), version (required).

get_provider_version_historyB

Retrieve version history for a specific Terraform provider

Inputs: provider_name (required).

get_resource_version_compatibilityC

Check resource compatibility across provider versions

Inputs: provider_name (required), resource_name (required), version (required).

get_terraform_provider_infoC

Retrieve comprehensive information about a Terraform provider

Inputs: provider_name (required).

get_terraform_resource_infoC

Retrieve comprehensive information about a Terraform resource including schema and documentation

Inputs: provider_name (required), resource_name (required).

list_ansible_collectionsC

List all cached Ansible collections with basic metadata

Inputs: filter_criteria.

list_provider_resourcesC

List all resources associated with a specific Terraform provider

Inputs: provider_name (required), filter_criteria.

list_terraform_providersB

List all cached Terraform providers with basic metadata

Inputs: filter_criteria.

update_collection_versionC

Update an existing Ansible collection's version information and documentation links

Inputs: collection_id (required), new_version (required), new_source_url, new_doc_url.

update_entityC

Update an existing entity's properties and add new observations

Inputs: id (required), name, type, observation.

update_module_versionC

Update an existing Ansible module's schema and related information

Inputs: module_id (required), new_schema (required), new_version, new_doc_url.

update_provider_versionC

Update an existing Terraform provider's version information and documentation links

Inputs: provider_name (required), new_version (required), new_source_url, new_doc_url.

update_resource_schemaC

Update an existing Terraform resource's schema and related information

Inputs: resource_id (required), new_schema (required), new_version, new_doc_url.

view_relationshipsC

Retrieve all relationships and observations for a specific entity

Inputs: entity_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 23 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific IaC components (Ansible vs. Terraform) and operations (add/get/list/update). However, there is some potential overlap between 'create_entity' and the various 'add_' tools, as both involve storing information, though 'create_entity' seems more generic for a knowledge graph. The descriptions help clarify boundaries, but an agent might need to infer when to use 'create_entity' versus the specific 'add_' tools.

    Naming Consistency5/5

    Tool names follow a highly consistent verb_noun pattern throughout, with clear and predictable conventions. All tools use snake_case, and verbs like 'add', 'get', 'list', 'update', 'delete', and 'view' are applied consistently across similar resource types (e.g., 'add_ansible_collection', 'get_ansible_collection_info', 'list_ansible_collections'). This makes the tool set easy to navigate and understand.

    Tool Count3/5

    With 23 tools, the count is on the higher side for an MCP server, bordering on heavy. While the server covers both Ansible and Terraform domains comprehensively, the number of tools might feel overwhelming or lead to redundancy (e.g., separate tools for version history and compatibility checks). A more streamlined set could improve usability without losing functionality, placing it in the borderline range.

    Completeness5/5

    The tool surface provides complete CRUD/lifecycle coverage for both Ansible and Terraform components, including adding, retrieving, listing, updating, and deleting entities. It also handles version management, compatibility checks, and relationship viewing for a knowledge graph. No obvious gaps exist; agents can perform all expected operations for managing IaC metadata and entities without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides persistent memory capabilities for Claude Code using Neo4j graph database to track development tasks, code patterns, solutions, and their relationships across sessions and projects, enabling contextual assistance and pattern recognition.
      11
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides Claude with a persistent local memory and structured knowledge graph to track project states, tasks, and historical decisions across different chat sessions. It enables users to recall information using keyword relevance, time-travel queries, and dependency analysis for complex project management.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Provides persistent memory for Claude with hierarchical categorization, cross-corpus recall, session journals, and customizable persona, enabling memory continuity across sessions.
      7
      MIT