home/versioned_docs/version-1.7.x/help/mcp_server.md
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
This page explains how connect to the HertzBeat MCP server. The MCP server auto starts on the default port 1157 when you start the HertzBeat server.
Make sure that hertzbeat server is up and running. If you are using any other port than 1157, replace the following accordingly
http://your-hertzbeat-server-host:1157/api/mcpYou must authenticate each request using one of the following methods:
JWT bearer token
Authorization: Bearer <your-jwt-token>Note: You can generate a JWT token from the HertzBeat web UI under the Log Integration or Alarm Integration Page.
Authorization: Basic <base64(username:password)>Claude Code use a global config file ~/.claude.json to config mcp server. You can add HertzBeat MCP by CLI or edit this file directly.
Method A: Use the CLI.
claude mcp add -s user -t http hertzbeat-mcp http://your-hertzbeat-server-host:1157/api/mcp --header "Authorization: Bearer your_jwt_key"
Method B: Edit the file directly.
Basic auth:
{
"mcpServers": {
"hertzbeat-mcp": {
"type": "sse",
"url": "http://your-hertzbeat-server-host:1157/api/mcp",
"headers": {
"Authorization": "Basic <base64(username:password)>"
}
}
}
}
JWT bearer:
{
"mcpServers": {
"hertzbeat-mcp": {
"type": "sse",
"url": "http://your-hertzbeat-server-host:1157/api/mcp",
"headers": {
"Authorization": "Bearer <your-jwt-token>"
}
}
}
}
After saving ~/.claude.json, restart or reload Claude Code to make the new MCP configuration take effect.
Create or edit .cursor/mcp.json in your home directory or project root.
Basic auth:
{
"hertzbeat-mcp": {
"url": "http://your-hertzbeat-server-host:1157/api/mcp",
"headers": {
"Authorization": "Basic <base64(username:password)>"
}
}
}
JWT bearer:
{
"hertzbeat-mcp": {
"url": "http://your-hertzbeat-server-host:1157/api/mcp",
"headers": {
"Authorization": "Bearer <your-jwt-token>"
}
}
}
After saving, reload MCP in Cursor or restart the editor.
</TabItem> </Tabs>