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 쿠키를 획득한 후 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 서비스 내에 내장되어 있습니다(서비스 실행 중 자동으로 폴링하며 모니터링을 복구합니다). 추가로 두 가지 독립 실행 방식을 제공합니다:

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가 비어 있고 유효한 쿠키도 없는 경우입니다.

  • sepp-auth 유효 기간 약 7일: 만료 후 자동으로 Playwright 로그인을 다시 수행합니다(브라우저 설치 필요).

  • 결함 반환 필드는 플랫폼 실제 기준을 따름: 이 도구는 플랫폼 원본 JSON을 그대로 전달합니다. 모니터링 알림은 foundTime(또는 최초 발견 시간)을 기준으로 타임아웃을 계산합니다.

보안 안내

  • 계정 비밀번호, 쿠키, 브라우저 로그인 상태는 모두 로컬 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