Skip to main content
Glama
jerrelblankenship

Kibana MCP Server

export_dashboard

Export Kibana dashboards with all visualizations and data views for backup, sharing, or migration purposes.

Instructions

Export a dashboard with all its dependencies (visualizations, data views, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesDashboard ID to export
includeReferencesNoInclude all referenced objects (default: true)

Implementation Reference

  • MCP tool request handler for 'export_dashboard' which calls the Kibana client to export the dashboard.
    case 'export_dashboard': {
      const { id, includeReferences = true } = args as { id: string; includeReferences?: boolean };
      const exported = await kibanaClient.exportDashboard(
        id,
        includeReferences
      );
    
      return {
        content: [
          {
            type: 'text' as const,
            text: JSON.stringify(exported, null, 2),
          },
        ],
      };
    }
  • Actual implementation of the dashboard export logic, making an HTTP POST request to Kibana's API.
    async exportDashboard(
      dashboardId: string,
      includeReferencesDeep = true
    ): Promise<any> {
      const exportParams: ExportDashboardParams = {
        objects: [
          {
            type: 'dashboard',
            id: dashboardId,
          },
        ],
        includeReferencesDeep,
      };
    
      const response = await this.axiosInstance.post(
        '/api/saved_objects/_export',
        exportParams,
        {
          responseType: 'arraybuffer',
        }
      );
    
      // Parse NDJSON response
      const text = Buffer.from(response.data).toString('utf-8');
      const objects = text
        .split('\n')
        .filter((line) => line.trim())
        .map((line) => JSON.parse(line));
    
      return objects;
    }
  • Tool definition for 'export_dashboard' including input schema.
      name: 'export_dashboard',
      description:
        'Export a dashboard with all its dependencies (visualizations, data views, etc.)',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'Dashboard ID to export',
          },
          includeReferences: {
            type: 'boolean',
            description:
              'Include all referenced objects (default: true)',
            default: true,
          },
        },
        required: ['id'],
      },
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jerrelblankenship/jb-kibana-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server