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:
When connected shows number of connected servers:
When a tool or resource is being called, shows spinner:
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 stateconnecting
: 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 = ''}
lua
-- Custom colors
{
require('mcphub.extensions.lualine'),
colors = {
connecting = { fg = "#ffff00" }, -- Yellow
connected = { fg = "#00ff00" }, -- Green
error = { fg = "#ff0000" }, -- Red
},
}
lua
-- Statically color the icon, dynamically color the status text
{require('mcphub.extensions.lualine'), icon = { '', color = {fg = '#eeeeee'}}}
lua
-- Dynamically color the icon, statically color the status text
{require('mcphub.extensions.lualine'), color = {fg = '#eeeeee'}}
lua
-- Disable coloring
{require('mcphub.extensions.lualine'), colored = false}