Skip to content

Lualine Integration

MCP Hub provides a lualine component that can be used to show the status of the MCP Hub and the number of connected servers. Add the component to a lualine section to use it. The following example shows how to add the component to the lualine_x section:

lua
require('lualine').setup {
    sections = {
        lualine_x = {
            -- Other lualine components in "x" section
            {require('mcphub.extensions.lualine')}, -- Uses defaults
        },
    },
}

When MCP Hub is connecting:

image

When connected shows number of connected servers:

image

When a tool or resource is being called, shows spinner:

image

Usage

Options

The lualine component accepts the standard lualine options and the following options:

  • icon: Icon to display. (default: "󰐻")
  • colored: Enable dynamic colors (default: true)
  • colors: The color to dynamically display for each MCP Hub state
    • connecting: The color to use when MCP Hub is connecting (default: "DiagnosticWarn")
    • connected: The color to use when MCP Hub is connected (default: "DiagnosticInfo")
    • error: The color to use when MCP Hub encounters an error (default: "DiagnosticError")

Customization examples

lua
-- Custom icon
{require('mcphub.extensions.lualine'), icon = ''}

Image

lua
-- Custom colors
{
  require('mcphub.extensions.lualine'),
  colors = {
    connecting = { fg = "#ffff00" }, -- Yellow
    connected = { fg = "#00ff00" }, -- Green
    error = { fg = "#ff0000" }, -- Red
  },
}

Image

lua
-- Statically color the icon, dynamically color the status text
{require('mcphub.extensions.lualine'), icon = { '󰐻', color = {fg = '#eeeeee'}}}

Image

lua
-- Dynamically color the icon, statically color the status text
{require('mcphub.extensions.lualine'), color = {fg = '#eeeeee'}}

Image

lua
-- Disable coloring
{require('mcphub.extensions.lualine'), colored = false}

Image

Released under the MIT License.