MCP Server for Paper Analytical Devices (PAD)

MCP Server for Paper Analytical Devices (PAD)

By psaboia GitHub

A Python MCP Server for Paper Analytical Devices (PAD)

paper-analytical-devices mcp-server
Overview

What is MCP Server for PAD?

MCP Server for Paper Analytical Devices (PAD) is a Python-based server that provides a standardized interface for interacting with the PAD system at Notre Dame, enabling LLM-based tools to access and process PAD data through the Model Context Protocol.

How to use MCP Server for PAD?

To use the MCP Server, clone the repository, configure it with Claude Desktop settings, and start the server using the provided commands. Ensure you have Python 3.12 or higher installed.

Key features of MCP Server for PAD?

  • Card Management: Retrieve and list PAD test cards with metadata, access individual card details, and process card images.
  • Neural Network Integration: List available neural networks and access their configurations.
  • Project Organization: Manage PAD projects and track issues and samples.
  • Image Processing: High-quality image resizing and optimization with detailed metadata.

Use cases of MCP Server for PAD?

  1. Managing and analyzing PAD test cards.
  2. Integrating neural networks for data analysis.
  3. Processing and optimizing images for research purposes.

FAQ from MCP Server for PAD?

  • What is the purpose of the MCP Server?

It provides a standardized interface for accessing and processing PAD data.

  • Is there a specific Python version required?

Yes, Python 3.12 or higher is required.

  • How do I start the server?

Use the command uv run python pad.py after configuration.

Content

MCP Server for Paper Analytical Devices (PAD)

An MCP server implementation that provides a standardized interface to interact with the Paper Analytical Devices (PAD) system at Notre Dame (pad.crc.nd.edu). This server enables LLM-based tools and agents to access and process PAD data through the Model Context Protocol.

Features

  • Card Management:
    • Retrieve and list PAD test cards with comprehensive metadata
    • Access individual card details including camera type, quantities, and IDs
    • Process and store card images with high-quality resizing
  • Neural Network Integration:
    • List available neural networks
    • Access network configurations
    • Interface with analysis systems
  • Project Organization:
    • Manage PAD projects
    • Handle card groups
    • Track issues and samples
  • Image Processing:
    • High-quality image resizing using Lanczos resampling
    • Automatic image optimization (300px max width)
    • Card geometry handling with coordinate scaling
    • Detailed image metadata (dimensions, paths)

Setup

For Claude Desktop Users

  1. Ensure you have Python 3.12 or higher installed
  2. Clone this repository
  3. Configure Claude Desktop with the settings below (no manual package installation needed)

Configuration

Claude Desktop Configuration

To use this server with Claude Desktop, add the following configuration to your Claude settings:

{
  "mcpServers": {
    "pad": {
      "command": "<path-to-uv>",
      "args": [
        "--directory",
        "<path-to-repository>",
        "run",
        "main.py"
      ],
      "env": {
        "FILESYSTEM_STORAGE": "<path-to-storage-directory>"
      }
    }
  }
}

Configuration parameters:

  • <path-to-uv>: Path to your uv installation (e.g., ~/.local/bin/uv)
  • <path-to-repository>: Absolute path to where you cloned this repository
  • <path-to-storage-directory>: Directory where you want to store PAD files (defaults to ~/Documents/pad_storage if not specified)

This configuration:

  • Uses uv to automatically manage Python dependencies - no manual installation needed
  • Sets the correct working directory
  • Runs the server through main.py
  • Configures the storage location (defaults to ~/Documents/pad_storage if not specified)

After configuring Claude Desktop with these settings, all PAD server tools (cards, neural networks, image processing) will be available through the MCP interface.

Usage

Start the server manually:

uv run python pad.py

The server exposes the following MCP tools:

  • get_v2_cards(): List all available cards with comprehensive metadata (camera type, quantities, IDs)
  • get_v2_card_by_id(card_id): Get detailed card information including all metadata fields
  • get_v2_neural_networks(): List available neural networks
  • get_v2_neural_network_by_id(nn_id): Get specific neural network details
  • get_v2_projects(): List all projects
  • get_card_image_by_id(card_id): Retrieve, process, and optimize card images with metadata
  • load_image(path): Load and process images from disk
  • load_card_geometry(path): Load and scale v2 card geometry
  • multiply_coordinates(data, factor): Scale geometry coordinates for processing

API Integration

The server communicates with the PAD API at https://pad.crc.nd.edu and provides a standardized interface through MCP. This allows seamless integration with LLM-based tools while maintaining security and structure.

Dependencies

Managed automatically by uv through Claude Desktop:

  • httpx (>=0.28.1): For API communication
  • mcp[cli] (>=1.3.0): MCP server functionality
  • Pillow (>=11.1.0): High-quality image processing

Examples

Using with Claude Desktop

When using the PAD server with Claude Desktop, you can have natural conversations about your PAD cards. Here are some example interactions:

Prompt: Can you show the image for the card 51866?

image

Prompt: List PAD projects created after Jully 2024.

image

Prompt: Can you list the neural networks added via PAD API after July 2024

image

Development

This server is built using FastMCP and follows the Model Context Protocol for tool definitions and interactions. For more information about MCP, visit modelcontextprotocol.io.

Security

All interactions with the PAD API are handled securely through the server. Data storage is managed locally in the configured filesystem location.

Notes

We now have a new server, main_swagger.py that automatically builds the tools associated with API.

Configure for Claude with

"pad": {
            "command": "uv",
            "args": [
              "--directory",
              "/Users/csweet1/Documents/projects/earth616/mcp-server-pad",
              "run",
              "main_swagger.py"
            ],
            "env": {
              "SERVER_BASE_URL": "https://pad.crc.nd.edu",
              "OPENAPI_SPEC_URL": "https://pad.crc.nd.edu/api-ld/v3/openapi.json",
              "FILESYSTEM_STORAGE": "/Users/csweet1/Documents/projects/earth616/pad_storage"
            }
        }
No tools information available.

Mirror of

image-generation mcp-server
View Details

Secure MCP server for analyzing Excel files with oletools

oletools mcp-server
View Details

Mirror of

bigquery mcp-server
View Details

MCPHubs is a website that showcases projects related to Anthropic's Model Context Protocol (MCP)

mcp mcp-server
View Details
Dealx
Dealx by DealExpress

-

dealx mcp-server
View Details

Google Analytics MCP server for accessing analytics data through tools and resources

google-analytics mcp-server
View Details

A Python-based MCP server that lets Claude run boto3 code to query and manage AWS resources. Execute powerful AWS operations directly through Claude with proper sandboxing and containerization. No need for complex setups - just pass your AWS credentials and start interacting with all AWS services.

aws mcp-server
View Details