linksphere-mcp
v1.1.0
Published
A Model Context Protocol (MCP) server for discovering and managing nearby devices (Bluetooth, WiFi, USB, etc.) with REAL device scanning
Maintainers
Readme
🌐 LinkSphere MCP
Connect AI to the Physical World
A powerful Model Context Protocol (MCP) server that enables AI assistants to discover, connect to, and control nearby devices through a simple, intuitive interface.
✨ Features
- 🔍 Device Discovery - Scan for nearby Bluetooth, WiFi, USB, and Network devices
- 📡 Smart Connection - Connect and disconnect from devices seamlessly
- 🎮 Device Control - Control connected devices with simple commands
- 🚀 Streamable HTTP - Fast, stateless HTTP transport for maximum compatibility
- 🔒 Secure - Built-in session management and error handling
- 📦 Zero Configuration - Works out of the box with sensible defaults
🎯 Use Cases
- Smart Home Control - Manage IoT devices, smart lights, thermostats
- Audio Management - Control Bluetooth speakers, headphones, volume
- Network Management - Monitor and connect to WiFi networks
- Device Monitoring - Track nearby devices and their status
- Automation - Build AI-powered device automation workflows
🚀 Quick Start
Installation
npm install linksphere-mcpRunning the Server
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm run start:httpThe server will start on http://localhost:3000 by default.
Configuration
Create a .env file in the root directory:
PORT=3000
NODE_ENV=production🔧 MCP Client Configuration
Add to your MCP client configuration (e.g., Claude Desktop's mcp.json):
{
"mcpServers": {
"linksphere": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp",
"timeout": 600
}
}
}📚 Available Tools
1️⃣ show - Discover Nearby Devices
Scan for nearby devices based on type.
Parameters:
deviceType(required): Type of devices to discoverbluetooth- Bluetooth devices (headphones, speakers, etc.)wifi- WiFi networksusb- USB connected devicesnetwork- Network/IoT devices
Example:
show nearby bluetooth devicesResponse:
Found 4 device(s):
### 📱 Device 1: AirPods Pro
- Type: Audio Device
- Signal: -45 dBm (Excellent)
- MAC: A4:5E:60:E8:2C:1F
- Status: Connected
- Details: High-quality wireless earbuds...2️⃣ connect - Connect to Devices
Establish or terminate connections with devices.
Parameters:
deviceName(required): Name or identifier of the deviceaction(required):connectordisconnect
Example:
connect to AirPods ProResponse:
✅ Connection Successful
Device: AirPods Pro
Type: BLUETOOTH
MAC: A4:5E:60:E8:2C:1F
Status: Connected3️⃣ control - Control Connected Devices
Send commands to connected devices.
Parameters:
deviceName(required): Name of the connected deviceoperation(required): Operation to performturn_on/turn_off- Power controlset_volume- Adjust volume (0-100)set_brightness- Adjust brightness (0-100)play/pause- Media controlnoise_cancellation- Enable ANCbass_boost- Audio enhancementprint/scan- Printer operations
value(optional): Value for the operation
Example:
set AirPods Pro volume to 75Response:
🎮 Device Control Executed
Device: AirPods Pro
Operation: SET VOLUME
Value: 75
Result: Volume set to 75%🔄 Complete Workflow
graph LR
A[🔍 Show Devices] --> B[📡 Connect]
B --> C[🎮 Control]
C --> D[🔌 Disconnect]- Discover devices using
show - Connect to a device using
connect - Control the device using
control - Disconnect when done
🏗️ Architecture
LinkSphere-MCP/
├── src/
│ ├── index.ts # MCP server entry point
│ └── tools/ # Tool implementations
│ ├── show.ts # Device discovery
│ ├── connect.ts # Connection management
│ └── control.ts # Device control
├── package.json
├── tsconfig.json
└── README.md🛠️ Development
# Clone the repository
git clone https://github.com/guangxiangdebizi/LinkSphere-MCP.git
# Install dependencies
npm install
# Build the project
npm run build
# Start development server
npm run dev📡 API Endpoints
GET /health- Health check endpointPOST /mcp- Main MCP JSON-RPC endpoint
🔒 Security
- Session-based authentication
- Request validation
- Error handling and sanitization
- CORS support for cross-origin requests
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
Apache License 2.0 - see the LICENSE file for details.
👤 Author
Xingyu Chen
- 🌐 LinkedIn: Xingyu Chen
- 📧 Email: [email protected]
- 💻 GitHub: @guangxiangdebizi
- 📦 npm: @xingyuchen
🙏 Acknowledgments
Built with:
