Content
-Adapter Logo](assets/logo.png)
# Omni-Adapter
A multi-platform intelligent image generation adapter based on the FastMCP framework, deeply integrated with multiple AI platforms through browser plugins, providing a unified MCP (Model Context Protocol) service interface, supporting unlimited calls to different platforms' text-to-image and image-to-image functions.
## Core Features
- 🚀 **FastMCP Framework**: Provides standardized service interfaces based on the modern MCP protocol
- 🎨 **Multi-Platform Support**: Supports multiple AI platforms such as Doubao and Qwen
- 🔄 **Multi-**: Supports multiple browser instances connected simultaneously, with intelligent load balancing
- ⚡ **Efficient Task Scheduling**: Task allocation using polling algorithms, supporting concurrent processing
- 🛡️ **Reliability Guarantee**: Task timeout management, automatic reconnection, and connection status monitoring
- **Intelligent Image Processing**: Automatic image upload, reference image processing, and image ratio adjustment
🎯 **Image Management**: Built-in image collection, preview, and batch download functions
- 📊 **Real-Time Monitoring**: Complete connection status and task status query interface 🔧 **Flexible Configuration**: Supports personalized settings such as automatic Cookie management
## System Architecture
### Core Components
**MCP Server** (`McpServer/`)
CP framework provides standard
- WebSocket browser plugin connections
- Task queue management and load balancing - Connection status monitoring and exception handling
2. **Browser - **Do Agent** (`DocpBrowserProxy/`): Integrates Doubao client
- **Qwen Agent** (`QwenMcpBrowserProxy/`): Integrates Qwen client - Automated text-to-image and image-to-image instruction input
- Intelligent image upload and processing
- Real-time image URL collection and monitoring
- User interface enhancement functions
## Supported Platforms
### Doubao
- **Platform Address**: https://www.doubao.com
- **Functions**: Text-to-image, image-to-image
- **Features**: High-quality image generation, supports multiple styles
### Qwen
- **Platform Address**: https://chat.qwen.ai **Functions**: Text, image-to- **Features Chinese understanding ability, ratios
## Demohttps://github.com/user/assets/98ed6-1252--90ed-53440ef13280
## System Requirements
- **Python**: 3 or higher
-**: Chromium kernel browser supporting
- **AI Platformsao client, Qwen web version
- **Operating Windows / macOS /## Quick Start
### 1. Project Installation
```bash
# Clone the project clone https:///HuChundong/Omni-Adaptercd Omni-Adapter Install Python dependencies McpServer
-r requirements.txt 2 Browser Plugins
#### Doubao Agent Installation
1. browser extension page://extensions/`)
2. Enable the " in the corner
3.Load unpacked"
4 the `DocpBrowser directory
#### Q
1. Open the browser extension page://extensions/`)
2. Enable the "Developer mode" in the top right corner
3. Click "Load unpacked"
4. Select the `QcpBrowserProxy` directory
### 3. Configure AI Platforms
#### Client Configuration
For the best experience, it is recommended startup parameters toao client shortcut:
```bash
"Doubao client path" --silent-debugger
```
Example:
```"C:\Program Files\Doubao\app\Doubao.exe" --silent-debugger-extension-api
```
#### Q
1.https://chat.qwen.ai](https://chat.qwen2. Log in account
3. Ensure the plugin is correctly installed and activated
### 4. Start the Service
# Start the service in the McpServer directory
python server.py
```
After the service starts, it will provide:
- **WebSocket Service**: `ws://localhost:8080` (browser plugin connection)
- **Mhttp://localhost:8081` (MCP client connection)
> **Note**: If deployed on a replace `localhost the actual server IP the firewall allows corresponding ports.
## Usage Guide
### MCP Client Access
#### Configure MCP Service Address
Configure the service address in the MCP clienttext
http://192.168.2.192:8081/mcp
```
#### 1. Text-to-Image**Tool Name**:_image`
**Function images based on text prompts
**Parameters**:
- `prompt` (string): Text prompt, describing the content of the image you want to generate
- `ratio` (string, optional): Image ratio, default is "2:3"
- `platform` (string, optional): Specify the platform, optional "doubao" or "qwen", default is "doubao"
**Supported Ratios**:
- "1:1" - Square
- "2: - Vertical (- "3:2" - Horizontal
16:9"idescreen
- "9:16" - Vertical screen
- "3" - Standard- "3: Standard verticalReturn Format**:
``` "status": "success",
"image_urls": ["https://...", "https://...platform": "doubao"
}
2. ImageImage Tool
****: `edit_image**: Generate images based on reference images and text prompts
**Parameters**:
- `prompt` (string): Text description of image editing, describing the changes you want to make reference image
- `reference_picture` (string of the reference image be an accessible HTTPS link
- `ratio` (string, image ratio, default is "2:3"
- `platform` (string, optional): Specify the platform, optional "doubao" or "", default is "doubao"
**Return Format**:
```json
{
"status": "success",
"image_urls": ["https://...", "https://..."],
"platform": "qwen"
}
```
**Notes**:
- `reference_picture` must be a valid image common jpg, png, gif,
- URL must be and not require- It is recommended image size does not exceed 10MB, resolution is within x1024 3. Connection
**Tool Name**: `get_connectionFunction**: Get and task information Information**:
of connected clients and- Current task queue situation
- System running status
- Connection status of### Browser Plugin Functions
#### Automated Operations
- Automatically receive text-to-image and image-to-image instructions sent by the MCP server
- Intelligent image upload: automatically download and upload reference images to the corresponding platform
user input prompts and image ratios in the AI- Real-time monitoring images and collection#### Image Management **Real-time Preview**: Pop-up display of
- **Individual Download**: Select specific images for download
- **Batch Download**: One-click download of all images
- **List Management**: Clear the and start collecting#### Personalized Settings
In the plugin options page (`chrome://extensions/` → Plugin details → Extension program options), you can configure **Automatic Refresh**: automatically refresh the page task is completedCookie Management**: Whether to automatically clear Cookies status)
- Selection**: Default used
## Advanced Configuration
### Server Configuration
McpServer`, you can adjust parameters:
``` Server configuration
SERVER_HOST = "00.0 # Server listeningWS_PORT = # WebSocket port
MCP_PORT =1 # port
#
DEFAULT_TIMEOUT =.0 # timeout time (seconds_TASKS = # Maximum length of the
Task Management Strategy
- **Polling Load Balancing**: Tasks are automatically assigned to idle clients
- **Timeout Protection**: 120-second task timeout, automatic resource release
- **Status Monitoring**: Real-time monitoring of client connections and task status
- **Exception Recovery**: Automatic cleanup of related tasks when thes
- Processing**: Automatic download of reference images and upload to the corresponding platform
Ratio Control**: Supports ratios to meet different## Troubleshooting
### Common Issues
1. ** connect to the server**
- Check if the server (`python server.py - Confirm that port is not occupied - Check firewall settings
**Task timeout or - Ensure the AI platform is running normally
- Check network connection stability - Try refreshing the platform
3. ** be downloaded**
browser download permissions
URL validity
- Try clearing browser cache Log Debugging
View:
```bash
# Server logs will display detailed connection and task information
python server```
View browser console:
```javascript
// Press F12 on the AI platform page to view Console output
// Search for related logs with "[Script]" or "[WebSocket]"
```
## Precautions and Limitations
### Usage Notes
Important Reminder**:
1. **Privacy Protection**: automatically clear Cookies, and each use is in an anonymous state
2. **Page Refresh**: To ensure normal function plugin may automatically refresh the platform page
3Single Task Limitation**: Each client can only process one image generation task at a time
4. **Network Dependency**: A stable network connection is required to ensure the service is### Laws and Compliance
- This project is for learning and research purposes only
- Please comply with the service terms and usage agreements of each AI platform
- Prohibited for any commercial use
- Prohibited from generating violating content
### Performance Considerations
- It is recommended number of connected clients does not exceed 5
- A large number of concurrent requests may affect the stability of the AI platform service
- Regularly restart the service to clean up resource occupancy
## Development Guide
### Project Structure
```
Omni-Adapter/
├── McpServer/ # MCP server
│ ├── server.py # Main service file
│ ├── requirements.txt # Python dependencies
│ └── docker-compose.yml # Docker configuration
├── DoubaoMcpBrowserProxy/ # Doubao browser plugin ├── manifest # Plugin configuration
│ ├── content.js # Content script
│ ├── background.js # Background script
│ └── settings-panel.js # Settings panel
├── QwenMcpBrowserProxy # Qwen browser plugin
│ ├── manifest.json # Plugin configuration
│ ├── content.js script
│ ├── background.js # Background script
│ -panel.js # Settings panel
└.md
Adding New Platform Support
1. new browser plugin directory
2. Implement platform-specific interaction logic
3. Add in the MCP server
4. and configuration
### Communication and Exchange
You can join the Omni-bot developer exchange please specify omni-bot, and the robot will automatically pass through. There is a limited number of people passing through every day, please be patient.
<p align="center">
img src="https://omni.bmwidget.com/omni-r" alt="Exchange Group" width="300">
<="https.com/user-attachments/assets/16db82a1-6032-4c8287-8dfbb3be70ce" alt="Group Master Bot"width="300">
</p>
(If the project is useful to you, you can also buy me a cup of coffee ☕️ ~)
<p align="center">
><img src="https://github.com/user-attachments/assets/195ab37d-bc51-44a2-9330df9dbf67dc" alt="Appreciation Code" width="200>
</p>
Code
submit Issues and! Before ensure:
1. Code complies with project specifications
2. Add necessary test cases
3. Update relevant documentation
4. Pass all existing tests
## Open Source License
This project is open-sourced under the MIT license. See [LICENSE](LICENSE.
## Disclaimer
This project is for learning and research. Please do not use it for commercial purposes. The user is responsible for any consequences arising from the use of this project. is not any losses caused project.
Thanks to text-to-image models of Doubao and Qwen for providing technical support for this project.
## Star History
<a href="https://www.star/#HuChundong/Omni-Date">
<picture>
<source media="(pref-scheme: dark)" srcset="https://api.star-history.com/svg?repos=HuChundong/Omni-Adapter&type=Date&theme=dark" />
<source media="(prefers-color-s light)" srcset="https://api.star-history.com/svg?repos=HuChundong/Omni-Adapter&type=
Connection Info
You Might Also Like
markitdown
Python tool for converting files and office documents to Markdown.
OpenAI Whisper
OpenAI Whisper MCP Server - 基于本地 Whisper CLI 的离线语音识别与翻译,无需 API Key,支持...
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
claude-flow
Claude-Flow v2.7.0 is an enterprise AI orchestration platform.
ai-engineering-from-scratch
Learn it. Build it. Ship it for others. The most comprehensive open-source...
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)