universal-mcp-applications 0.1.9__py3-none-any.whl → 0.1.11__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.
Potentially problematic release.
This version of universal-mcp-applications might be problematic. Click here for more details.
- universal_mcp/applications/e2b/app.py +25 -13
- universal_mcp/applications/google_gemini/app.py +25 -11
- {universal_mcp_applications-0.1.9.dist-info → universal_mcp_applications-0.1.11.dist-info}/METADATA +1 -1
- {universal_mcp_applications-0.1.9.dist-info → universal_mcp_applications-0.1.11.dist-info}/RECORD +6 -6
- {universal_mcp_applications-0.1.9.dist-info → universal_mcp_applications-0.1.11.dist-info}/WHEEL +0 -0
- {universal_mcp_applications-0.1.9.dist-info → universal_mcp_applications-0.1.11.dist-info}/licenses/LICENSE +0 -0
|
@@ -93,26 +93,38 @@ class E2bApp(APIApplication):
|
|
|
93
93
|
logger.info("E2B API Key successfully retrieved and cached.")
|
|
94
94
|
return self._e2b_api_key
|
|
95
95
|
|
|
96
|
-
def _format_execution_output(self,
|
|
96
|
+
def _format_execution_output(self, execution: Any) -> str:
|
|
97
97
|
"""Helper function to format the E2B execution logs nicely."""
|
|
98
98
|
output_parts = []
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
try:
|
|
101
|
+
logs = getattr(execution, "logs", None)
|
|
102
|
+
|
|
103
|
+
if logs is not None:
|
|
104
|
+
# Collect stdout
|
|
105
|
+
if getattr(logs, "stdout", None):
|
|
106
|
+
stdout_content = "".join(logs.stdout).strip()
|
|
107
|
+
if stdout_content:
|
|
108
|
+
output_parts.append(stdout_content)
|
|
109
|
+
|
|
110
|
+
# Collect stderr
|
|
111
|
+
if getattr(logs, "stderr", None):
|
|
112
|
+
stderr_content = "".join(logs.stderr).strip()
|
|
113
|
+
if stderr_content:
|
|
114
|
+
output_parts.append(f"--- ERROR ---\n{stderr_content}")
|
|
115
|
+
|
|
116
|
+
# Fallback: check execution.text (covers expressions returning values)
|
|
117
|
+
if not output_parts and hasattr(execution, "text"):
|
|
118
|
+
text_content = str(execution.text).strip()
|
|
119
|
+
if text_content:
|
|
120
|
+
output_parts.append(text_content)
|
|
108
121
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if stderr_content:
|
|
112
|
-
output_parts.append(f"--- ERROR ---\n{stderr_content}")
|
|
122
|
+
except Exception as e:
|
|
123
|
+
output_parts.append(f"Failed to format execution output: {e}")
|
|
113
124
|
|
|
114
125
|
if not output_parts:
|
|
115
126
|
return "Execution finished with no output (stdout/stderr)."
|
|
127
|
+
|
|
116
128
|
return "\n\n".join(output_parts)
|
|
117
129
|
|
|
118
130
|
def execute_python_code(
|
|
@@ -3,7 +3,7 @@ import io
|
|
|
3
3
|
import os
|
|
4
4
|
import uuid
|
|
5
5
|
import wave
|
|
6
|
-
from typing import Annotated
|
|
6
|
+
from typing import Annotated
|
|
7
7
|
|
|
8
8
|
from google import genai
|
|
9
9
|
from google.genai import types
|
|
@@ -55,11 +55,13 @@ class GoogleGeminiApp(APIApplication):
|
|
|
55
55
|
|
|
56
56
|
Example:
|
|
57
57
|
response = app.generate_text("Tell me a joke.")
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
Tags:
|
|
60
60
|
important
|
|
61
61
|
"""
|
|
62
|
-
response = self.genai_client.generate_content(
|
|
62
|
+
response = self.genai_client.models.generate_content(
|
|
63
|
+
contents=prompt, model=model
|
|
64
|
+
)
|
|
63
65
|
return response.text
|
|
64
66
|
|
|
65
67
|
async def generate_image(
|
|
@@ -80,15 +82,16 @@ class GoogleGeminiApp(APIApplication):
|
|
|
80
82
|
|
|
81
83
|
Returns:
|
|
82
84
|
list: A list of dicts, each containing either 'text' or 'image_bytes'.
|
|
83
|
-
|
|
85
|
+
|
|
84
86
|
Tags:
|
|
85
87
|
important
|
|
86
88
|
"""
|
|
87
89
|
# The Gemini API is synchronous, so run in a thread
|
|
88
90
|
contents = [prompt]
|
|
89
91
|
if image:
|
|
90
|
-
if image.startswith((
|
|
92
|
+
if image.startswith(("http://", "https://")):
|
|
91
93
|
import requests
|
|
94
|
+
|
|
92
95
|
response = requests.get(image)
|
|
93
96
|
response.raise_for_status()
|
|
94
97
|
image = Image.open(io.BytesIO(response.content))
|
|
@@ -108,12 +111,17 @@ class GoogleGeminiApp(APIApplication):
|
|
|
108
111
|
# Return the raw image bytes
|
|
109
112
|
image_bytes = part.inline_data.data
|
|
110
113
|
|
|
111
|
-
|
|
112
114
|
img_base64 = base64.b64encode(image_bytes).decode("utf-8")
|
|
113
115
|
|
|
114
116
|
file_name = f"{uuid.uuid4()}.png"
|
|
115
117
|
|
|
116
|
-
return {
|
|
118
|
+
return {
|
|
119
|
+
"type": "image",
|
|
120
|
+
"data": img_base64,
|
|
121
|
+
"mime_type": "image/png",
|
|
122
|
+
"file_name": file_name,
|
|
123
|
+
"text": text,
|
|
124
|
+
}
|
|
117
125
|
|
|
118
126
|
async def generate_audio(
|
|
119
127
|
self,
|
|
@@ -128,7 +136,7 @@ class GoogleGeminiApp(APIApplication):
|
|
|
128
136
|
|
|
129
137
|
Returns:
|
|
130
138
|
str: The URL of the uploaded audio file.
|
|
131
|
-
|
|
139
|
+
|
|
132
140
|
Tags:
|
|
133
141
|
important
|
|
134
142
|
"""
|
|
@@ -164,15 +172,21 @@ class GoogleGeminiApp(APIApplication):
|
|
|
164
172
|
# read the file
|
|
165
173
|
with open(file_name, "rb") as f:
|
|
166
174
|
data = f.read()
|
|
167
|
-
|
|
175
|
+
|
|
168
176
|
# delete the file
|
|
169
177
|
os.remove(file_name)
|
|
170
178
|
|
|
171
179
|
# Convert to base64
|
|
172
180
|
import base64
|
|
173
|
-
audio_base64 = base64.b64encode(data).decode('utf-8')
|
|
174
181
|
|
|
175
|
-
|
|
182
|
+
audio_base64 = base64.b64encode(data).decode("utf-8")
|
|
183
|
+
|
|
184
|
+
return {
|
|
185
|
+
"type": "audio",
|
|
186
|
+
"data": audio_base64,
|
|
187
|
+
"mime_type": "audio/wav",
|
|
188
|
+
"file_name": file_name,
|
|
189
|
+
}
|
|
176
190
|
|
|
177
191
|
def list_tools(self):
|
|
178
192
|
return [
|
{universal_mcp_applications-0.1.9.dist-info → universal_mcp_applications-0.1.11.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: universal-mcp-applications
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
4
4
|
Summary: A Universal MCP Application: universal_mcp_applications
|
|
5
5
|
Project-URL: Homepage, https://github.com/universal-mcp/applications
|
|
6
6
|
Project-URL: Repository, https://github.com/universal-mcp/applications
|
{universal_mcp_applications-0.1.9.dist-info → universal_mcp_applications-0.1.11.dist-info}/RECORD
RENAMED
|
@@ -57,7 +57,7 @@ universal_mcp/applications/domain_checker/__init__.py,sha256=4s7K0D6jORpJAUySJS1
|
|
|
57
57
|
universal_mcp/applications/domain_checker/app.py,sha256=R-uXWkG0pMrdyAGgsIxBGLfxbChB05d02xN5mj5NEPI,9915
|
|
58
58
|
universal_mcp/applications/e2b/README.md,sha256=King2LmyUlseNZ76c3bmsJCxg8PHhCQMzVcN35l_-qc,296
|
|
59
59
|
universal_mcp/applications/e2b/__init__.py,sha256=hL17jBumsx-oi93AAIFCoDdoP7zQElnrTjnCDc7NBH4,24
|
|
60
|
-
universal_mcp/applications/e2b/app.py,sha256=
|
|
60
|
+
universal_mcp/applications/e2b/app.py,sha256=Hx_mf2q25Rtw9VPO5tPPTaJs6BQK0rVvDLJJ9ghMZac,7364
|
|
61
61
|
universal_mcp/applications/elevenlabs/README.md,sha256=xftSdiuQjBLyx9uYK7re4uUp2Pwrni5678-O2Tzqu2I,10940
|
|
62
62
|
universal_mcp/applications/elevenlabs/__init__.py,sha256=2ojwxRFjYEwBieAqUZlPJulRfOaoPrCrqeEiZNxG48M,31
|
|
63
63
|
universal_mcp/applications/elevenlabs/app.py,sha256=bQQOi6KhqtYygcQLFv7abOeV54kpkmABUgZhIjPC72U,4886
|
|
@@ -106,7 +106,7 @@ universal_mcp/applications/google_drive/__init__.py,sha256=DTyed4ADcCmALSyPT8whj
|
|
|
106
106
|
universal_mcp/applications/google_drive/app.py,sha256=IlYwUxGRo7ISKGeWzWpc_0r4ewDo-rXLPChyMOxAc_Q,248993
|
|
107
107
|
universal_mcp/applications/google_gemini/README.md,sha256=o5cWenioUnNhn7L2fxwPLasBXzQ7mNmYp-aLLj9bHzY,2042
|
|
108
108
|
universal_mcp/applications/google_gemini/__init__.py,sha256=KZWdPU74VKBBabLpAcPNEPRPLFk8v2i0ULnT4wVHM9U,33
|
|
109
|
-
universal_mcp/applications/google_gemini/app.py,sha256=
|
|
109
|
+
universal_mcp/applications/google_gemini/app.py,sha256=E8TLYAEUKfjQUmkeZ_bS9Jutj4mdVOJd-EepT1ndVFg,6687
|
|
110
110
|
universal_mcp/applications/google_mail/README.md,sha256=TVLbil9-qjjp9kZziuWWhkiVNR1tf5XJ_q37xd6iUsg,2422
|
|
111
111
|
universal_mcp/applications/google_mail/__init__.py,sha256=_VpJPPBAJvPX3urxUD2_kiQmld91tkVFSvAcdt5XbmI,31
|
|
112
112
|
universal_mcp/applications/google_mail/app.py,sha256=vT3Lg2qZNX98PPjJ-nDkA4VtZvofu_nkXuqRo4w2Xpo,54892
|
|
@@ -267,7 +267,7 @@ universal_mcp/applications/youtube/app.py,sha256=hhKqnbXvMAyOW3LOqp-ODPdIuQorr1n
|
|
|
267
267
|
universal_mcp/applications/zenquotes/README.md,sha256=x1mZHjNKD4WOgsIhedcbbaR1nvbt794GSrKud1tSLD0,296
|
|
268
268
|
universal_mcp/applications/zenquotes/__init__.py,sha256=IkASLYaZiHJXlkGwEMk1HgIq5GwEZp5GhAIiJyjBd3g,30
|
|
269
269
|
universal_mcp/applications/zenquotes/app.py,sha256=6v8trNWjxbixdlEyaM-gJbfY8z9ZAmkIzSUks_fbsT4,1076
|
|
270
|
-
universal_mcp_applications-0.1.
|
|
271
|
-
universal_mcp_applications-0.1.
|
|
272
|
-
universal_mcp_applications-0.1.
|
|
273
|
-
universal_mcp_applications-0.1.
|
|
270
|
+
universal_mcp_applications-0.1.11.dist-info/METADATA,sha256=f3U8xhBwHvPOx5fOEZ3vz-6uwHyhxQGf5w_mdjRMpeI,3919
|
|
271
|
+
universal_mcp_applications-0.1.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
272
|
+
universal_mcp_applications-0.1.11.dist-info/licenses/LICENSE,sha256=NweDZVPslBAZFzlgByF158b85GR0f5_tLQgq1NS48To,1063
|
|
273
|
+
universal_mcp_applications-0.1.11.dist-info/RECORD,,
|
{universal_mcp_applications-0.1.9.dist-info → universal_mcp_applications-0.1.11.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|