---
title: environment_link_create
url: "/docs/ai-agents/mcp-tools/environment-links/environment_link_create/"
canonical_url: https://docs.blossom88.com/docs/ai-agents/mcp-tools/environment-links/environment_link_create/
markdown_url: https://docs.blossom88.com/docs/ai-agents/mcp-tools/environment-links/environment_link_create.md
summary: Link an Environment to a Database or Cache; Blossom sets the connection URL
  variable, such as DATABASE_URL.
categories:
- mcp
- reference
---

# environment_link_create

Link an Environment to a Database or Cache; Blossom sets the connection URL variable, such as DATABASE_URL.

| | |
|---|---|
| Access | Changes Blossom |
| Same as | [`blossom environment_link:create`](/docs/reference/cli/environment_link/create/) |

## Arguments

| Argument | Type | Description |
|---|---|---|
| `data` | object | The link, as in environment_link.yml. Required. |
| `data.environment_id` | string | Environment id. |
| `data.target_type` | string | DatabaseInstance or CacheInstance. |
| `data.target_id` | string | Database or Cache id. |
| `data.var_name` | string | Variable that gets the connection URL, such as DATABASE_URL. |

## Example

```json
{"data":{"clone_url":"https://github.com/acme/shop","services":[{"name":"web","command":"web","port":3000,"publicly_exposed":true}]}}
```
