Token导航 LogoToken导航TokenDH.com
ewa MCP logo
文档知识stdio官方级别未说明来源级核验

ewa MCP

MCP Server

一个容器化系统,用于处理SAP EWA PDF文件,通过GPT-5.2 Vision提取警报,使用Markdown标题分块内容,通过Azure OpenAI进行向量化,存储在Azure AI搜索中,并通过Streamable HTTP暴露MCP服务器以集成Copilot/Claude Desktop。

工具数

7

提示词数

0

GitHub Stars

0

资源数

0
向量搜索PythonClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

senjoyee

提供方

senjoyee

最后核验

2026/5/17 20:22

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python infrastructure/scripts/setup-indexes.py \

详细介绍

SAP早期监控警报MCP系统

一个容器化系统,它接收SAP EWA PDF,使用GPT-5.2 Vision提取警报,通过markdown标头对内容进行块化,使用Azure OpenAI进行矢量化,存储在Azure AI Search(多租户共享索引)中,并通过Streamable HTTP公开MCP服务器,用于Copilot/Claude Desktop集成。

建筑

EWA PDF Upload → Blob Storage → Azure Function → GPT-5.2 Vision (alerts) + pymupdf4llm (text)
                                          ↓
                        Markdown Header Chunking → OpenAI Embedding → Azure AI Search
                                          ↓
                                MCP Server (ACA) ← Event Grid (status events)
                                          ↓
                                Copilot / Claude Desktop

组件

组件技术目的
文档处理器Azure函数(Python)PDF提取、警报提取、分块、嵌入
MCP服务器FastAPI+MCP SDK流式HTTP MCP端点
矢量存储Azure AI搜索文档、块和警报存储
嵌入Azure OpenAI文本嵌入-3小1536维向量
警报提取Azure OpenAI GPT-5.2视觉第1-4页图像分析
事件Azure事件网格处理状态跟踪

快速开始

1.部署基础设施

cd infrastructure/bicep
az deployment group create \
  --resource-group ewa-mcp-rg \
  --template-file main.bicep \
  --parameters personResponsible="Your Name"

或者使用现有的OpenAI:

az deployment group create \
  --resource-group ewa-mcp-rg \
  --template-file main.bicep \
  --parameters personResponsible="Your Name" \
  --parameters deployOpenAI=false \
  --parameters existingOpenAIEndpoint="https://
.openai.azure.com/" \
  --parameters existingOpenAIKey=""

2.设置搜索索引

python infrastructure/scripts/setup-indexes.py \
  --endpoint $AZURE_SEARCH_ENDPOINT \
  --api-key $AZURE_SEARCH_API_KEY

3.部署文档处理器

cd processor
func azure functionapp publish ewa-processor-prod

4.部署MCP服务器

cd mcp-server
az acr build --registry ewaacr --image ewa-mcp:latest .
az containerapp update --name ewa-mcp --image ewaacr.azurecr.io/ewa-mcp:latest

5.配置MCP客户端

添加到Claude桌面配置:

{
  "mcpServers": {
    "ewa": {
      "url": "https://ewa-mcp.your-region.azurecontainerapps.io/mcp",
      "headers": {
        "Authorization": "Bearer your-api-key"
      }
    }
  }
}

使用现有的OpenAI部署

如果你已经有了OpenAI部署 gpt-5.2text-embedding-3-small,您可以跳过创建新的:

选项1:使用deploy.py脚本

python deploy.py \
  --subscription  \
  --resource-group ewa-mcp-rg \
  --person-responsible "Your Name" \
  --use-existing-openai \
  --openai-endpoint "https://your-openai.openai.azure.com/" \
  --openai-key "your-api-key"

选项2:手动二头肌展开

az deployment group create \
  --resource-group ewa-mcp-rg \
  --template-file infrastructure/bicep/main.bicep \
  --parameters personResponsible="Your Name" \
  --parameters deployOpenAI=false \
  --parameters existingOpenAIEndpoint="https://your-openai.openai.azure.com/" \
  --parameters existingOpenAIKey="your-api-key"

这将使用您现有的部署进行GPT-5.2视觉警报提取和文本嵌入-3小矢量化。

MCP工具

工具说明
list_reports列出客户可用的EWA报告
get_alert_overview从报告中获取所有警报
get_alert_detail获取包含证据块的详细警报
get_section检索特定文档部分
ask_ewa_scoped跨报告的RAG查询
compare_reports比较两个报告之间的警报
generate_action_pack生成可交付的行动包

目录结构

/ewa-mcp
├── /processor              # Azure Function for PDF processing
│   ├── extractors/         # PDF extraction, GPT-5.2 Vision
│   ├── chunkers/           # Markdown chunking
│   ├── embedders/          # OpenAI embeddings
│   ├── indexers/           # Azure AI Search indexing
│   └── eventgrid/          # Event Grid publisher
├── /mcp-server             # FastAPI MCP server
│   ├── tools/              # MCP tool implementations
│   ├── search/             # Search client wrapper
│   └── auth/               # API key middleware
├── /infrastructure         # Bicep templates
│   ├── bicep/              # ARM/Bicep templates
│   └── scripts/            # Setup scripts
├── /shared                 # Shared Pydantic models
│   └── models/             # Alert, Chunk, Document, Citation
└── /tests                  # Test suites

配置

处理器(Azure功能)

{
  "AZURE_OPENAI_ENDPOINT": "https://...openai.azure.com/",
  "AZURE_OPENAI_API_KEY": "...",
  "AZURE_OPENAI_VISION_DEPLOYMENT": "gpt-5.2",
  "AZURE_OPENAI_EMBEDDING_DEPLOYMENT": "text-embedding-3-small",
  "AZURE_SEARCH_ENDPOINT": "https://...search.windows.net",
  "AZURE_SEARCH_API_KEY": "...",
  "EVENTGRID_ENDPOINT": "https://...eventgrid.azure.net",
  "EVENTGRID_KEY": "..."
}

MCP服务器

AZURE_SEARCH_ENDPOINT=https://...search.windows.net
AZURE_SEARCH_API_KEY=...
AZURE_OPENAI_ENDPOINT=https://...openai.azure.com/
AZURE_OPENAI_API_KEY=...
API_KEY=your-secure-api-key
PORT=8000

多租户

所有索引均由多租户共享 customer_id 作为必需的过滤字段。每个查询都必须包含customer_id过滤以实现数据隔离。

处理流程

  1. 上传PDF至 ewa-uploads/{customer_id}/{filename}
  2. Blob触发器触发Azure函数
  3. 发射 EwaProcessingStarted 事件
  4. 将第1-4页提取为图像→ GPT-5.2愿景→ 结构化警报
  5. 提取完整的PDF文本→ 通过pymupdf4llm降价
  6. 按标题分组标记(保留section_path)
  7. 生成嵌入(1536d)
  8. 上传到3个索引: ewa-docs, ewa-chunks, ewa-alerts
  9. 发射 EwaProcessingCompleted 事件

许可证

麻省理工学院

目录标签

目录标签

向量搜索PythonClaudeSAPEWA处理混合部署PDF解析AI警报提取MCP服务器

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

api-key

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

7

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdioapi-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP