Back to Teleport

app-{{service}}-mcp.yaml

docs/pages/includes/mcp-access/integration-teleport-app.mdx

19.0.1-dev1.6 KB
Original Source

You can register an MCP application in Teleport by defining it in your Teleport Application Service configuration, or by using dynamic registration with tctl or Terraform:

<Tabs> <TabItem label="Static configuration"> Replace <Var name="MCP_HOST"/> with the host running the {{serviceName}} MCP server: ```yaml app_service: enabled: "yes" apps: - name: "{{service}}-mcp" uri: "mcp+http://<Var name="MCP_HOST"/>:{{port}}/mcp" labels: env: dev service: {{service}} ```

Restart the Application Service. </TabItem>

<TabItem label="tctl"> Create an `app` resource definition file named `app-{{service}}-mcp.yaml`. Replace <Var name="MCP_HOST" /> with the host running the {{serviceName}} MCP server: ```yaml # app-{{service}}-mcp.yaml kind: app version: v3 metadata: name: {{service}}-mcp labels: env: dev service: {{service}} spec: uri: "mcp+http://<Var name="MCP_HOST" />:{{port}}/mcp" ```

Create the app resource with:

code
$ tctl create -f app-{{service}}-app.yaml
</TabItem> <TabItem label="Terraform"> Create a `teleport_app` resource in terraform. Replace <Var name="MCP_HOST" /> with the host running the {{serviceName}} MCP server: ```hcl resource "teleport_app" "grafana" { version = "v3" metadata = { name = "grafana" labels = { "teleport.dev/origin" = "dynamic" "env" = "dev" "service" = "{{service}}" } }

spec = { uri = "mcp+http://<Var name="MCP_HOST" />:{{port}}/mcp" } }

Apply the configuration:
```code
$ terraform apply
</TabItem> </Tabs>