شعار MCP Server for Perses

MCP Server for Perses

مؤسسة
perses

MCP Server for Perses

الناشرperses
المستودعmcp-server
اللغةGo
التفريعات
6
النجوم
31
الأدوات المتاحة
0
نوع نقل البياناتstdio
الفئات
الترخيصApache-2.0
الروابط
  • اربط الأدوات بسير عمل الذكاء الاصطناعي

    يتيح MCP Server for Perses إمكانات MCP التي يمكن لتطبيقات الذكاء الاصطناعي العميلة ووكلاء الذكاء الاصطناعي المتوافقة استخدامها.

  • الأدوات المتاحة: 0

    تصفّح الإجراءات القابلة للاستدعاء أدناه، بما في ذلك أسماؤها وأوصافها عندما يوفّرها الخادم.

  • إعدادات جاهزة للنسخ

    استخدم أمثلة إعداد التثبيت لتهيئة هذا الخادم في تطبيق MCP العميل المفضّل لديك.

  • مؤشرات الاهتمام بالمصدر المفتوح

    النجوم: 31، والنسخ المتفرعة: 6 في المستودع المرتبط.

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.

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:
    bash
    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.

yaml
# 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: "<YOUR_TOKEN>"
  #   # credentials_file: "/path/to/token/file"  # Alternative: read token from file

  # TLS configuration (optional)
  # tls_config:
  #   ca_file: "/path/to/ca.pem"
  #   insecure_skip_verify: 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):

ResourceDescription
dashboardDashboard management tools
ephemeraldashboardEphemeral dashboard management tools
projectProject management tools
datasourceProject-level datasource tools
globaldatasourceGlobal datasource tools
roleProject-level role tools
globalroleGlobal role tools
rolebindingProject-level role binding tools
globalrolebindingGlobal role binding tools
variableProject-level variable tools
globalvariableGlobal variable tools
pluginPlugin tools
migrateGrafana → Perses dashboard migration tool

Environment Variables

Configuration values in the YAML file can be overridden using environment variables with the PERMCP_ prefix. The variable name is derived by uppercasing each YAML key and joining nested keys with _.

For example, the YAML path perses_server.native_auth.password becomes PERMCP_PERSES_SERVER_NATIVE_AUTH_PASSWORD.

This is particularly useful for sensitive values like passwords and tokens that should not be stored in the config file.

Environment VariableConfig PathDescription
PERMCP_TRANSPORTtransportTransport mode
PERMCP_LISTEN_ADDRESSlisten_addressHTTP listen address
PERMCP_READ_ONLYread_onlyRead-only mode
PERMCP_RESOURCESresourcesResources to register
PERMCP_PERSES_SERVER_URLperses_server.urlPerses server URL
PERMCP_PERSES_SERVER_NATIVE_AUTH_LOGINperses_server.native_auth.loginBasic auth username
PERMCP_PERSES_SERVER_NATIVE_AUTH_PASSWORDperses_server.native_auth.passwordBasic auth password
PERMCP_PERSES_SERVER_AUTHORIZATION_TYPEperses_server.authorization.typeAuthorization type (e.g., Bearer)
PERMCP_PERSES_SERVER_AUTHORIZATION_CREDENTIALSperses_server.authorization.credentialsAuthorization token

For more details about how environment variables override the configuration file, see the Perses Configuration docs.

2. Add the MCP server to your client

Standard config works in most clients:

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

[!TIP] Pass sensitive auth values as environment variables instead of storing them in the config file:

Basic auth: PERMCP_PERSES_SERVER_NATIVE_AUTH_LOGIN and PERMCP_PERSES_SERVER_NATIVE_AUTH_PASSWORD

Bearer token: PERMCP_PERSES_SERVER_AUTHORIZATION_CREDENTIALS

See Environment Variables for the full list.

Add the following to your OpenCode config under mcp. See OpenCode MCP documentation for more details.

json
{
  "mcp": {
    "perses": {
      "command": [
        "<ABSOLUTE_PATH_TO_PERSES_MCP_BINARY>",
        "--config",
        "<ABSOLUTE_PATH_TO_CONFIG_YAML>"
      ],
      "environment": {
        "PERMCP_PERSES_SERVER_NATIVE_AUTH_LOGIN": "{env:PERMCP_PERSES_SERVER_NATIVE_AUTH_LOGIN}",
        "PERMCP_PERSES_SERVER_NATIVE_AUTH_PASSWORD": "{env:PERMCP_PERSES_SERVER_NATIVE_AUTH_PASSWORD}"
      },
      "enabled": true,
      "type": "local"
    }
  }
}

Use the Claude Code CLI to add the Perses MCP server. See Claude Code MCP documentation for more details.

bash
claude mcp add --transport stdio \
  --env PERMCP_PERSES_SERVER_NATIVE_AUTH_LOGIN=<YOUR_LOGIN> \
  --env PERMCP_PERSES_SERVER_NATIVE_AUTH_PASSWORD=<YOUR_PASSWORD> \
  perses-mcp -- <ABSOLUTE_PATH_TO_PERSES_MCP_BINARY> --config <ABSOLUTE_PATH_TO_CONFIG_YAML>

Create or edit the Claude Desktop configuration file at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

You can also access this file via Claude > Settings > Developer > Edit Config.

json
{
  "mcpServers": {
    "perses-mcp": {
      "command": "<ABSOLUTE_PATH_TO_PERSES_MCP_BINARY>",
      "args": [
        "--config",
        "<ABSOLUTE_PATH_TO_CONFIG_YAML>"
      ],
      "env": {
        "PERMCP_PERSES_SERVER_NATIVE_AUTH_LOGIN": "<YOUR_LOGIN>",
        "PERMCP_PERSES_SERVER_NATIVE_AUTH_PASSWORD": "<YOUR_PASSWORD>"
      }
    }
  }
}

Restart Claude Desktop for the changes to take effect.

Add the following to your VS Code MCP config file. See VS Code MCP documentation for more details.

json
{
  "servers": {
    "perses-mcp": {
      "command": "<ABSOLUTE_PATH_TO_PERSES_MCP_BINARY>",
      "args": [
        "--config",
        "<ABSOLUTE_PATH_TO_CONFIG_YAML>"
      ],
      "env": {
        "PERMCP_PERSES_SERVER_NATIVE_AUTH_LOGIN": "<YOUR_LOGIN>",
        "PERMCP_PERSES_SERVER_NATIVE_AUTH_PASSWORD": "<YOUR_PASSWORD>"
      }
    }
  }
}

Streamable HTTP Mode

The Streamable HTTP mode allows the MCP server to communicate with LLM hosts over HTTP. This is useful for remote hosting or allowing multiple clients to connect to the same server instance.

For more details, see the MCP Protocol Specification docs.

Set transport: http in your configuration file:

yaml
transport: http
listen_address: ":8000"
perses_server:
  url: "http://localhost:8080"
  native_auth:
    login: "admin"
    password: "password"

Then point your MCP client to the HTTP endpoint:

json
{
  "servers": {
    "perses-http": {
      "type": "http",
      "url": "http://localhost:8000/mcp"
    }
  }
}

Authentication

There are two ways to authenticate the MCP server with your Perses instance. Add the relevant block under perses_server in your configuration file.

Basic Authentication (Username/Password)

Use your Perses username and password directly:

yaml
native_auth:
  login: "your-username"
  password: "your-password"

Bearer Token (via percli)

  1. Install percli and login to your Perses server:
bash
percli login <PERSES_SERVER_URL>

For example, percli login https://demo.perses.dev

  1. After successful login, retrieve your token:
bash
percli whoami --show-token
  1. Use the token in your configuration file:
yaml
authorization:
  type: Bearer
  credentials: "<YOUR_TOKEN>"

[!WARNING] The bearer token automatically expires based on the access_token_ttl setting (default: 15 minutes) of the Perses server. You can change this in the Perses app configuration.

Command-Line Usage

bash
perses-mcp-server --config /path/to/config.yaml
FlagDefaultDescription
--config""Path to the YAML configuration file
-log.levelinfoLog level (options: panic, fatal, error, warning, info, debug, trace)
-log.formattextLog format (options: text, json)
-log.method-tracefalseInclude the calling method as a field in the log

Tools

[!NOTE]
When running in read-only mode (read_only: true in config), only tools that retrieve information are available. All write operations (create, update, delete) are disabled in read-only mode.

Projects

ToolDescriptionRequired Parameters
perses_list_projectsList all projects-
perses_get_project_by_nameGet a project by namename
perses_create_projectCreate a new projectproject
perses_update_projectUpdate an existing projectname
perses_delete_projectDelete a projectname

Dashboards

ToolDescriptionRequired Parameters
perses_list_dashboardsList all dashboards for a specific projectproject
perses_get_dashboard_by_nameGet a dashboard by name for a projectproject, name
perses_create_dashboardCreate a dashboard given a project and dashboard configurationproject, dashboard
perses_update_dashboardUpdate an existing dashboard in a projectproject, dashboard
perses_delete_dashboardDelete a dashboard from a projectproject, name

For dashboard configuration, see Perses Dashboards

Ephemeral Dashboards

Ephemeral dashboards are temporary dashboards with a TTL (time-to-live). They are automatically cleaned up after expiry.

ToolDescriptionRequired Parameters
perses_list_ephemeral_dashboardsList all ephemeral dashboards for a specific projectproject
perses_get_ephemeral_dashboard_by_nameGet an ephemeral dashboard by name for a projectproject, name
perses_create_ephemeral_dashboardCreate an ephemeral dashboard given a project and dashboard configurationproject, dashboard
perses_update_ephemeral_dashboardUpdate an existing ephemeral dashboard in a projectproject, dashboard
perses_delete_ephemeral_dashboardDelete an ephemeral dashboard from a projectproject, name

For ephemeral dashboard configuration, see Perses EphemeralDashboard

Datasources

ToolDescriptionRequired ParametersOptional Parameters
perses_list_global_datasourcesList all global datasources--
perses_get_global_datasource_by_nameGet a global datasource by namename-
perses_query_global_datasourceSend an HTTP request to a global datasource backend through the Perses proxydatasource_namemethod, path, query_params, body, headers
perses_create_global_datasourceCreate a new global datasourcename, type, urldisplay_name, proxy_type
perses_update_global_datasourceUpdate an existing global datasourcename, type, urldisplay_name, proxy_type
perses_delete_global_datasourceDelete a global datasourcename-
perses_list_project_datasourcesList all datasources for a specific projectproject-
perses_get_project_datasource_by_nameGet a project datasource by nameproject, name-
perses_query_project_datasourceSend an HTTP request to a project datasource backend through the Perses proxyproject, datasource_namemethod, path, query_params, body, headers
perses_create_project_datasourceCreate a new datasource in a projectproject, datasource-
perses_update_project_datasourceUpdate an existing datasource in a projectproject, datasource-
perses_delete_project_datasourceDelete a datasource from a projectproject, name-

Querying Datasources

perses_query_project_datasource and perses_query_global_datasource forward HTTP requests to a configured datasource backend through the Perses proxy. This means:

  • Credentials are automatically injected — datasource secrets configured in Perses (Bearer tokens, Basic auth, OAuth) are applied server-side; they are never exposed to the tool caller.
  • Allowed endpoints are enforced — only endpoints permitted by the datasource's allowedEndpoints configuration are reachable.
  • method defaults to GET. Only GET and POST are accepted.
  • path is the datasource-relative endpoint path, e.g. /api/v1/query_range for Prometheus or /loki/api/v1/query_range for Loki.
  • query_params is an object of key/value string pairs appended as query string parameters.
  • body is a raw string body (JSON or application/x-www-form-urlencoded). Content-Type defaults to application/json when a body is provided.
  • headers allows passing additional request headers. The Authorization header is always blocked in tool input; use Perses secrets for authentication.
  • Response bodies are capped at 1 MiB to avoid exceeding LLM context limits.

Example — Prometheus instant query via a global datasource:

json
{
  "datasource_name": "my-prometheus",
  "method": "POST",
  "path": "/api/v1/query",
  "query_params": {
    "query": "up",
    "time": "2024-01-01T00:00:00Z"
  }
}

Example — Prometheus range query via a project datasource:

json
{
  "project": "my-project",
  "datasource_name": "my-prometheus",
  "method": "POST",
  "path": "/api/v1/query_range",
  "query_params": {
    "query": "rate(http_requests_total[5m])",
    "start": "2024-01-01T00:00:00Z",
    "end": "2024-01-01T01:00:00Z",
    "step": "60"
  }
}

Roles

ToolDescriptionRequired Parameters
perses_list_global_rolesList all global roles-
perses_get_global_role_by_nameGet a global role by namename
perses_create_global_roleCreate a new global rolename, actions, scopes
perses_update_global_roleUpdate an existing global rolename, actions, scopes
perses_delete_global_roleDelete a global rolename
perses_list_global_role_bindingsList all global role bindings-
perses_get_global_role_binding_by_nameGet a global role binding by namename
perses_create_global_role_bindingCreate a new global role bindingname, role, subjects
perses_update_global_role_bindingUpdate an existing global role bindingname, role, subjects
perses_delete_global_role_bindingDelete a global role bindingname
perses_list_project_rolesList all roles for a specific projectproject
perses_get_project_role_by_nameGet a project role by nameproject, name
perses_create_project_roleCreate a new project roleproject, name, actions, scopes
perses_update_project_roleUpdate an existing project roleproject, name, actions, scopes
perses_delete_project_roleDelete a project roleproject, name
perses_list_project_role_bindingsList all role bindings for a projectproject
perses_get_project_role_binding_by_nameGet a project role binding by nameproject, name
perses_create_project_role_bindingCreate a new project role bindingproject, name, role, subjects
perses_update_project_role_bindingUpdate an existing project role bindingproject, name, role, subjects
perses_delete_project_role_bindingDelete a project role bindingproject, name

Plugins

ToolDescriptionRequired Parameters
perses_list_pluginsList all plugins-

Variables

ToolDescriptionRequired Parameters
perses_list_global_variablesList all global variables-
perses_get_global_variable_by_nameGet a global variable by namename
perses_create_global_variableCreate a new global variablename, value
perses_update_global_variableUpdate an existing global variablename, value
perses_delete_global_variableDelete a global variablename
perses_list_project_variablesList all variables for a specific projectproject
perses_get_project_variable_by_nameGet a project variable by nameproject, name
perses_create_project_variableCreate a project level variablename, project
perses_update_project_variableUpdate an existing project variableproject, name, value
perses_delete_project_variableDelete a project variableproject, name

Local Development

Build from Source

If you want to build the MCP server from source code (for development or contribution purposes), run the following command from the source code root directory:

bash
make build

This creates a bin directory containing the binary named mcp-server. Copy the absolute path to the binary to use in your MCP server configuration.

License

The code is licensed under an Apache 2.0 license.

التثبيت

TypingMind
المتطلبات المسبقة:

Node.js 18+

{
  "mcpServers": {
    "perses-mcp-server": {
      "command": "",
      "args": []
    }
  }
}

استخدم MCP الخاص بـ MCP Server for Perses مع نماذج ذكاء اصطناعي متعددة

يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا بمجرد توصيل MCP Server for Perses، يمكنك استخدامه مع نماذج ذكاء اصطناعي مختلفة في TypingMind بدلًا من إعداده لكل نموذج على حدة. يعمل تكامل MCP هذا محليًا عبر موصل MCP الخاص بـ TypingMind على جهازك.

دليل الإعداد لاستخدام الموصل المحلي

استخدم هذا الخيار عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات أو موارد خاصة على جهاز الكمبيوتر لديك.

1

فتح إعدادات MCP

في TypingMind، انتقل إلى «الإعدادات»، ثم «الإعدادات المتقدمة»، ثم «بروتوكول سياق النموذج»، واختر «إعداد الموصل».

  1. افتح TypingMind في متصفحك.
  2. انقر على أيقونة الإعدادات.
  3. انتقل إلى الإعدادات المتقدمة.
  4. افتح قسم بروتوكول سياق النموذج.
  5. انقر على «إعداد الموصل» واختر «هذا الجهاز».
شاشة إعداد موصل MCP في TypingMind مع تحديد «هذا الجهاز»
2

تنفيذ أمر الموصل

اختر «هذا الجهاز»، وانسخ الأمر من TypingMind وشغّله في Terminal. أبقِ العملية قيد التشغيل أثناء استخدام MCP.

  1. انسخ أمر الإعداد الذي يعرضه TypingMind.
  2. افتح Terminal على macOS أو Windows Terminal على Windows.
  3. الصق الأمر ونفّذه.
  4. وافق على تثبيت الحزمة إذا طلب منك Terminal تأكيد المتابعة.
  5. أبقِ نافذة Terminal والعملية التي تعمل فيها قيد التشغيل أثناء استخدام أدوات MCP.
3

أضف MCP Server for Perses كخادم

عندما تظهر حالة الموصل «جاهز»، انقر على «تعديل الخوادم» والصق إعدادات خادم MCP.

  1. انتظر حتى تظهر حالة الموصل «جاهز».
  2. انقر على «تعديل الخوادم».
  3. الصق إعدادات خادم MCP الخاص بـ MCP Server for Perses.
  4. احفظ قائمة الخوادم.
  5. حدّث الحالة إذا أردت التأكد من أن الموصل لا يزال جاهزًا.
إعدادات MCP في TypingMind تعرض خادمًا نشطًا وزر «تعديل الخوادم»
{
  "mcpServers": {
    "perses-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server"
      ]
    }
  }
}
4

استخدام الاتصال مع نماذج مختلفة

احفظ قائمة الخوادم، وافتح «الإضافات»، وفعّل أدوات MCP الخاصة بـ MCP Server for Perses، ثم اختر أي نموذج ذكاء اصطناعي مدعوم في TypingMind واستخدم الأدوات في المحادثة أو أسندها إلى وكيل ذكاء اصطناعي.

  1. افتح صفحة الإضافات في TypingMind.
  2. فعّل أدوات MCP الخاصة بـ MCP Server for Perses.
  3. ابدأ محادثة واختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  4. استخدم أدوات MCP في المحادثة أو عيّنها لوكيل ذكاء اصطناعي.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر عند الحاجة دون إعادة الاتصال بـ MCP.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام MCP Server for Perses لمساعدتي في هذه المهمة؟
MCP Server for Perses
بالتأكيد. قرأته.
إليك ما وجدته باستخدام MCP Server for Perses.

الأسئلة الشائعة

ما استخدامات خادم MCP MCP Server for Perses؟

MCP Server for Perses هو خادم MCP يتيح لتطبيقات الذكاء الاصطناعي المتوافقة الاتصال بأدوات ومصادر سياق خارجية. في TypingMind، يمكنك إضافة خادم MCP هذا مرة واحدة وإتاحة أدواته في مساحة عملك للذكاء الاصطناعي.

هل يمكنني استخدام خادم MCP MCP Server for Perses مع نماذج ذكاء اصطناعي متعددة في TypingMind؟

نعم. يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا يمكنك استخدام MCP Server for Perses مع نماذج ذكاء اصطناعي مختلفة مثل Claude أو ChatGPT أو Gemini أو غيرها من النماذج التي أعددتها في TypingMind، دون إعداد خادم MCP لكل نموذج على حدة.

لماذا تستخدم موصل MCP MCP Server for Perses مع TypingMind؟

يُعد TypingMind من أفضل واجهات المحادثة مع النماذج اللغوية الكبيرة، إذ يجمع نماذج ذكاء اصطناعي متعددة ومطالبات وإضافات ووكلاء ذكاء اصطناعي ومفاتيح API وأدوات MCP في مساحة عمل واحدة. بعد توصيل MCP Server for Perses، يمكنك استخدام أدوات MCP الخاصة به عبر نماذجك المفضلة مع الحفاظ على سير عمل محادثاتك منظمًا في TypingMind.

كيف أوصّل خادم MCP MCP Server for Perses بـ TypingMind؟

يعمل MCP Server for Perses عبر موصل MCP المحلي في TypingMind. هذا هو الخيار الأنسب عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات سطح المكتب أو أدوات سطر الأوامر أو موارد خاصة على حاسوبك.

ما الأدوات التي يوفّرها خادم MCP MCP Server for Perses في TypingMind؟

يتيح MCP Server for Perses إمكانات MCP يمكنك تفعيلها من صفحة الإضافات في TypingMind واستخدامها في المحادثات أو تعيينها لوكلاء ذكاء اصطناعي.

هل أحتاج إلى مشاركة مفاتيح API الخاصة بي مع TypingMind لاستخدام خادم MCP MCP Server for Perses؟

لا. يعطي TypingMind الأولوية للعمل المحلي ويُبقي مزوّدي النماذج ومفاتيح API والمطالبات وإعدادات MCP تحت تحكمك. إذا كان MCP Server for Perses يتطلب مصادقة، فأضف الترويسات أو إعدادات OAuth أو الإعدادات المحلية المطلوبة لخادم MCP هذا عند إنشاء الاتصال.

خوادم MCP ذات صلة

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇