media-agent-mcp 0.2.0__py3-none-any.whl → 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- media_agent_mcp/ai_models/seedance.py +4 -4
- media_agent_mcp/server.py +16 -6
- {media_agent_mcp-0.2.0.dist-info → media_agent_mcp-0.3.0.dist-info}/METADATA +1 -1
- {media_agent_mcp-0.2.0.dist-info → media_agent_mcp-0.3.0.dist-info}/RECORD +6 -6
- {media_agent_mcp-0.2.0.dist-info → media_agent_mcp-0.3.0.dist-info}/WHEEL +0 -0
- {media_agent_mcp-0.2.0.dist-info → media_agent_mcp-0.3.0.dist-info}/entry_points.txt +0 -0
@@ -222,21 +222,21 @@ def _poll_video_status(task_id: str, api_key: str, max_wait_time: int = 90) -> D
|
|
222
222
|
|
223
223
|
elif status in ['queued', 'running']:
|
224
224
|
# Continue polling
|
225
|
-
time.sleep(5)
|
225
|
+
time.sleep(0.5)
|
226
226
|
continue
|
227
227
|
|
228
228
|
else:
|
229
229
|
logger.warning(f"Unknown status: {status}")
|
230
|
-
time.sleep(5)
|
230
|
+
time.sleep(0.5)
|
231
231
|
continue
|
232
232
|
|
233
233
|
except requests.exceptions.RequestException as e:
|
234
234
|
logger.error(f"Error polling status: {str(e)}")
|
235
|
-
time.sleep(5)
|
235
|
+
time.sleep(0.5)
|
236
236
|
continue
|
237
237
|
except Exception as e:
|
238
238
|
logger.error(f"Unexpected error polling status: {str(e)}")
|
239
|
-
time.sleep(5)
|
239
|
+
time.sleep(0.5)
|
240
240
|
continue
|
241
241
|
|
242
242
|
return f"Error: Video generation timed out after {max_wait_time} seconds"
|
media_agent_mcp/server.py
CHANGED
@@ -18,6 +18,7 @@ import logging
|
|
18
18
|
from typing import Optional, Dict, Any
|
19
19
|
import json
|
20
20
|
from dotenv import load_dotenv
|
21
|
+
import uvicorn
|
21
22
|
|
22
23
|
from mcp.server.fastmcp import FastMCP
|
23
24
|
|
@@ -369,6 +370,8 @@ def main():
|
|
369
370
|
help='Host for SSE transport (default: 127.0.0.1)')
|
370
371
|
parser.add_argument('--port', type=int, default=8000,
|
371
372
|
help='Port for SSE transport (default: 8000)')
|
373
|
+
parser.add_argument('--workers', type=int, default=4,
|
374
|
+
help='Number of worker processes (default: 4)')
|
372
375
|
parser.add_argument('--version', action='store_true',
|
373
376
|
help='Show version information')
|
374
377
|
|
@@ -396,13 +399,20 @@ def main():
|
|
396
399
|
|
397
400
|
# Start the server with specified transport
|
398
401
|
if args.transport == 'sse':
|
399
|
-
logger.info(f"Starting SSE server on {args.host}:{args.port}")
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
402
|
+
logger.info(f"Starting SSE server on {args.host}:{args.port} with {args.workers} workers")
|
403
|
+
|
404
|
+
# Use uvicorn with multiple workers for better concurrency
|
405
|
+
uvicorn.run(
|
406
|
+
"media_agent_mcp.server:mcp", # Module path to FastMCP instance
|
407
|
+
host=args.host,
|
408
|
+
port=args.port,
|
409
|
+
workers=args.workers,
|
410
|
+
reload=False,
|
411
|
+
log_level="info"
|
412
|
+
)
|
404
413
|
else:
|
405
|
-
# Default stdio transport
|
414
|
+
# Default stdio transport (single process)
|
415
|
+
logger.info("Starting STDIO transport (single process)")
|
406
416
|
mcp.run(transport="stdio")
|
407
417
|
|
408
418
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
media_agent_mcp/__init__.py,sha256=xOmCIpPlIRJH3RiA-dlBOhKlwyJp51XQRt2eeyU5EtI,255
|
2
|
-
media_agent_mcp/server.py,sha256=
|
2
|
+
media_agent_mcp/server.py,sha256=muuXzKQ8s1y8-pCb_ptmm8GTrsA7HBIRIkpgoie9QIo,14188
|
3
3
|
media_agent_mcp/ai_models/__init__.py,sha256=WN8JDSJbj2-sNwaQg3MDwmm9mvJTC1mqpWliac3sHoc,427
|
4
4
|
media_agent_mcp/ai_models/seed16.py,sha256=P3KHNF_SfLryJz6qFP7UUtBfw_28ubdrj2lJkt3WsY8,4989
|
5
|
-
media_agent_mcp/ai_models/seedance.py,sha256=
|
5
|
+
media_agent_mcp/ai_models/seedance.py,sha256=fv7hdxlwRtFqMnOG9o7Kx_-k2ihB6VBgN3wCoo-Y-Qs,9024
|
6
6
|
media_agent_mcp/ai_models/seededit.py,sha256=eLOox-8lZudTYe0CpWyONGHC8D12r7nakhkXIXmE7H4,3245
|
7
7
|
media_agent_mcp/ai_models/seedream.py,sha256=lKWMRzV-ZjZ2JB93A3XYUOF7QfzP3zFMQleBtEOkuW8,4467
|
8
8
|
media_agent_mcp/media_selectors/__init__.py,sha256=eN3wyTPdHTsbW_xDyPXBLDaMA15YuI9qeiy-zeY7ZBQ,260
|
@@ -12,7 +12,7 @@ media_agent_mcp/storage/__init__.py,sha256=eio7ZiSeLjCxICSZwZisiR7wKJfXlT2PV7aDE
|
|
12
12
|
media_agent_mcp/storage/tos_client.py,sha256=9c3GPmQe2stvxgZzsWYjVqKzVyvluZqYneCXYj-FQ3M,3174
|
13
13
|
media_agent_mcp/video/__init__.py,sha256=4ILnqYaUaYKI4GWOSg2SNZqt10UM1Y-8Q2SVvjoijqY,277
|
14
14
|
media_agent_mcp/video/processor.py,sha256=5ABPyj1IoD2xyIiB8dkEx4ZssPTXKHtuoFjy-dmnFks,11866
|
15
|
-
media_agent_mcp-0.
|
16
|
-
media_agent_mcp-0.
|
17
|
-
media_agent_mcp-0.
|
18
|
-
media_agent_mcp-0.
|
15
|
+
media_agent_mcp-0.3.0.dist-info/METADATA,sha256=XJTW6wzAHfZ4_GIzKWplf1s7UT9Bwm3KtZpjRNG_aWY,10974
|
16
|
+
media_agent_mcp-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
17
|
+
media_agent_mcp-0.3.0.dist-info/entry_points.txt,sha256=kHB6iLdmnTsqibMZGfsGJzbj_ZU2uJiOfAMA8rYX8bg,64
|
18
|
+
media_agent_mcp-0.3.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|