aig-risk-profiler-mcp
v1.2.4
Published
MCP server for generating Management Liability Coverage (MLC) risk analysis reports from Chinese company annual report PDFs
Maintainers
Readme
aig-risk-profiler-mcp
A Model Context Protocol (MCP) server for generating Management Liability Coverage (MLC) risk analysis reports from Chinese company annual report PDFs.
Features
- analyze_company: Upload a company annual report PDF and start analysis
- check_task_status: Check the status and progress of an analysis task
- get_report: Retrieve the completed analysis as a PDF download URL or markdown content
Prerequisites
- Node.js >= 18.0.0
- The MLC Agent backend must be running (see backend setup instructions)
Installation
From npm
npm install -g aig-risk-profiler-mcpUsage with Claude Desktop
Add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Using npx (recommended)
{
"mcpServers": {
"aig-risk-profiler": {
"command": "npx",
"args": ["-y", "aig-risk-profiler-mcp"],
"env": {
"BACKEND_URL": "https://aig-risk-profiler.ragents.net"
}
}
}
}Using global install
{
"mcpServers": {
"aig-risk-profiler": {
"command": "aig-risk-profiler-mcp",
"env": {
"BACKEND_URL": "http://localhost:8101"
}
}
}
}Using local build
{
"mcpServers": {
"aig-risk-profiler": {
"command": "node",
"args": ["/path/to/mcp-server/dist/index.js"],
"env": {
"BACKEND_URL": "http://localhost:8101"
}
}
}
}Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| BACKEND_URL | URL of the MLC Agent backend API | http://localhost:8101 |
Tools
analyze_company
Upload a Chinese company annual report PDF and start MLC analysis.
Input:
pdf_path(required): Local file path to the company annual report PDF
Output:
task_id: ID to track the analysis taskstatus: Current status of the taskmessage: Human-readable message
Example:
User: 分析这个年报 /Users/me/Documents/紫光股份2023年报.pdf
AI: [calls analyze_company] 分析已开始,任务ID是 123check_task_status
Check the status and progress of an analysis task. Use this to monitor if a task is still running, completed, or failed.
Input:
task_id(required): The task ID returned by analyze_company
Output:
task_id: The task IDstatus: "pending", "running", "completed", or "failed"progress: Human-readable progress messagecurrent_step: Name of the currently running step (if any)completed_steps: Number of completed stepstotal_steps: Total number of stepscompany_name: Name of the company being analyzederror: Error message if the task failed
Example:
User: 任务 123 完成了吗?
AI: [calls check_task_status] 正在运行:研究新闻和监管文件(7/10 步骤已完成)get_report
Retrieve the MLC analysis report for a completed task.
Input:
task_id(required): The task ID returned by analyze_companyformat(optional): Report format - "pdf" (default) or "markdown"
Output:
status: "completed" or "not_completed"format: The report format ("pdf" or "markdown")download_url: URL to download the PDF (for pdf format)content: The markdown content (for markdown format)company_name: Name of the analyzed companymessage: Human-readable message
Example:
User: 给我报告
AI: [calls get_report] PDF报告已生成:http://localhost:8101/api/tasks/123/report/downloadTypical Workflow
Analysis takes approximately 20 minutes. The workflow is designed to be asynchronous:
- Start Analysis: Use
analyze_companyto upload a PDF and start the analysis - Check Progress: Use
check_task_statusperiodically to monitor progress - Get Report: Once completed, use
get_reportto get the PDF download URL
User: 分析 /path/to/annual_report.pdf
AI: [calls analyze_company] 分析已开始,任务ID是 123,预计需要20分钟
User: 好了吗?
AI: [calls check_task_status] 正在运行:研究新闻和监管文件(7/10 步骤已完成)
User: 现在呢?
AI: [calls check_task_status] 已完成!
User: 给我报告
AI: [calls get_report] PDF报告下载链接:http://localhost:8101/api/tasks/123/report/downloadDevelopment
# Install dependencies
pnpm install
# Run in development mode
pnpm dev
# Type check
pnpm typecheck
# Build for production
pnpm build
# Run production build
pnpm startPDF Reports
PDF reports are generated by the backend and include:
- Company overview
- Financial analysis
- Governance structure
- Shareholder information
- News and regulatory findings
- Risk assessment
- Works cited / data sources
The PDF is professionally styled with:
- Clear typography and hierarchy
- Table formatting
- Risk indicators
- Print-optimized layout
Troubleshooting
Backend connection refused
Make sure the MLC Agent backend is running:
cd backend
docker compose up -d
# or
uv run uvicorn mlc_agent.main:app --port 8101Task timeout
Analysis can take several minutes for large PDFs. Use check_task_status to monitor progress. If a task takes too long, check the backend logs.
Changelog
v1.1.0
- Added
check_task_statustool for monitoring task progress - Moved PDF generation from MCP to backend
- Simplified
get_reporttool - now returns download URL instead of generating PDF locally - Removed
wait_for_completionparameter fromget_report - Removed
md-to-pdfdependency - Removed
OUTPUT_DIRenvironment variable
v1.0.0
- Initial release
analyze_companytool for uploading PDFsget_reporttool with local PDF generation
License
MIT
