A transparent proxy server that enables Claude Desktop (and other MCP clients) to work with the Huskylens AI camera's embedded MCP server by filtering out unsupported image data from responses.
The Huskylens camera has an embedded Model Context Protocol (MCP) server that returns both image data and text data in its get_recognition_result tool responses. However, Claude Desktop's MCP interface cannot handle the image data format returned by the camera, resulting in "The tool returned content in an unsupported format" errors.
The Huskylens MCP server is hardcoded in the camera firmware to always return both image and text data, with no option to request text-only responses.
This bridge server sits between Claude Desktop and the Huskylens camera, acting as a transparent filtering proxy. The bridge works alongside npx mcp-remote - you still use mcp-remote to connect Claude Desktop to the bridge, which then connects to the camera.
Connection chain:
Claude Desktop → mcp-remote → Bridge Server (this program) → Huskylens Camera
The bridge:
- Forwards all MCP protocol messages bidirectionally
- Filters out
resource_linkitems withmimeType: "image/png"from tool responses - Preserves all text/JSON content so Claude can access the recognition data
- Maintains proper MCP protocol message ordering
- Transparent proxying: All MCP messages are forwarded without modification except for image filtering
- Message ordering: Ensures
notifications/initializedis sent before other requests (MCP protocol requirement) - Multi-session support: Handles multiple concurrent Claude Desktop sessions
- SSE streaming: Properly handles Server-Sent Events (SSE) for real-time communication
- Configurable: Command-line arguments for target URL, host, and port
- Logging: Clear logging of connections, sessions, and filtered content
- Python 3.7+
- Flask
- requests
- npx (for mcp-remote)
- Clone this repository:
git clone https://github.com/dstrout/huskylens2_MCP_filter.git
cd huskylens2_MCP_filter- Install Python dependencies:
pip3 install flask requestspython3 huskylens_bridge.py --target http://192.168.1.161:3000Replace 192.168.1.161:3000 with your Huskylens camera's IP address and port.
This will:
- Connect to the Huskylens MCP server at the target URL
- Start the bridge server on
http://0.0.0.0:8080
Add the bridge to your Claude Desktop configuration file (claude_desktop_config.json):
Location of config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add this entry:
{
"mcpServers": {
"Huskylens2": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:8080/sse",
"--allow-http"
]
}
}
}Important: The mcp-remote tool connects to the bridge at localhost:8080, not directly to the camera. The bridge then proxies to the camera.
Restart Claude Desktop and the Huskylens tools should appear in the settings and work without errors.
--target URL Required. Target Huskylens MCP server URL
Example: http://192.168.1.161:3000
--host HOST Host to bind the bridge server to (default: 0.0.0.0)
Use 127.0.0.1 to bind to localhost only
--port PORT Port to bind the bridge server to (default: 8080)
--verbose Enable verbose debug logging
--no-validation Skip connection validation at startup
Custom bridge port:
python3 huskylens_bridge.py --target http://192.168.1.161:3000 --port 9000Then update Claude config to use http://localhost:9000/sse
Localhost only:
python3 huskylens_bridge.py --target http://192.168.1.161:3000 --host 127.0.0.1With verbose logging:
python3 huskylens_bridge.py --target http://192.168.1.161:3000 --verboseSkip startup validation (if camera offline):
python3 huskylens_bridge.py --target http://192.168.1.161:3000 --no-validation┌─────────────────┐ npx mcp-remote ┌──────────────────┐ HTTP/SSE ┌─────────────────┐
│ Claude Desktop │ ◄─────────────────► │ Bridge Server │ ◄────────────► │ Huskylens Camera│
│ (MCP Client) │ │ (This Program) │ │ (MCP Server) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
Filters out images
Preserves text data
- Connection: Claude Desktop uses
mcp-remoteto connect to the bridge via SSE - Session Setup: Bridge establishes upstream connection to Huskylens camera
- Message Ordering: Bridge buffers tool requests until session is initialized
- Filtering: Image resources are removed from
get_recognition_resultresponses - Forwarding: All other content passes through unchanged
The bridge only filters resource_link items with image MIME types from tool responses:
Before filtering (from Huskylens):
{
"result": {
"content": [
{
"type": "resource_link",
"uri": "data:image/png;base64,iVBORw0KG...",
"mimeType": "image/png"
},
{
"type": "text",
"text": "[{\"id\":1,\"x\":120,\"y\":80,...}]"
}
]
}
}After filtering (to Claude):
{
"result": {
"content": [
{
"type": "text",
"text": "[{\"id\":1,\"x\":120,\"y\":80,...}]"
}
]
}
}Error: Failed to connect to http://192.168.1.161:3000
Solution:
- Verify the Huskylens camera is on and connected to your network
- Check the IP address is correct (may change if using DHCP)
- Ensure the Huskylens MCP server is running (usually on port 3000)
- Use
--no-validationto skip the startup check
Solution:
- Check that the bridge server is running
- Verify Claude Desktop config points to
http://localhost:8080/sse(not the camera directly) - Restart Claude Desktop completely
- Check bridge server logs for connection attempts
Error: Address already in use
Solution:
- Use
--portto specify a different port - Or stop the process using port 8080:
lsof -ti:8080 | xargs kill
Solution:
- Ensure stable network connection to Huskylens
- Check for firewall blocking connections
- Enable verbose logging to see what's happening
Run with --verbose to see detailed message flow:
python3 huskylens_bridge.py --target http://192.168.1.161:3000 --verbose- Protocol Version: 2024-11-05 (and later)
- Transport: SSE (Server-Sent Events) over HTTP
- Message ordering: Enforces MCP initialization sequence
- Sessions: Automatic cleanup on disconnect
- Flask: Web framework for HTTP/SSE endpoints
- requests: HTTP client for upstream connections
- mcp-remote: npm package that bridges Claude Desktop to HTTP MCP servers
GET /sse- SSE endpoint for MCP client connections (mcp-remote connects here)POST /message?session_id=<id>- Message forwarding endpointGET /health- Health check endpoint
MIT License - See LICENSE file for details
Improvements and bug fixes are welcome! Key areas:
- Better error handling and recovery
- Configuration file support
- Multiple upstream server support
- Performance optimizations
- Huskylens team for creating the AI camera and MCP server
- Anthropic for Claude Desktop and MCP protocol
- The MCP community for
mcp-remotetool
- 1.0.0 (2025-11-12)
- Initial release
- Image filtering from tool responses
- MCP protocol message ordering
- Command-line configuration
- Multi-session support