Terraform-MCP-Server
Этот проект предоставляет mcp servers, который открывает доступ к операциям Terraform «инфраструктура как код» через естественный язык. Он позволяет LLM выполнять команды Terraform и получать информацию об инфраструктуре без необходимости знания специфического синтаксиса команд.
# Terraform MCP Assistant
A FastMCP-based server that provides natural language interface to Terraform operations. This assistant allows you to manage your infrastructure using simple English commands instead of remembering specific Terraform syntax.
Features
- Natural language processing of Terraform commands
- Execution plan visualization
- State inspection and management
- Infrastructure deployment and destruction
- Configuration documentation
- Automatic workspace validation
- Error handling and formatted output
Installation
- Clone the repository:
git clone https://github.com/yourusername/terraform-mcp-server.git
cd terraform-mcp-server
- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\\Scripts\\activate
- Install dependencies:
pip install -r requirements.txt
- Optional: Install Graphviz for plan visualization:
- Windows: Download from Graphviz Download Page
- Linux:
sudo apt-get install graphviz - macOS:
brew install graphviz
Configuration
- Set up environment variables (optional):
export TERRAFORM_WORKSPACE="/path/to/terraform/workspace"
export LOG_LEVEL="INFO"
- Place your Terraform configuration files in the workspace directory.
Usage
- Start the MCP server:
python src/main.py
- Example commands:
- "Initialize the Terraform workspace"
- "What will change if I apply?"
- "Show me the current state"
- "Apply the configuration"
- "List all resources"
- "Destroy the infrastructure"
Project Structure
terraform-mcp-assistant/
├── docs/ # Documentation
├── examples/ # Example Terraform configurations
├── src/ # Source code
│ ├── handlers/ # Command handlers
│ ├── main.py # Entry point
│ └── config.py # Configuration management
├── tests/ # Test files
├── .env # Environment variables (not in VCS)
└── README.md # This file
Development
- Install development dependencies:
pip install -r requirements-dev.txt
- Run tests:
pytest
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
Recommend MCP Servers 💡
secureframe-mcp-server
This Model Context Protocol server provides read-only access to Secureframe's compliance automation platform for AI assistants like Claude and Cursor. It allows querying security controls, monitoring compliance tests, and accessing audit data across various frameworks such as SOC 2, ISO 27001, CMMC, and FedRAMP.
mcp-konnect
A Model Context Protocol (MCP) server enabling AI assistants to interact with Kong Konnect APIs for querying and analyzing gateway configurations, traffic, and analytics.
mcp-server-box
An MCP server that integrates with the Box API to provide capabilities for file search, text extraction, AI-based querying, data extraction, and document generation, enabling efficient management and processing of Box data.
ks-mcp-server
The KubeSphere MCP Server is a Model Context Protocol(MCP) server that provides integration with KubeSphere APIs, enabling to get resources from KubeSphere. Divided into four tools modules: Workspace Management, Cluster Management, User and Roles, Extensions Center.
oliverbenns/digitalocean-mcp
MCP server for DigitalOcean to list apps, view alerts and deployments
kom
kom 是一个用于 Kubernetes 操作的工具,SDK级的kubectl、client-go的使用封装。并且支持作为管理k8s 的 MCP server。