IAC Memory MCP Server
iac-memory-mcp-server
MCP Server for Infrastructure-as-Code (IaC) resource management and analysis.
Components
Resources
The server implements a resource management system with:
- Custom resource:// URI scheme for accessing internal resources
- Each resource has a name, content, and configurable MIME type
- Resources can represent IaC configurations, documentation, and analysis results
Prompts
The server provides IaC-specific prompts for resource discovery and analysis:
search_resources
Search for Infrastructure-as-Code resources across providers:
analyze_entity
Analyze infrastructure entities and their relationships:
Tools
The server implements comprehensive CRUD operations:
Entity Management and Relationships:
- create_entity: Create new infrastructure entities
- read_entity: Retrieve entity details
- update_entity: Modify existing entities
- delete_entity: Remove entities and related data
- view_relationships: Analyze entity relationships and dependenciesCopy# View all relationships result = await session.call_tool("view_relationships", {}) # View relationships for specific entity result = await session.call_tool("view_relationships", { "entity_id": "entity-123" })
Resource Management:
- add_resource: Add new resourcesCopy# Add a new resource with custom MIME type result = await session.call_tool("add_resource", { "name": "aws-s3-config", "content": "bucket_name: my-bucket\nregion: us-east-1", "mime_type": "application/yaml" # Optional }) # Add plain text resource result = await session.call_tool("add_resource", { "name": "deployment-notes", "content": "Deployment steps for production..." })
Configuration
The server can be configured through environment variables:
DATABASE_URL
: Path to SQLite database file (default: in-memory)CLIENT_PORT
: Port for MCP Inspector client UI (default: 5173)SERVER_PORT
: Port for MCP Inspector proxy server (default: 3000)
For development, you can also use a .env
file:
Quickstart
Install
Claude Desktop
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
Development
Building and Publishing
To prepare the package for distribution:
- Sync dependencies and update lockfile:
- Build package distributions:
This will create source and wheel distributions in the dist/
directory.
- Publish to PyPI:
Note: You'll need to set PyPI credentials via environment variables or command flags:
- Token:
--token
orUV_PUBLISH_TOKEN
- Or username/password:
--username
/UV_PUBLISH_USERNAME
and--password
/UV_PUBLISH_PASSWORD
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm
with this command:
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
A custom Memory MCP Server that acts as a cache for Infrastructure-as-Code information, allowing users to store, summarize, and manage notes with a custom URI scheme and simple resource handling.