IaC Memory MCP Server
Enhances Claude AI with persistent memory storage for Infrastructure-as-Code components, supporting version tracking and relationship mapping for Terraform and Ansible resources.
AgentWong
Tools
get_ansible_collection_info
Retrieve comprehensive information about an Ansible collection
list_provider_resources
List all resources associated with a specific Terraform provider
get_terraform_provider_info
Retrieve comprehensive information about a Terraform provider
list_terraform_providers
List all cached Terraform providers with basic metadata
get_provider_version_history
Retrieve version history for a specific Terraform provider
get_terraform_resource_info
Retrieve comprehensive information about a Terraform resource including schema and documentation
list_ansible_collections
List all cached Ansible collections with basic metadata
get_collection_version_history
Retrieve version history for a specific Ansible collection
get_ansible_module_info
Retrieve comprehensive information about an Ansible module including schema and documentation
get_resource_version_compatibility
Check resource compatibility across provider versions
add_terraform_provider
Add a new Terraform provider to the memory store with version and documentation information
update_provider_version
Update an existing Terraform provider's version information and documentation links
add_terraform_resource
Add a new Terraform resource definition with its schema and version information
update_resource_schema
Update an existing Terraform resource's schema and related information
add_ansible_collection
Add a new Ansible collection to the memory store with version and documentation information
update_collection_version
Update an existing Ansible collection's version information and documentation links
add_ansible_module
Add a new Ansible module definition with its schema and version information
update_module_version
Update an existing Ansible module's schema and related information
get_module_version_compatibility
Check module compatibility across collection versions
create_entity
Create a new entity in the knowledge graph with optional initial observations
update_entity
Update an existing entity's properties and add new observations
delete_entity
Remove an entity and its relationships from the knowledge graph
view_relationships
Retrieve all relationships and observations for a specific entity
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 nameresource_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 IDinclude_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 resourceslist_provider_resources
: List all resources available for a specific providerget_terraform_resource_info
: Get detailed information about a specific resource typeadd_terraform_provider
: Register new providers with versioningadd_terraform_resource
: Add resource definitions with schemasupdate_provider_version
: Update provider versions with new documentation
Ansible Tools
get_ansible_collection_info
: Get detailed information about an Ansible collectionlist_ansible_collections
: List all available Ansible collectionsget_collection_version_history
: View version history of a collectionget_ansible_module_info
: Get detailed information about a specific modulelist_collection_modules
: List all modules in a collectionget_module_version_compatibility
: Check version compatibility of modulesadd_ansible_collection
: Register new Ansible collectionsadd_ansible_module
: Add new modules with validation and documentation
Entity Operations
create_entity
: Create new infrastructure entitiesupdate_entity
: Modify existing entity configurationsdelete_entity
: Remove entities with relationship cleanupview_relationships
: Analyze entity dependencies and relationships
Configuration
The server supports configuration through environment variables:
DATABASE_URL
: SQLite database locationMCP_DEBUG
: Enable debug logging when setMCP_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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Gitingest-MCP
An MCP server for gitingest. It allows MCP clients like Claude Desktop, Cursor, Cline etc to quickly extract information about Github repositories including repository summaries, project directory structure, file contents, etc
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor