Grafana Cloud

MCP servers API

Use MCP server integrations to connect external Model Context Protocol servers to Assistant. MCP servers provide tools that Assistant can use during conversations, such as querying external APIs, searching documentation, or performing actions in third-party systems.

MCP server integrations have two scopes:

  • Tenant integrations are available to all users in the organization. Use tenant integrations when you manage MCP servers through the HTTP API, because they apply for all users across the organization.
  • User integrations are available only to the identity that created them. You can’t create user integrations on behalf of other users.

The API path for MCP servers is /integrations.

Examples use the base URL and service account token described in Grafana Assistant HTTP API reference.

Create an MCP server

Register a new MCP server integration.

Endpoint

POST /integrations

Permissions

Integration scopeRequired permission
usergrafana-assistant-app.mcps.user:create
tenantgrafana-assistant-app.mcps.tenant:create

Request

Send a JSON request body.

FieldRequiredDescription
nameYesDisplay name for the integration.
scopeYesIntegration scope: user or tenant.
typeYesIntegration type. Use mcp.
enabledYesWhether the integration is active.
applicationsYesApplications the integration applies to. Valid values: assistant, loop, all. Defaults to ["all"] when empty.
configurationNoMCP server configuration.
customHeadersNoCustom HTTP headers sent to the MCP server. Each entry requires key and value. Values are encrypted and redacted in responses.
descriptionNoA short description of the integration.

Configuration

The configuration field contains MCP server settings.

FieldDescription
urlThe MCP server URL.
toolPreferencesA map of tool names to enabled or disabled. Controls whether each tool is available to Assistant. Tools not listed default to enabled.
toolApprovalPoliciesA map of tool names to auto_approve or always_ask. Controls whether Assistant can run the tool without user confirmation. Tools not listed use the default policy, which auto-approves read-only tools and asks for others.

Tool names are defined by the MCP server. You can discover available tool names by connecting the server through the Grafana UI or by calling the server’s MCP tools/list method directly.

JSON
{
  "name": "Internal docs server",
  "scope": "tenant",
  "type": "mcp",
  "enabled": true,
  "applications": ["assistant"],
  "configuration": {
    "url": "https://docs-mcp.internal.example.com/mcp/",
    "toolPreferences": {
      "delete_records": "disabled"
    },
    "toolApprovalPolicies": {
      "update_record": "always_ask",
      "search_docs": "auto_approve"
    }
  },
  "customHeaders": [
    {"key": "Authorization", "value": "Bearer your-token-here"}
  ]
}

Response

JSON
{
  "status": "success",
  "data": {
    "id": "d6e4f5a7-8901-2345-bdef-167890123456",
    "created": "2025-11-15T11:00:00Z",
    "modified": "2025-11-15T11:00:00Z",
    "createdBy": "sa-5594@serviceaccount.grafana",
    "updatedBy": "sa-5594@serviceaccount.grafana",
    "name": "Internal docs server",
    "type": "mcp",
    "enabled": true,
    "scope": "tenant",
    "applications": ["assistant"],
    "configuration": {
      "url": "https://docs-mcp.internal.example.com/mcp/",
      "toolPreferences": {
        "delete_records": "disabled"
      },
      "toolApprovalPolicies": {
        "update_record": "always_ask",
        "search_docs": "auto_approve"
      }
    },
    "customHeaders": [
      {"key": "Authorization", "value": "**********"}
    ]
  }
}

Header values are redacted in responses.

Examples

Bash
curl -X POST "${ASSISTANT_API_URL}/integrations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}" \
  -d '{
    "name": "Internal docs server",
    "scope": "tenant",
    "type": "mcp",
    "enabled": true,
    "applications": ["assistant"],
    "configuration": {
      "url": "https://docs-mcp.internal.example.com/mcp/"
    },
    "customHeaders": [
      {"key": "Authorization", "value": "Bearer your-token-here"}
    ]
  }'

List MCP servers

Retrieve integrations with optional filtering and pagination.

Endpoint

GET /integrations

Permissions

Integration scopeRequired permission
usergrafana-assistant-app.mcps.user:read
tenantgrafana-assistant-app.mcps.tenant:read

Request

ParameterRequiredDescription
scopeNoFilter by scope: user or tenant.
enabled_onlyNoWhen true, return only enabled integrations.
limitNoMaximum number of integrations to return. Range: 1-100. Default: 20.
offsetNoPagination offset. Default: 0.

Response

JSON
{
  "status": "success",
  "data": {
    "integrations": [
      {
        "id": "d6e4f5a7-8901-2345-bdef-167890123456",
        "created": "2025-11-15T11:00:00Z",
        "modified": "2025-11-15T11:00:00Z",
        "createdBy": "sa-5594@serviceaccount.grafana",
        "updatedBy": "sa-5594@serviceaccount.grafana",
        "name": "Internal docs server",
        "type": "mcp",
        "enabled": true,
        "scope": "tenant",
        "applications": ["assistant"],
        "configuration": {
          "url": "https://docs-mcp.internal.example.com/mcp/"
        },
        "customHeaders": [
          {"key": "Authorization", "value": "**********"}
        ]
      }
    ],
    "pagination": {
      "total": 1,
      "limit": 20,
      "offset": 0
    }
  }
}

Examples

Bash
curl -X GET "${ASSISTANT_API_URL}/integrations?scope=tenant&enabled_only=true" \
  -H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}"

Get an MCP server

Retrieve a single integration by ID.

Endpoint

GET /integrations/{id}

Permissions

Integration scopeRequired permission
usergrafana-assistant-app.mcps.user:read
tenantgrafana-assistant-app.mcps.tenant:read

Request

ParameterRequiredDescription
idYesThe integration ID returned when you create an integration.

Response

JSON
{
  "status": "success",
  "data": {
    "id": "d6e4f5a7-8901-2345-bdef-167890123456",
    "created": "2025-11-15T11:00:00Z",
    "modified": "2025-11-15T11:00:00Z",
    "createdBy": "sa-5594@serviceaccount.grafana",
    "updatedBy": "sa-5594@serviceaccount.grafana",
    "name": "Internal docs server",
    "type": "mcp",
    "enabled": true,
    "scope": "tenant",
    "applications": ["assistant"],
    "configuration": {
      "url": "https://docs-mcp.internal.example.com/mcp/"
    },
    "customHeaders": [
      {"key": "Authorization", "value": "**********"}
    ]
  }
}

Examples

Bash
INTEGRATION_ID="d6e4f5a7-8901-2345-bdef-167890123456"

curl -X GET "${ASSISTANT_API_URL}/integrations/${INTEGRATION_ID}" \
  -H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}"

Update an MCP server

Update an existing integration. Only the fields you include in the request body are changed, except scope which is always required.

Endpoint

PUT /integrations/{id}

Permissions

Integration scopeRequired permission
usergrafana-assistant-app.mcps.user:write
tenantgrafana-assistant-app.mcps.tenant:write

Request

ParameterRequiredDescription
idYesThe integration ID.

Send a JSON request body with the fields to update.

FieldRequiredDescription
scopeYesThe current scope of the integration: user or tenant.
nameNoUpdated display name.
descriptionNoUpdated description.
enabledNoWhether the integration is active.
applicationsNoUpdated application list.
configurationNoUpdated MCP server configuration. See Configuration.
customHeadersNoUpdated custom HTTP headers.

Response

The response contains the full updated integration.

JSON
{
  "status": "success",
  "data": {
    "id": "d6e4f5a7-8901-2345-bdef-167890123456",
    "created": "2025-11-15T11:00:00Z",
    "modified": "2025-11-20T14:15:00Z",
    "createdBy": "sa-5594@serviceaccount.grafana",
    "updatedBy": "sa-5594@serviceaccount.grafana",
    "name": "Internal docs server",
    "type": "mcp",
    "enabled": false,
    "scope": "tenant",
    "applications": ["assistant"],
    "configuration": {
      "url": "https://docs-mcp.internal.example.com/mcp/"
    },
    "customHeaders": [
      {"key": "Authorization", "value": "**********"}
    ]
  }
}

Examples

Disable an integration:

Bash
INTEGRATION_ID="d6e4f5a7-8901-2345-bdef-167890123456"

curl -X PUT "${ASSISTANT_API_URL}/integrations/${INTEGRATION_ID}" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}" \
  -d '{
    "scope": "tenant",
    "enabled": false
  }'

Delete an MCP server

Permanently delete an integration.

Endpoint

DELETE /integrations/{id}

Permissions

Integration scopeRequired permission
usergrafana-assistant-app.mcps.user:delete
tenantgrafana-assistant-app.mcps.tenant:delete

Request

ParameterRequiredDescription
idYesThe integration ID.

Response

A successful deletion returns HTTP 204 with no response body.

Examples

Bash
INTEGRATION_ID="d6e4f5a7-8901-2345-bdef-167890123456"

curl -X DELETE "${ASSISTANT_API_URL}/integrations/${INTEGRATION_ID}" \
  -H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}"