Back to MCP directory
publicPublicdnsLocal runtime

last9-mcp-server

Last9 MCP Server是一个实现Model Context Protocol的服务器,为AI开发者提供实时生产环境数据(日志、指标、追踪)的本地集成,帮助快速自动修复代码。

article

README

🚀 最后9 MCP服务器

Last9 MCP服务器是一款用于集成和管理Last9平台的应用程序。它支持开发者通过命令行接口(CLI)或集成开发环境(IDE)与Last9服务进行交互,实现日志、跟踪和性能监控等功能。

🚀 快速开始

Last9 MCP服务器能让开发者轻松与Last9服务交互,开启日志、跟踪和性能监控之旅。

✨ 主要特性

  • 支持通过命令行接口(CLI)和集成开发环境(IDE)与Last9服务交互。
  • 可实现日志、跟踪和性能监控等功能。

📦 安装指南

使用Homebrew安装

在终端中运行以下命令:

brew install last9/mcp-server

使用npm安装

使用Node.js包管理器安装:

# 全局安装
npm install -g @last9/mcp-server

# 或直接运行
npx @last9/mcp-server

📚 详细文档

配置指南

环境变量配置

服务需要以下环境变量:

  • LAST9_AUTH_TOKEN:Last9 MCP服务器的认证令牌(必需)
  • LAST9_BASE_URL:Last9 API URL(必需)
  • LAST9_REFRESH_TOKEN:具有写入权限的刷新令牌。用于访问控制平面API(必需)

获取配置信息

  1. 在Last9平台注册并登录:Last9
  2. 设置其中一个集成:Last9文档
  3. 此处获取LAST9_BASE_URLLAST9_AUTH_TOKEN
  4. API访问页面获取LAST9_REFRESH_TOKEN

使用说明

与Claude Desktop配合使用

配置Claude应用程序以使用MCP服务器:

  1. 打开Claude桌面应用。
  2. 进入设置,选择开发者选项,点击编辑配置文件。
  3. 打开claude_desktop_config.json文件。
  4. 将以下内容复制到现有文件中并保存。
  5. 重启Claude。
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "last9": {
      "command": "/opt/homebrew/bin/last9-mcp",
      "env": {
        "LAST9_AUTH_TOKEN": "<your_auth_token>",
        "LAST9_BASE_URL": "<last9_otlp_host>",
        "LAST9_REFRESH_TOKEN": "<refresh_token_from_last9_dashboard>"
      }
    }
  }
}

与Cursor配合使用

配置Cursor以使用MCP服务器:

  1. 导航到设置,选择Cursor设置。
  2. 在左侧选择MCP选项。
  3. 点击右上角的“添加新的全局MCP服务器”。
  4. 将以下内容复制到现有文件中并保存。
  5. 重启Cursor。
{
  "mcpServers": {
    "last9": {
      "command": "/opt/homebrew/bin/last9-mcp",
      "env": {
        "LAST9_AUTH_TOKEN": "<auth_token>",
        "LAST9_BASE_URL": "<last9_otlp_host>",
        "LAST9_REFRESH_TOKEN": "<write_refresh_token>"
      }
    }
  }
}

与Windsurf配合使用

配置Windsurf以使用MCP服务器:

  1. 打开Windsurf。
  2. 进入设置,选择开发者选项。
  3. 点击编辑配置文件。
  4. 打开windsurf_config.json文件。
  5. 将以下内容复制到现有文件中并保存。
  6. 重启Windsurf。
{
  "mcpServers": {
    "last9": {
      "command": "/opt/homebrew/bin/last9-mcp",
      "env": {
        "LAST9_AUTH_TOKEN": "<your_auth_token>",
        "LAST9_BASE_URL": "<last9_otlp_host>",
        "LAST9_REFRESH_TOKEN": "<refresh_token_from_last9_dashboard>"
      }
    }
  }
}

与VS Code配合使用

配置Visual Studio Code以使用MCP服务器:

  1. 打开VS Code的设置(菜单栏选择“文件” -> “首选项” -> “设置”)。
  2. 搜索并选择“MCP: 配置”。
  3. 点击“添加配置文件”,然后选择或创建settings.json
  4. 在文件中添加以下内容并保存。
{
  "mcp.servers": {
    "last9": {
      "command": "/opt/homebrew/bin/last9-mcp",
      "env": {
        "LAST9_AUTH_TOKEN": "<your_auth_token>",
        "LAST9_BASE_URL": "<last9_otlp_host>",
        "LAST9_REFRESH_TOKEN": "<write_refresh_token>"
      }
    }
  }
}
  1. 重启VS Code。

通过以上步骤,您已经成功配置了Last9 MCP服务器,并可以在支持的IDE中使用其功能。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client