This Terraform provider allows you to manage Devgraph resources including MCP endpoints, model providers, and models.
Add the following to your Terraform configuration:
terraform {
required_providers {
devgraph = {
source = "arctir/devgraph"
}
}
}
provider "devgraph" {
host = "https://api.devgraph.ai"
access_token = var.devgraph_access_token
}The provider supports two methods of authentication:
- Configuration block - Set
access_tokenin the provider configuration - Environment variables - Set
DEVGRAPH_ACCESS_TOKENandDEVGRAPH_HOST
Manages MCP (Model Context Protocol) endpoint configurations.
resource "devgraph_mcp_endpoint" "example" {
name = "my-mcp-server"
url = "https://mcp.example.com/v1"
description = "Example MCP endpoint"
headers = {
"X-Custom-Header" = "value"
}
devgraph_auth = false
supports_resources = true
active = true
allowed_tools = ["tool1", "tool2"]
}Manages model provider configurations (OpenAI, Anthropic, xAI).
resource "devgraph_model_provider" "anthropic" {
type = "anthropic"
name = "my-anthropic-provider"
api_key = var.anthropic_api_key
default = true
}Supported provider types:
openai- OpenAI modelsanthropic- Anthropic (Claude) modelsxai- xAI (Grok) models
Manages model configurations.
resource "devgraph_model" "claude_opus" {
name = "claude-3-opus-20240229"
description = "Claude 3 Opus model"
provider_id = devgraph_model_provider.anthropic.id
default = true
}make build
# or
go build -o terraform-provider-devgraphmake test
# or
go test ./...Documentation is automatically generated from resource schemas and examples:
make docs
# or
tfplugindocs generate --provider-name devgraphTo validate documentation:
make docs-validate
# or
tfplugindocs validateTo use a locally built provider:
-
Build the provider:
go build -o terraform-provider-devgraph
-
Create a
.terraformrcfile in your home directory:provider_installation { dev_overrides { "arctir/devgraph" = "/path/to/devgraph-terraform-provider" } direct {} }
-
Run Terraform commands as usual. Terraform will use your local build.
See the examples directory for complete usage examples.
Contributions are welcome! Please see CONTRIBUTING.md for details.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.