| title | OpenPIV MCP Server |
|---|---|
| emoji | 🌊 |
| colorFrom | blue |
| colorTo | purple |
| sdk | docker |
| sdk_version | edge |
| pinned | false |
| license | mit |
Particle Image Velocimetry (PIV) analysis via MCP protocol.
- compute_piv: Compute velocity fields from image pairs
- create_quiver_plot: Generate vector field visualizations
- Web UI: Interactive Gradio interface for uploading images and viewing results
- MCP Protocol: Connect to Claude Desktop, Cursor, Windsurf, and other MCP clients
Run the MCP server locally using stdio transport:
# Clone and install
git clone https://huggingface.co/spaces/alexliberzon/openpiv-mcp
cd openpiv-mcp
pip install -r requirements.txt
# Run the MCP server
python src/openpiv_mcp.pyClaude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"openpiv": {
"command": "python",
"args": ["/absolute/path/to/openpiv-mcp/src/openpiv_mcp.py"]
}
}
}The server is deployed on Hugging Face Spaces with both web UI and MCP endpoint:
- Web UI: https://alexliberzon-openpiv-mcp.hf.space
- MCP Endpoint:
https://alexliberzon-openpiv-mcp.hf.space/gradio_api/mcp/
MCP Client Config:
{
"mcpServers": {
"openpiv": {
"url": "https://alexliberzon-openpiv-mcp.hf.space/gradio_api/mcp/"
}
}
}Note: When using the remote MCP server, images must be provided as:
- HTTP/HTTPS URLs (e.g.,
https://example.com/image.png) - Base64 data URLs (e.g.,
data:image/png;base64,iVBOR...)
Visit https://alexliberzon-openpiv-mcp.hf.space to use the interactive web interface:
- Upload two consecutive frames (Frame A and Frame B)
- Adjust parameters (window size, overlap, time delay)
- Click "Compute PIV" to get velocity field data
- Use the "Quiver Plot" tab to visualize results
Compute Particle Image Velocimetry velocity field from two images.
Parameters:
image_a(str): Image URL, base64 data URL, or file path (local only)image_b(str): Image URL, base64 data URL, or file path (local only)window_size(int): Interrogation window size (default: 32)overlap(int): Overlap between windows (default: 16)dt(float): Time delay between frames (default: 1.0)
Returns: Summary statistics and CSV file path
Create a quiver (vector field) plot from PIV results.
Parameters:
csv_file(str): Path to PIV results CSV filetitle(str): Plot title (default: "PIV Velocity Field")scale(int): Quiver scale factor (default: 50)cmap(str): Colormap (default: "viridis")
Returns: PIL Image of the quiver plot
**PIV computation successful!**
**Summary Statistics:**
- Total vectors computed: 660
- Valid vectors (s2n>1): 580
- Mean U velocity: -0.0814
- Max U velocity: 1.7142
- Max V velocity: 6.9067
# Test with demo images
python -c "
from openpiv_client import compute_piv, create_quiver_plot
import asyncio
async def test():
result = await compute_piv(
image_a_path='demo/test1/exp1_001_a.bmp',
image_b_path='demo/test1/exp1_001_b.bmp'
)
print(result)
asyncio.run(test())
"MIT License