windpacer d09ef95869 feat: Phase 6 보강 도구 5종 (find_tags, query_events, active_alarms, summarize_events, generate_status_report)
이벤트 중심 도구와 LLM 요약/보고서 도구를 추가해 채팅에서
"활성 알람", "교대 보고서", "이벤트 요약" 같은 운전원 요청을 처리.

신규 MCP 도구 (mcp-server/server.py):
- find_tags(query, area?, top_k):
    v_tag_summary 뷰 기반. base_tag 또는 description ILIKE 매칭.
    PV/SP/OP/설명/area 함께 반환.
- query_events(tag_name?, event_type?, area?, since?, until?, limit):
    event_history_table 필터 조회. since/until 미지정 시 최근 24h.
    event_type은 ALARM/TRIP/NORMAL/RUN/CHANGE 5종.
- active_alarms(area?, limit):
    DISTINCT ON (tagname)으로 태그별 최신 이벤트 추출 후
    ALARM/TRIP만 반환 (NORMAL 들어왔으면 자동 해제).
- summarize_events(since?, area?, event_type?, max_events, focus?):
    query_events 결과를 LLM에 넣어 한국어 6~10줄 구조화 요약
    (현황/알람/패턴/권고) + by_type/by_area 통계.
- generate_status_report(area?, hours):
    활성 알람 + 최근 이벤트 통계/표본을 LLM에 넘겨
    교대 보고서 형식(요약/알람/이벤트분석/권고) 마크다운 생성.
    윈도우 1~168시간, 기본 24시간.

공통:
- prepared statement(파라미터 바인딩)로 SQL 인젝션 방지
- SET statement_timeout = SQL_STATEMENT_TIMEOUT_MS 적용
- _DB_SCHEMA에 event_history_table 정의 추가 (NL2SQL 인지용)

시스템 프롬프트 (OllamaController):
- ToolGuideKo에 신규 5종 + search_kb + event_type 5종 명시
- run_sql 자동 가드(LIMIT/timeout) 안내 추가

검증:
- dotnet build: 경고 0건, 에러 0건
- python3 -m py_compile: OK
- import server 후 5개 도구 attribute 확인

런타임:
- mcp-server 재시작 시 신규 도구 자동 인식
- 클라이언트는 ListToolsAsync로 동적 수집 — 추가 작업 불필요

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 05:24:36 +09:00
2026-05-09 04:28:10 +09:00
2026-05-09 04:28:10 +09:00

ExperionCrawler

Honeywell Experion OPC UA 서버를 위한 웹 기반 데이터 수집 도구.

아키텍처

ExperionCrawler/
└── src/
    ├── Core/
    │   ├── Domain/Entities/          # ExperionTag, ExperionRecord, ExperionServerConfig ...
    │   ├── Application/
    │   │   ├── Interfaces/           # IExperionCertificateService, IExperionOpcClient ...
    │   │   ├── Services/             # ExperionCrawlService
    │   │   └── DTOs/                 # ExperionServerConfigDto, ExperionCrawlRequestDto ...
    │   └── (Domain 은 Infrastructure 에 의존하지 않음)
    │
    ├── Infrastructure/
    │   ├── Certificates/             # ExperionCertificateService (pki/ 폴더 관리)
    │   ├── OpcUa/                    # ExperionOpcClient, ExperionStatusCodeService
    │   ├── Csv/                      # ExperionCsvService (CsvHelper)
    │   └── Database/                 # ExperionDbContext + ExperionDbService (EF Core / SQLite)
    │
    └── Web/
        ├── Controllers/              # ExperionCertificateController, ConnectionController ...
        ├── Program.cs                # DI 등록, 미들웨어
        └── wwwroot/                  # index.html + css/style.css + js/app.js

기능

메뉴 설명
01 인증서 관리 OPC UA 클라이언트 X.509 인증서 생성 / 상태 확인
02 서버 접속 테스트 OPC UA 서버 연결 테스트, 단일 태그 읽기, 노드 탐색
03 데이터 크롤링 복수 노드 주기 수집 → CSV 저장
04 DB 저장 CSV 파일 → SQLite DB 임포트, 레코드 조회

Ubuntu 서버 배포

사전 요구사항

# .NET 8 SDK (없으면 deploy.sh 가 자동 설치)
dotnet --version

한 번에 배포

git clone <repo> ExperionCrawler
cd ExperionCrawler
sudo bash deploy.sh

수동 실행 (개발/테스트)

cd src/Web
dotnet run
# → http://localhost:5000

서비스 관리

sudo systemctl status  experioncrawler
sudo systemctl restart experioncrawler
sudo systemctl stop    experioncrawler
sudo journalctl -u experioncrawler -f   # 실시간 로그

PKI 디렉토리 구조 (원본 Program.cs 준수)

<실행 위치>/
└── pki/
    ├── own/certs/{clientHostName}.pfx   ← 생성된 클라이언트 인증서
    ├── trusted/certs/                    ← 신뢰 피어 인증서
    ├── issuers/certs/                    ← 신뢰 발급자 (필수 경로)
    └── rejected/certs/                   ← 거부된 인증서

데이터 저장 위치

<실행 위치>/
└── data/
    ├── experion.db      ← SQLite DB
    └── csv/             ← 크롤링 CSV 파일

API 엔드포인트

GET  /api/certificate/status?clientHostName=dbsvr
POST /api/certificate/create       { clientHostName, subjectAltNames, pfxPassword }

POST /api/connection/test           { serverHostName, port, clientHostName, userName, password }
POST /api/connection/read           { serverConfig, nodeId }
POST /api/connection/browse         { serverConfig, startNodeId? }

POST /api/crawl/start               { serverConfig, nodeIds[], intervalSeconds, durationSeconds }

GET  /api/database/files
POST /api/database/import           { fileName }
GET  /api/database/records?limit=100&from=&to=

Swagger UI: http://<서버IP>:5000/swagger (Development 모드)

패키지 버전

패키지 버전
OPCFoundation.NetStandard.Opc.Ua.Client 1.5.374.85
OPCFoundation.NetStandard.Opc.Ua.Core 1.5.374.85
CsvHelper 33.0.1
Microsoft.EntityFrameworkCore.Sqlite 8.0.13
Swashbuckle.AspNetCore 6.8.1
Description
No description provided
Readme 55 MiB
Languages
C# 43.4%
Python 31.1%
JavaScript 16.2%
HTML 4.6%
CSS 4%
Other 0.7%