mdfmcp

mdfmcp

MCP server for analyzing ASAM MDF measurement data files, enabling AI assistants to access and analyze automotive and industrial measurement data.

Category
访问服务器

README

MDF MCP Server

A Model Context Protocol (MCP) server for analyzing ASAM MDF (Measurement Data Format) files. Enables AI assistants to access and analyze automotive and industrial measurement data.

🚀 Quick Start

Using uvx (Recommended)

# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Run the server directly
uvx mcp-server-mdf

Local Development

# Clone and setup
git clone https://github.com/Shanko-26/mdfmcp
cd mdfmcp

# Install in virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e .

# Run the server
mcp-server-mdf

📋 Features

  • MDF File Support: Versions 2.x, 3.x, and 4.x
  • AI-Native Interface: Designed for LLM integration
  • Data Analysis: Statistics, plotting, signal processing
  • Format Export: CSV, HDF5, Parquet, MATLAB
  • Session Management: Multi-file support
  • High Performance: Efficient large file handling

🔧 Configuration

Important: This MCP server requires direct file system access to read MDF files. It works best with IDEs that support local file operations.

Compatible IDEs

For VS Code with Continue.dev

Add to your MCP configuration:

{
  "mcpServers": {
    "mdf": {
      "command": "uvx",
      "args": ["mcp-server-mdf@latest"]
    }
  }
}

For Cursor IDE

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "mdf": {
      "command": "uvx",
      "args": ["mcp-server-mdf@latest"]
    }
  }
}

For Windsurf/Codeium

Follow your IDE's MCP configuration guide with the same uvx command.

Troubleshooting uvx Path Issues

If you get "command not found" errors, find your uvx path:

which uvx  # On macOS/Linux  
where uvx  # On Windows

Then use the full path in your configuration:

{
  "mcpServers": {
    "mdf": {
      "command": "/Users/username/.local/bin/uvx",
      "args": ["mcp-server-mdf"]
    }
  }
}

📁 File Organization

Smart Workspace Search: The server automatically finds MDF files in your project:

your-project/
├── data.mf4              # ✅ Found by filename
├── data/
│   └── test.mf4          # ✅ Found in data/ folder
├── measurements/
│   └── run1.mf4          # ✅ Found in measurements/ folder
├── test_data/
├── examples/
└── samples/

Usage Examples:

  • "data.mf4" → Searches workspace automatically
  • "./data/test.mf4" → Relative path from current directory
  • "/absolute/path/file.mf4" → Full absolute path
  • Case insensitive: "DATA.MF4" finds "data.mf4"

🔄 Staying Current

Always use latest version by adding @latest to your IDE configuration:

{
  "mcpServers": {
    "mdf": {
      "command": "uvx",
      "args": ["mcp-server-mdf@latest"]
    }
  }
}

Check version: uvx mcp-server-mdf@latest --version

📊 Usage Examples

Open and Analyze MDF Files

User: Open the measurement file at /data/test_drive.mf4
Assistant: I'll open that MDF file for you.

[Opens file]
Successfully opened test_drive.mf4:
- Session ID: mdf_a3b2c1d4
- Version: 4.10
- Channels: 847
- Duration: 1823.4 seconds

List and Search Channels

User: What temperature channels are available?
Assistant: Let me search for temperature-related channels.

Found 23 temperature channels:
- Engine_Temp (°C) - Engine coolant temperature
- Oil_Temp (°C) - Engine oil temperature
- Ambient_Temp (°C) - Outside air temperature

Analyze and Plot Signals

User: Show me the engine speed statistics and plot it
Assistant: I'll analyze the engine speed signal.

Engine Speed Analysis:
- Mean: 2,847 RPM
- Max: 6,234 RPM
- Std Dev: 1,123 RPM

[Shows time-series plot of engine speed]

🛠️ Available Tools

Session Management

  • open_mdf - Open an MDF file
  • close_mdf - Close a session
  • list_sessions - Show active sessions
  • get_file_info - Get file metadata

Data Access

  • list_channels - List available channels
  • mdf_get - Extract single channel data
  • mdf_select - Extract multiple channels
  • mdf_get_master - Get time channel data

Analysis

  • calculate_statistics - Compute signal statistics
  • plot_signals - Create visualizations
  • mdf_to_dataframe - Convert to pandas DataFrame

Data Manipulation

  • mdf_cut - Extract time slice
  • mdf_filter - Filter specific channels
  • mdf_resample - Change sampling rate

Export

  • mdf_export - Export to various formats
  • mdf_convert - Convert between MDF versions
  • mdf_save - Save modified file

🐳 Docker Deployment (Alternative)

Build Image

docker build -t mcp-server-mdf .

Run Container

# Basic run
docker run -it --rm mcp-server-mdf

# With volume mount for data
docker run -it --rm -v /path/to/mdf/files:/data mcp-server-mdf

# With custom environment
docker run -it --rm -e MAX_SESSIONS=20 mcp-server-mdf

MCP Configuration for Docker

{
  "mcpServers": {
    "mdf": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "-v", "/path/to/data:/data", "mcp-server-mdf"]
    }
  }
}

🧪 Testing

# Run tests
pytest tests/

# Test server manually
python tests/manual_test.py

📁 Project Structure

mdfmcp/
├── src/mdfmcp/
│   ├── __init__.py
│   └── server.py          # Main MCP server
├── tests/
│   ├── conftest.py
│   ├── manual_test.py
│   └── test_server.py
├── examples/
│   ├── basic_usage.py
│   └── test_data_generator.py
├── Dockerfile
├── requirements.txt
├── pyproject.toml
└── README.md

🔧 Development

Setup Development Environment

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Install in development mode
pip install -e .

Code Quality

# Format code
black src/

# Lint
ruff src/

# Type checking
mypy src/

🚨 Troubleshooting

Common Issues

  1. Memory errors with large files

    • Use memory="low" when opening files
    • Reduce concurrent sessions
  2. Cannot find channels

    • Channel names are case-sensitive
    • Use regex patterns for flexible searching
  3. Docker build fails

    • Ensure Docker is running
    • Check Dockerfile syntax

🙏 Acknowledgments

  • Built on asammdf by Daniel Hrisca (LGPL v3+)
  • Uses the Model Context Protocol by Anthropic
  • Matplotlib for plotting capabilities
  • Pandas and NumPy for data processing

📄 License

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

Dependencies: This project uses asammdf which is licensed under LGPL v3+. The asammdf library remains a separate component and is not modified by this project.

推荐服务器

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 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
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 模型以安全和受控的方式获取实时的网络信息。

官方
精选