media-agent-mcp 0.3.8__tar.gz → 0.3.9__tar.gz

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.
Files changed (26) hide show
  1. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/PKG-INFO +1 -1
  2. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/pyproject.toml +1 -1
  3. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/__init__.py +3 -1
  4. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/async_server.py +10 -25
  5. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/async_wrapper.py +9 -9
  6. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp.egg-info/PKG-INFO +1 -1
  7. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/README.md +0 -0
  8. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/setup.cfg +0 -0
  9. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/ai_models/__init__.py +0 -0
  10. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/ai_models/seed16.py +0 -0
  11. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/ai_models/seedance.py +0 -0
  12. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/ai_models/seededit.py +0 -0
  13. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/ai_models/seedream.py +0 -0
  14. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/media_selectors/__init__.py +0 -0
  15. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/media_selectors/image_selector.py +0 -0
  16. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/media_selectors/video_selector.py +0 -0
  17. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/server.py +0 -0
  18. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/storage/__init__.py +0 -0
  19. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/storage/tos_client.py +0 -0
  20. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/video/__init__.py +0 -0
  21. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp/video/processor.py +0 -0
  22. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp.egg-info/SOURCES.txt +0 -0
  23. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp.egg-info/dependency_links.txt +0 -0
  24. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp.egg-info/entry_points.txt +0 -0
  25. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp.egg-info/requires.txt +0 -0
  26. {media_agent_mcp-0.3.8 → media_agent_mcp-0.3.9}/src/media_agent_mcp.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: media-agent-mcp
3
- Version: 0.3.8
3
+ Version: 0.3.9
4
4
  Summary: A Model Context Protocol server for media processing with AI tools
5
5
  Author-email: Media Agent Team <team@mediaagent.com>
6
6
  Keywords: mcp,ai,media,video,image,processing
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "media-agent-mcp"
3
- version = "0.3.8"
3
+ version = "0.3.9"
4
4
  description = "A Model Context Protocol server for media processing with AI tools"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -2,6 +2,8 @@
2
2
 
3
3
  from . import ai_models, media_selectors, storage, video
4
4
  from .server import main
5
+ from .async_server import main as async_main
6
+ from . import async_wrapper
5
7
 
6
8
  __version__ = "0.1.0"
7
- __all__ = ['ai_models', 'media_selectors', 'storage', 'video', 'main']
9
+ __all__ = ['ai_models', 'media_selectors', 'storage', 'video', 'main', 'async_main', 'async_wrapper']
@@ -49,7 +49,7 @@ mcp = FastMCP("Media-Agent-MCP-Async")
49
49
 
50
50
 
51
51
  @mcp.tool()
52
- async def video_concat_tool_async(video_urls: List[str]) -> str:
52
+ async def video_concat_tool(video_urls: List[str]) -> str:
53
53
  """
54
54
  Asynchronously concatenate multiple videos from URLs and upload to TOS.
55
55
 
@@ -63,7 +63,7 @@ async def video_concat_tool_async(video_urls: List[str]) -> str:
63
63
 
64
64
 
65
65
  @mcp.tool()
66
- async def video_last_frame_tool_async(video_url: str) -> str:
66
+ async def video_last_frame_tool(video_url: str) -> str:
67
67
  """
68
68
  Asynchronously extract the last frame from a video file and upload to TOS.
69
69
 
@@ -77,7 +77,7 @@ async def video_last_frame_tool_async(video_url: str) -> str:
77
77
 
78
78
 
79
79
  @mcp.tool()
80
- async def seedream_generate_image_tool_async(prompt: str, size: str = "1024x1024") -> str:
80
+ async def seedream_generate_image_tool(prompt: str, size: str = "1024x1024") -> str:
81
81
  """
82
82
  Asynchronously generate an image using Seedream AI model.
83
83
 
@@ -92,7 +92,7 @@ async def seedream_generate_image_tool_async(prompt: str, size: str = "1024x1024
92
92
 
93
93
 
94
94
  @mcp.tool()
95
- async def seedance_generate_video_tool_async(prompt: str, first_frame_image: str,
95
+ async def seedance_generate_video_tool(prompt: str, first_frame_image: str,
96
96
  last_frame_image: str = None, duration: int = 5,
97
97
  resolution: str = "720p") -> str:
98
98
  """
@@ -112,7 +112,7 @@ async def seedance_generate_video_tool_async(prompt: str, first_frame_image: str
112
112
 
113
113
 
114
114
  @mcp.tool()
115
- async def seededit_tool_async(image_url: str, prompt: str, seed: int = -1,
115
+ async def seededit_tool(image_url: str, prompt: str, seed: int = -1,
116
116
  scale: float = 0.5, charactor_keep: bool = False) -> str:
117
117
  """
118
118
  Asynchronously edit an image using Seededit model.
@@ -131,7 +131,7 @@ async def seededit_tool_async(image_url: str, prompt: str, seed: int = -1,
131
131
 
132
132
 
133
133
  @mcp.tool()
134
- async def vlm_vision_task_tool_async(messages: List) -> str:
134
+ async def vlm_vision_task_tool(messages: List) -> str:
135
135
  """
136
136
  Asynchronously perform vision-language tasks using VLM model.
137
137
 
@@ -145,7 +145,7 @@ async def vlm_vision_task_tool_async(messages: List) -> str:
145
145
 
146
146
 
147
147
  @mcp.tool()
148
- async def image_selector_tool_async(image_paths: List[str], prompt: str) -> str:
148
+ async def image_selector_tool(image_paths: List[str], prompt: str) -> str:
149
149
  """
150
150
  Asynchronously select the best image from multiple options using VLM model.
151
151
 
@@ -160,7 +160,7 @@ async def image_selector_tool_async(image_paths: List[str], prompt: str) -> str:
160
160
 
161
161
 
162
162
  @mcp.tool()
163
- async def video_selector_tool_async(video_paths: List[str], prompt: str) -> str:
163
+ async def video_selector_tool(video_paths: List[str], prompt: str) -> str:
164
164
  """
165
165
  Asynchronously select the best video from multiple options using VLM model.
166
166
 
@@ -175,7 +175,7 @@ async def video_selector_tool_async(video_paths: List[str], prompt: str) -> str:
175
175
 
176
176
 
177
177
  @mcp.tool()
178
- async def tos_save_content_tool_async(content: str, file_extension: str = "txt",
178
+ async def tos_save_content_tool(content: str, file_extension: str = "txt",
179
179
  object_key: Optional[str] = None) -> str:
180
180
  """
181
181
  Asynchronously save content to TOS and return URL.
@@ -205,21 +205,6 @@ async def run_multiple_tools_concurrently(*coroutines):
205
205
  return await asyncio.gather(*coroutines, return_exceptions=True)
206
206
 
207
207
 
208
- # Example usage function
209
- async def example_concurrent_usage():
210
- """
211
- Example of how to use multiple tools concurrently.
212
- """
213
- # Example: Generate image and process video concurrently
214
- image_task = seedream_generate_image_tool_async("A beautiful sunset", "1024x1024")
215
- video_task = video_last_frame_tool_async("https://example.com/video.mp4")
216
-
217
- # Run both tasks concurrently
218
- results = await run_multiple_tools_concurrently(image_task, video_task)
219
-
220
- return results
221
-
222
-
223
208
  def main():
224
209
  """Main entry point for the Async MCP server."""
225
210
  # Parse command line arguments
@@ -229,7 +214,7 @@ def main():
229
214
  parser.add_argument('--host', type=str, default='127.0.0.1',
230
215
  help='Host for SSE transport (default: 127.0.0.1)')
231
216
  parser.add_argument('--port', type=int, default=8000,
232
- help='Port for SSE transport (default: 8001)')
217
+ help='Port for SSE transport (default: 8000)')
233
218
  parser.add_argument('--version', action='store_true',
234
219
  help='Show version information')
235
220
 
@@ -85,28 +85,28 @@ def json_response_wrapper(func: Callable) -> Callable:
85
85
  # Async wrapped functions
86
86
  @async_wrapper
87
87
  @json_response_wrapper
88
- def video_concat_tool(video_urls: List[str]) -> str:
88
+ def _sync_video_concat(video_urls: List[str]) -> str:
89
89
  """Synchronous video concatenation wrapper."""
90
90
  return concat_videos(video_urls)
91
91
 
92
92
 
93
93
  @async_wrapper
94
94
  @json_response_wrapper
95
- def video_last_frame_tool(video_url: str) -> str:
95
+ def _sync_video_last_frame(video_url: str) -> str:
96
96
  """Synchronous video last frame extraction wrapper."""
97
97
  return extract_last_frame(video_url)
98
98
 
99
99
 
100
100
  @async_wrapper
101
101
  @json_response_wrapper
102
- def seedream_generate_image_tool(prompt: str, size: str = "1024x1024") -> str:
102
+ def _sync_seedream_generate_image(prompt: str, size: str = "1024x1024") -> str:
103
103
  """Synchronous image generation wrapper."""
104
104
  return generate_image(prompt, size=size)
105
105
 
106
106
 
107
107
  @async_wrapper
108
108
  @json_response_wrapper
109
- def seedance_generate_video_tool(prompt: str, first_frame_image: str,
109
+ def _sync_seedance_generate_video(prompt: str, first_frame_image: str,
110
110
  last_frame_image: str = None, duration: int = 5,
111
111
  resolution: str = "720p") -> str:
112
112
  """Synchronous video generation wrapper."""
@@ -128,7 +128,7 @@ def seedance_generate_video_tool(prompt: str, first_frame_image: str,
128
128
 
129
129
  @async_wrapper
130
130
  @json_response_wrapper
131
- def seededit_tool(image_url: str, prompt: str, seed: int = -1,
131
+ def _sync_seededit(image_url: str, prompt: str, seed: int = -1,
132
132
  scale: float = 0.5, charactor_keep: bool = False) -> str:
133
133
  """Synchronous image editing wrapper."""
134
134
  return seededit(
@@ -143,14 +143,14 @@ def seededit_tool(image_url: str, prompt: str, seed: int = -1,
143
143
 
144
144
  @async_wrapper
145
145
  @json_response_wrapper
146
- def vlm_vision_task_tool(messages: List) -> str:
146
+ def _sync_vlm_vision_task(messages: List) -> str:
147
147
  """Synchronous VLM vision task wrapper."""
148
148
  from media_agent_mcp.ai_models.seed16 import process_vlm_task
149
149
  return process_vlm_task(messages)
150
150
 
151
151
 
152
152
  @async_wrapper
153
- def image_selector_tool(image_paths: List[str], prompt: str) -> str:
153
+ def _sync_image_selector(image_paths: List[str], prompt: str) -> str:
154
154
  """Synchronous image selector wrapper."""
155
155
  try:
156
156
  result = select_best_image(image_paths, prompt)
@@ -168,7 +168,7 @@ def image_selector_tool(image_paths: List[str], prompt: str) -> str:
168
168
 
169
169
 
170
170
  @async_wrapper
171
- def video_selector_tool(video_paths: List[str], prompt: str) -> str:
171
+ def _sync_video_selector(video_paths: List[str], prompt: str) -> str:
172
172
  """Synchronous video selector wrapper."""
173
173
  try:
174
174
  result = select_best_video(video_paths, prompt)
@@ -186,7 +186,7 @@ def video_selector_tool(video_paths: List[str], prompt: str) -> str:
186
186
 
187
187
 
188
188
  @async_wrapper
189
- def tos_save_content_tool(content: str, file_extension: str = "txt",
189
+ def _sync_tos_save_content(content: str, file_extension: str = "txt",
190
190
  object_key: Optional[str] = None) -> str:
191
191
  """Synchronous TOS content save wrapper."""
192
192
  import tempfile
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: media-agent-mcp
3
- Version: 0.3.8
3
+ Version: 0.3.9
4
4
  Summary: A Model Context Protocol server for media processing with AI tools
5
5
  Author-email: Media Agent Team <team@mediaagent.com>
6
6
  Keywords: mcp,ai,media,video,image,processing