dwf-analyzer-mcp

dwf-analyzer-mcp

An MCP server for analyzing DWF files using Amazon Bedrock's Nova Pro model, enabling visual analysis, metadata extraction, and image extraction from DWF drawings.

Category
访问服务器

README

DWF Analyzer MCP Server

smithery badge

A Model Context Protocol (MCP) server for analyzing DWF (Design Web Format) files using Amazon Bedrock's Nova Pro model for visual analysis.

Features

  • DWF File Parsing: Extract metadata, layers, and object information from DWF files
  • Image Extraction: Extract embedded images from DWF files with format detection and conversion
  • Visual Analysis: Analyze drawings using Amazon Nova Pro multimodal AI model
  • Comprehensive Analysis: Combined metadata extraction, image processing, and visual analysis

Installation

Prerequisites

  • Python 3.12 or higher
  • AWS account with Bedrock access
  • AWS credentials configured

Install from Source

git clone https://github.com/jesamkim/dwf-analyzer-mcp.git
cd dwf-analyzer-mcp
uv install

Using uvx (Recommended)

uvx dwf-analyzer-mcp

Configuration

Environment Variables

Set the following environment variables:

export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
export AWS_DEFAULT_REGION="us-west-2"  # Optional, defaults to us-west-2
export LOG_LEVEL="INFO"  # Optional, defaults to INFO

AWS Permissions

Your AWS credentials need the following permissions:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "bedrock:InvokeModel",
                "bedrock:InvokeModelWithResponseStream"
            ],
            "Resource": [
                "arn:aws:bedrock:*::foundation-model/us.anthropic.claude-3-7-sonnet-20250219-v1:0",
                "arn:aws:bedrock:*::foundation-model/us.amazon.nova-pro-v1:0"
            ]
        }
    ]
}

Usage

Running the Server

# Using the installed package (HTTP transport)
dwf-analyzer-mcp

# Using uvx (HTTP transport)
uvx dwf-analyzer-mcp

# Using FastMCP directly (HTTP transport)
fastmcp run dwf_analyzer_mcp.server:mcp --transport streamable-http

# Custom host and port
HOST=0.0.0.0 PORT=8080 dwf-analyzer-mcp

MCP Client Configuration

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "dwf-analyzer": {
      "url": "http://localhost:8080/mcp",
      "transport": "http",
      "env": {
        "AWS_ACCESS_KEY_ID": "your-access-key",
        "AWS_SECRET_ACCESS_KEY": "your-secret-key",
        "AWS_DEFAULT_REGION": "us-west-2"
      }
    }
  }
}

Cursor IDE

Add an HTTP-type server:

{
  "url": "http://localhost:8080/mcp",
  "transport": "http"
}

Zed Editor

Add to your MCP settings:

{
  "dwf-analyzer": {
    "url": "http://localhost:8080/mcp",
    "transport": "http"
  }
}

Available Tools

Core Analysis Tools

extract_dwf_metadata

Extract metadata and basic information from a DWF file.

Parameters:

  • file_path (string): Path to the DWF file

Returns: Dictionary containing file metadata, layers, and object summary

extract_dwf_images

Extract embedded images from a DWF file.

Parameters:

  • file_path (string): Path to the DWF file
  • output_dir (string, optional): Directory to save extracted images

Returns: Dictionary containing extraction results and image information

analyze_dwf_visual

Perform visual analysis of a DWF file using Amazon Nova Pro.

Parameters:

  • file_path (string): Path to the DWF file
  • focus_area (string): Analysis focus area (general)
  • include_metadata (boolean): Whether to include file metadata in results

Returns: Dictionary containing visual analysis results

analyze_dwf_comprehensive

Perform comprehensive analysis including metadata, images, and visual analysis.

Parameters:

  • file_path (string): Path to the DWF file

Returns: Dictionary containing complete analysis results

System Tools

health_check

Perform a health check of the service.

Returns: Dictionary containing service health status

Available Resources

dwf://analysis/config

Get the current analysis configuration schema.

dwf://analysis/supported-formats

Get information about supported DWF formats and capabilities.

Supported Formats

  • DWF Versions: V00.22, V00.30, V00.55, V06.00
  • Image Formats: PNG, JPEG, BMP, GIF, WEBP
  • Max File Size: 100MB
  • AWS Regions: us-west-2, us-east-1, eu-west-1, ap-southeast-1

Analysis Focus Areas

  • general: Overall drawing analysis

Development

Setup Development Environment

git clone https://github.com/jesamkim/dwf-analyzer-mcp.git
cd dwf-analyzer-mcp
uv install --dev

Running Tests

uv run pytest

Code Formatting

uv run black src tests
uv run ruff check src tests

Type Checking

uv run mypy src

Examples

Basic Usage

# Extract metadata from a DWF file
result = extract_dwf_metadata("/path/to/drawing.dwf")
print(result["metadata"]["header"]["version"])

# Extract images
images = extract_dwf_images("/path/to/drawing.dwf", "/output/directory")
print(f"Extracted {images['extracted_images']} images")

# Perform visual analysis
analysis = analyze_dwf_visual("/path/to/drawing.dwf", focus_area="general")
print(analysis["visual_analysis"])

Comprehensive Analysis

# Perform complete analysis
result = analyze_dwf_comprehensive("/path/to/drawing.dwf")

# Access different parts of the analysis
metadata = result["metadata"]
images = result["image_extraction"]
visual = result["visual_analysis"]

Troubleshooting

Common Issues

  1. AWS Credentials Error

    • Ensure AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set
    • Verify your AWS account has Bedrock access
  2. Model Access Error

    • Check if Nova Pro model is available in your AWS region
    • Verify your AWS permissions include bedrock:InvokeModel
  3. Image Processing Error

    • Ensure Pillow is installed: pip install pillow
    • Check if the DWF file contains extractable images
  4. File Not Found Error

    • Verify the DWF file path is correct and accessible
    • Check file permissions

Debug Mode

Enable debug logging:

export LOG_LEVEL=DEBUG
dwf-analyzer-mcp

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Changelog

v0.2.0

  • BREAKING CHANGE: Migrated from STDIO to Streamable HTTP transport
  • Updated server configuration for HTTP deployment
  • Added uvicorn and starlette dependencies for HTTP server support
  • Updated client configuration examples for HTTP transport
  • Improved scalability and production deployment capabilities

v0.1.0

  • Initial release
  • Basic DWF parsing functionality
  • Image extraction capabilities
  • Amazon Nova Pro integration
  • FastMCP server implementation
  • Comprehensive analysis tools

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选