PM

perses/mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

32 stars 6 forks 质量 78 趋势 31Apache-2.0

Perses 的 MCP 服务器

概览

Perses MCP 服务器是一个本地模型上下文协议(MCP)服务器,使 LLM 主机(OpenCode、Claude Desktop、VS Code、Cursor)能够以标准化方式与 Perses 应用交互。 https://github.com/user-attachments/assets/03706209-abef-47f2-8067-67c723537750 - 运行中的Perses实例- MCP服务器二进制文件——从发布页面下载,解压后可执行: 创建一个 YAML 配置文件(例如 perses-mcp-config.yaml)。有关每种认证方法的详细信息,请参见认证。 配置值按以下顺序解析(后续获胜):内置默认< YAML 配置文件<环境变量。 资源字段接受以下资源名称(大小写不区分,逗号分隔): YAML 文件中的配置值可以通过带有 PERMCP_ 前缀的环境变量覆盖。变量名通过将每个 YAML 键放大并用 _ 连接嵌套键来推导出来。 例如,YAML路径perses_server。

概述(AI 翻译)

Perses 的 MCP 服务器

概述

Perses MCP 服务器是一个本地模型上下文协议(MCP)服务器,使 LLM 主机(OpenCode、Claude Desktop、VS Code、Cursor)能够以标准化方式与 Perses 应用交互。

演示

开放代码

https://github.com/user-attachments/assets/03706209-abef-47f2-8067-67c723537750

开始

先决条件

  • 一个正在运行的Perses实例
  • MCP 服务器二进制文件 — 从发布页面下载,解压后可执行:

1.创建一个配置文件

创建一个 YAML 配置文件(例如 perses-mcp-config.yaml。有关每种认证方法的详细信息,请参见认证部分。

[!注] 配置值按以下顺序解析(后者获胜):内置默认值 [!提示] 将敏感认证值作为环境变量传递,而不是存储在配置文件中:

基本认证:PERMCP_PERSES_SERVER_NATIVE_AUTH_LOGIN 和 PERMCP_PERSES_SERVER_NATIVE_AUTH_PASSWORD

持有者标记:PERMCP_PERSES_SERVER_AUTHORIZATION_CREDENTIALS

完整列表请参见环境变量。

OpenCode

在你的OpenCode配置中添加以下内容,在mcp下。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Overview

The Perses MCP Server is a local Model Context Protocol (MCP) Server that enables the LLM hosts (OpenCode, Claude Desktop, VS Code, Cursor) to interact with the Perses Application in a standardized way.

The complete documentation is available in the docs folder.

Demo

OpenCode

https://github.com/user-attachments/assets/03706209-abef-47f2-8067-67c723537750

Getting Started

Prerequisites

  • A running Perses instance
  • The MCP server binary — download from the releases page, extract it, and make it executable:
    chmod +x /path/to/perses-mcp-server
    

1. Create a configuration file

Create a YAML configuration file (e.g., perses-mcp-config.yaml). See Authentication for details on each auth method.

# MCP transport mode: "stdio" or "http"
transport: stdio

# Address to listen on for HTTP transport (e.g., ":8000")
listen_address: ":8000"

# Restrict the server to read-only operations
read_only: false

# Comma-separated list of resources to register (if empty, all resources are registered)
resources: ""

# Perses server connection configuration
perses_server:
  url: "http://localhost:8080"

  # Authentication (choose one method):
  # It is recommended to use environment variables for sensitive values.
  # Refer the "Environment Variables" section.

  # Option 1: Basic authentication (login/password)
  # native_auth:
  #   login: "admin"
  #   password: "password"

  # Option 2: Bearer token (e.g., from `percli whoami --show-token`)
  # authorization:
  #   type: Bearer
  #   credentials: ""
  #   # credentialsFile: "/path/to/token/file"  # Alternative: read token from file

  # TLS configuration (optional)
  # tls_config:
  #   caFile: "/path/to/ca.pem"
  #   insecureSkipVerify: false

[!NOTE] Configuration values are resolved in this order (later wins): built-in defaults < YAML configuration file < environment variables.

Available Resources

The resources field accepts the following resource names (case-insensitive, comma-separated):

Resource Description
dashboard Dashboard management tools
ephemeraldashboard Ephemeral dashboard management tools
project Project management tools
datasource Project-level datasource tools
globaldatasource Global datasource tools
role Project-level role tools
globalrole Global role tools
rolebinding Project-level role binding tools
globalrolebinding Global role binding tools
variable Project-level variable tools
globalvariable Global variable tools
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "perses-mcp": { "command": "<ABSOLUTE_PATH_TO_PERSES_MCP_BINARY>", "args": [ "--config", "<ABSOLUTE_PATH_TO_CONFIG_YAML>" ] } } }