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
Visit Server

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured