Skip to main content
Glama
jzt-sepp-mcp-server

jzt-sepp-mcp-server

by zhengziha

jzt-sepp-mcp-server

エネルギー効率プラットフォーム(SEPP、sepp.op.yyjzt.com)の欠陥管理を行う MCP Server。FastMCP ベースでラップされています。

機能

  • 自動ログイン:Playwright で Keycloak SSO ログインを自動実行し、sepp-auth cookie を取得後、直接 HTTP で API を呼び出します(毎回ブラウザを起動する必要なし)。ログイン状態はローカルに永続化され、7 日間は再ログイン不要です。

    • ブラウザからコピーした sepp-auth JWT(SEPP_AUTH_TOKEN)を直接貼り付けて自動ログインをスキップすることも可能です。

  • ユーザー・プロジェクト情報の取得:get_user_projects(健康診療科技 / 開発エンジニア)。

  • 欠陥リストの照会、担当者によるフィルタリング対応:query_defects / query_my_defects / get_users(氏名/アカウント → userId マッピング)。

  • 定期リマインダー:

    • monitor_add で監視タスクを作成(担当者によるフィルタリング対応)、APScheduler による定期ポーリングを内蔵。

    • 新規欠陥リマインダー:欠陥 ID が初めて出現したときに通知。

    • タイムアウト・リマインダー:欠陥が timeout_hours(デフォルト 2 時間)を超えて未処理の場合に通知。

    • 通知チャネル:钉钉(DingTalk)/企微(WeCom)/飞书(Feishu)webhook、SMTP メール(最低 1 つ設定必須。未設定の場合はログ出力のみ)。

    • 監視状態は data/monitor_state.json に永続化され、サービス再起動後に自動復元されます。

Related MCP server: SentinelMCP

ディレクトリ構成

.
├── sepp_mcp/
│   ├── server.py     # FastMCP 服务(工具定义)
│   ├── auth.py       # 自动登录(Playwright SSO / token / cookie 缓存)
│   ├── client.py     # HTTP 客户端(登录态复用 + 401 自动重登)
│   ├── monitor.py    # 缺陷监控(新增/超时提醒 + APScheduler)
│   ├── alerts.py     # 告警通知(webhook / 邮件)
│   ├── cli.py        # 命令行入口(serve / run-check / daemon)
│   └── config.py     # 配置加载(.env / config.yaml)
├── .env.example
└── pyproject.toml

インストール

cd jzt-sepp-mcp-server

# 方式一:uv(推荐)
uv sync

# 方式二:pip
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

# 安装 Playwright Chromium 浏览器(自动登录必需)
uv run playwright install chromium   # 或 .venv/bin/playwright install chromium

設定

cp .env.example .env   # 然后编辑

必須:

SEPP_USERNAME=你的账号
SEPP_PASSWORD=你的密码

任意(アラートチャネルは最低 1 つ設定しないとプッシュされません):

SEPP_WEBHOOK_URL=https://oapi.dingtalk.com/robot/send?access_token=xxx
SEPP_WEBHOOK_TYPE=dingtalk   # dingtalk | wecom | feishu | generic
SEPP_EMAIL_TO=you@example.com
SEPP_SMTP_HOST=...
SEPP_TIMEOUT_HOURS=2         # 超时提醒阈值(小时)

MCP の実行(Claude Code / CodeBuddy / その他クライアントへの接続)

# 方式一:uv
uv run python -m sepp_mcp serve

# 方式二:venv
.venv/bin/python -m sepp_mcp serve

クライアントの mcpServers 設定例:

{
  "mcpServers": {
    "sepp": {
      "command": "uv",
      "args": ["--directory", "/Users/zhengzihang/Documents/my-mcp/jzt-sepp-mcp-server", "run", "python", "-m", "sepp_mcp"]
    }
  }
}

または venv の python を使用:

{
  "mcpServers": {
    "sepp": {
      "command": "/Users/zhengzihang/Documents/my-mcp/jzt-sepp-mcp-server/.venv/bin/python",
      "args": ["-m", "sepp_mcp"]
    }
  }
}

提供ツール

ツール

説明

login_status

ログイン状態、トークン有効期限

get_user_projects

現在のユーザーのプロジェクト情報

get_users(keyword)

ユーザー一覧(氏名/アカウントでフィルタリング)、userId の確認用

query_defects(...)

欠陥の照会。fuzzy_responser / dev_responser_id / test_responser_id / status / priority / summary によるフィルタリング対応。担当者未指定時はデフォルトで「自分」を照会(デフォルトユーザー 郑自航/1001967)

query_my_defects(...)

「自分」の欠陥を照会

monitor_add(...)

監視の新規追加(担当者未入力時はデフォルトで「自分」を監視。ポーリング間隔 + 新規/タイムアウト通知のオン/オフ)

monitor_run_once(name)

即時チェックを 1 回実行

monitor_list / monitor_remove / monitor_enable

監視管理

定期タスク(リマインダー)

リマインダー機能は MCP サービス内に組み込まれています(サービス実行中に自動ポーリングと監視の復元を行います)。その他に、独立した 2 つの実行方法があります:

1) 常駐 daemon(長期的なリマインダーに推奨)

nohup .venv/bin/python -m sepp_mcp daemon > data/daemon.log 2>&1 &

2) cron / CodeBuddy 自動化と組み合わせる

.venv/bin/python -m sepp_mcp run-check --name my_defects

crontab に設定可能です(例:平日 30 分ごと):

*/30 * * * 1-5 cd /Users/zhengzihang/Documents/my-mcp/jzt-sepp-mcp-server && .venv/bin/python -m sepp_mcp run-check --name my_defects >> data/cron.log 2>&1

利用フロー(自分を監視する場合の例)

  1. 初回に MCP サービスを起動し、monitor_add(name="my_defects") を呼び出して監視を確立(デフォルトで「自分」=郑自航/1001967 を監視し、ベースラインが自動記録されます)。

  2. monitor_run_once(name="my_defects") を呼び出してベースラインを 1 回実行。

  3. 以降 30 分ごとに自動チェック:新規欠陥の出現 または 2 時間を超えて未処理 の場合にリマインダーがプッシュされます。

  4. サービス再起動後も監視は自動復元されます(再追加の必要なし)。

よくある質問

  • WAF / 認証コードによるブロックでログイン失敗:SEPP_HEADLESS=false を設定し、初回ログイン時に手動で認証を通過。以降はログイン状態が永続化されます。

  • ログイン時に「アカウント・パスワード未設定」エラー:SEPP_USERNAME / SEPP_PASSWORD が空、かつ有効な cookie がない場合。

  • sepp-auth の有効期限は約 7 日:期限切れ後は自動的に Playwright で再ログインします(ブラウザのインストールが必要)。

  • 欠陥の返却フィールドはプラットフォームの実物が基準:本ツールはプラットフォームの生 JSON をそのまま透過します。監視アラートは foundTime(または初回検出時刻)に基づいてタイムアウトを計算します。

セキュリティについて

  • アカウント・パスワード、cookie、ブラウザのログイン状態はすべてローカルの data/ に保存されます(.gitignore に追加済み)。リポジトリにコミットしないでください。

  • webhook/メールはリマインダーのみに使用し、機密データの外部送信は行いません。

Available Tools

10 tools
get_user_projectsA

获取当前登录用户在能效平台的项目信息。

示例返回:[{"productCode": "JKZS", "productId": 17, "roleName": "开发工程师", "productName": "健康诊所科技"}](该信息基本固定)

Inputs: no named parameters. Returns: result

get_usersA

查询能效平台用户列表(含 userId/userName/userAccount),可按姓名或账号模糊过滤。

用于把负责人姓名/账号映射为 userId,再传给 query_defects 过滤。

Inputs: keyword. Returns: result

login_statusA

查看当前登录状态(是否已登录、账号、sepp-auth 过期时间)及默认用户信息

Inputs: no named parameters. Returns: object

monitor_addA

新增一个缺陷监控任务(自动定时轮询 + 提醒)。

  • 负责人不填时默认监控"我"(默认用户 郑自航/1001967);也可指定: fuzzy_responser(userId/姓名/账号,查别人),或 dev_responser_id / test_responser_id(用 get_users 查 userId)

  • new_defect_alert: 是否提醒新增缺陷

  • timeout_alert / timeout_hours: 是否提醒处理超时,超过 N 小时未处理(默认 2 小时)

  • 首次执行为基线检查(只记录不提醒),之后开始提醒。

  • 提醒通过 webhook(钉钉/企微/飞书)或邮件发送,未配置时仅打印日志。 建议先 monitor_run_once 建立基线。

Inputs: name (required), status, timeout_alert, timeout_hours, +5 more. Returns: object

monitor_enableC

启用/停用一个缺陷监控任务

Inputs: name (required), enabled (required). Returns: object

monitor_listB

查看所有缺陷监控任务及状态(含已记录缺陷数)

Inputs: no named parameters. Returns: object

monitor_removeB

删除一个缺陷监控任务

Inputs: name (required). Returns: object

monitor_run_onceB

立即执行一次指定监控的检查(不等定时周期),返回本次结果(新增/超时数等)

Inputs: name (required). Returns: object

query_defectsA

查询缺陷列表(支持按负责人过滤)。

参数:

  • fuzzy_responser: 负责人模糊匹配,可填 userId/姓名/账号,例如 "1001967" 或 "郑自航"

  • dev_responser_id: 开发负责人 userId(用 get_users 查询)

  • test_responser_id: 测试负责人 userId

  • status: 缺陷状态,逗号分隔多个,默认 "1,2,3,4,5,6"(全部)

  • priority: 优先级过滤

  • summary: 标题关键字过滤

  • page_num / page_size: 分页

默认行为:三个负责人参数都不填时,默认查"我"(默认用户 郑自航/1001967)的缺陷, 与 query_my_defects 等价;要查别人请显式传 fuzzy_responser(姓名/账号/userId)。

返回平台的原始 JSON(含 total / list)。

Inputs: status, summary, page_num, priority, +4 more. Returns: object

query_my_defectsA

查询"我"(默认用户 郑自航/1001967)负责的缺陷列表。

等价于 query_defects(fuzzy_responser=默认用户 userId)。

Inputs: status, page_num, page_size. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 10 tools

    Disambiguation4/5

    Most tools are distinct, but query_my_defects duplicates query_defects with default parameters, causing potential confusion about which to use. The monitor_* tools are clearly separated from query tools, but the redundant convenience wrapper slightly reduces clarity.

    Naming Consistency4/5

    The majority follow a verb_noun pattern (get_user_projects, query_defects, monitor_add, etc.), but login_status deviates by using a noun phrase instead of a verb action. This is a minor inconsistency, easily readable but not perfectly uniform.

    Tool Count5/5

    10 tools is well-scoped for the domain of user lookup, defect querying, and monitoring lifecycle. Each tool serves a clear purpose, and the count is neither too sparse nor excessive for the apparent functionality.

    Completeness4/5

    The tool surface covers user info retrieval, defect querying with filtering, and full monitoring lifecycle (add, list, remove, enable, run_once). A minor gap is the lack of an update/edit operation for monitoring tasks, but this can be worked around by delete/add, so it's not critical.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Integrates SAST, DAST, IAST, and SCA security testing tools for AI-powered DevSecOps automation, enabling comprehensive security scanning and reporting through natural language interfaces.
      17
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to scan codebases, persist and prioritize security findings against SLAs, retrieve CVE details, propose fixes, and create tickets through its tools. It also supports agent-assisted remediation drafting while enforcing human approval and preventing auto-merge.
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables MCP clients such as Claude and Cursor to query and analyze DefectDojo findings, products, engagements, tests, and import history through the REST API v2, with optional write tools for scan imports and status updates.
      16
      85 PyPI
      4
      BSD 3-Clause
    • A
      license
      Not graded
      quality
      B
      maintenance
      Connects AI agents to a security scanning platform so they can trigger scans, search and inspect findings with evidence, triage or label issues, and pull AI-generated remediation suggestions. It also polls AI scans to completion, returns executive summaries, and surfaces severity and state statistics across connected repositories.
      MIT