Labsco
sensormcp logo

SensorMCP Server

β˜… 4

from sensormcp

Automate dataset creation and train custom object detection models using natural language.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

SensorMCP Server

A SensorMCP Model Context Protocol (MCP) Server that enables automated dataset creation and custom object detection model training through natural language interactions. This project integrates computer vision capabilities with Large Language Models using the MCP standard.

🌟 About

SensorMCP Server combines the power of foundation models (like GroundedSAM) with custom model training (YOLOv8) to create a seamless workflow for object detection. Using the Model Context Protocol, it enables LLMs to:

  • Automatically label images using foundation models
  • Create custom object detection datasets
  • Train specialized detection models
  • Download images from Unsplash for training data

[!NOTE] The Model Context Protocol (MCP) enables seamless integration between LLMs and external tools, making this ideal for AI-powered computer vision workflows.

✨ Features

  • Foundation Model Integration: Uses GroundedSAM for automatic image labeling
  • Custom Model Training: Fine-tune YOLOv8 models on your specific objects
  • Image Data Management: Download images from Unsplash or import local images
  • Ontology Definition: Define custom object classes through natural language
  • MCP Protocol: Native integration with LLM workflows and chat interfaces
  • Fixed Data Structure: Organized directory layout for reproducible workflows

πŸ“ Project Structure

sensor-mcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ server.py          # Main MCP server implementation
β”‚   β”œβ”€β”€ zoo_mcp.py         # MCP entry point
β”‚   β”œβ”€β”€ models.py          # Model management and training
β”‚   β”œβ”€β”€ image_utils.py     # Image processing and Unsplash API
β”‚   β”œβ”€β”€ state.py           # Application state management
β”‚   └── data/              # Created automatically
β”‚       β”œβ”€β”€ raw_images/    # Original/unlabeled images
β”‚       β”œβ”€β”€ labeled_images/# Auto-labeled datasets  
β”‚       └── models/        # Trained model weights
β”œβ”€β”€ static/                # Web interface assets
└── index.html            # Web interface template

πŸ”§ Supported Models

Base Models (for auto-labeling)

  • GroundedSAM: Foundation model for object detection and segmentation

Target Models (for training)

  • YOLOv8n.pt: Nano - fastest inference
  • YOLOv8s.pt: Small - balanced speed/accuracy
  • YOLOv8m.pt: Medium - higher accuracy
  • YOLOv8l.pt: Large - high accuracy
  • YOLOv8x.pt: Extra Large - highest accuracy

🌐 API Integration

Unsplash API

To use image download functionality:

  1. Create an account at Unsplash Developers
  2. Create a new application
  3. Add your access key to the .env file

πŸ› οΈ Development

Running Tests

uv run pytest

Code Formatting

uv run black src/

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

πŸ“– Citation

If you use this code or data in your research, please cite our paper:

@inproceedings{Guo2025,
  author = {Guo, Yunqi and Zhu, Guanyu and Liu, Kaiwei and Xing, Guoliang},
  title = {A Model Context Protocol Server for Custom Sensor Tool Creation},
  booktitle = {3rd International Workshop on Networked AI Systems (NetAISys '25)},
  year = {2025},
  month = {jun},
  address = {Anaheim, CA, USA},
  publisher = {ACM},
  doi = {10.1145/3711875.3736687},
  isbn = {979-8-4007-1453-5/25/06}
}

πŸ“„ License

This project is licensed under the MIT License.

πŸ“§ Contact

For questions about the zoo dataset mentioned in development: Email: yq@anysign.net