universal-mcp 0.1.24rc14__py3-none-any.whl → 0.1.24rc19__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.
- universal_mcp/agentr/client.py +11 -0
- universal_mcp/agentr/registry.py +40 -5
- universal_mcp/applications/application.py +0 -2
- universal_mcp/applications/sample/app.py +79 -20
- universal_mcp/applications/utils.py +52 -0
- universal_mcp/servers/server.py +4 -3
- universal_mcp/tools/manager.py +0 -3
- universal_mcp/types.py +1 -21
- universal_mcp/utils/prompts.py +0 -2
- universal_mcp/utils/testing.py +1 -1
- {universal_mcp-0.1.24rc14.dist-info → universal_mcp-0.1.24rc19.dist-info}/METADATA +1 -1
- universal_mcp-0.1.24rc19.dist-info/RECORD +54 -0
- universal_mcp/__init__.py +0 -0
- universal_mcp/agents/__init__.py +0 -10
- universal_mcp/agents/autoagent/__init__.py +0 -30
- universal_mcp/agents/autoagent/__main__.py +0 -25
- universal_mcp/agents/autoagent/context.py +0 -26
- universal_mcp/agents/autoagent/graph.py +0 -151
- universal_mcp/agents/autoagent/prompts.py +0 -9
- universal_mcp/agents/autoagent/state.py +0 -27
- universal_mcp/agents/autoagent/studio.py +0 -25
- universal_mcp/agents/autoagent/utils.py +0 -13
- universal_mcp/agents/base.py +0 -129
- universal_mcp/agents/bigtool/__init__.py +0 -54
- universal_mcp/agents/bigtool/__main__.py +0 -24
- universal_mcp/agents/bigtool/context.py +0 -24
- universal_mcp/agents/bigtool/graph.py +0 -166
- universal_mcp/agents/bigtool/prompts.py +0 -31
- universal_mcp/agents/bigtool/state.py +0 -27
- universal_mcp/agents/bigtool2/__init__.py +0 -53
- universal_mcp/agents/bigtool2/__main__.py +0 -24
- universal_mcp/agents/bigtool2/agent.py +0 -11
- universal_mcp/agents/bigtool2/context.py +0 -33
- universal_mcp/agents/bigtool2/graph.py +0 -169
- universal_mcp/agents/bigtool2/prompts.py +0 -12
- universal_mcp/agents/bigtool2/state.py +0 -27
- universal_mcp/agents/builder.py +0 -80
- universal_mcp/agents/cli.py +0 -27
- universal_mcp/agents/codeact/__init__.py +0 -243
- universal_mcp/agents/codeact/sandbox.py +0 -27
- universal_mcp/agents/codeact/test.py +0 -15
- universal_mcp/agents/codeact/utils.py +0 -61
- universal_mcp/agents/hil.py +0 -104
- universal_mcp/agents/llm.py +0 -45
- universal_mcp/agents/planner/__init__.py +0 -37
- universal_mcp/agents/planner/__main__.py +0 -24
- universal_mcp/agents/planner/graph.py +0 -82
- universal_mcp/agents/planner/prompts.py +0 -1
- universal_mcp/agents/planner/state.py +0 -12
- universal_mcp/agents/react.py +0 -84
- universal_mcp/agents/shared/agent_node.py +0 -34
- universal_mcp/agents/shared/tool_node.py +0 -235
- universal_mcp/agents/simple.py +0 -40
- universal_mcp/agents/tools.py +0 -35
- universal_mcp/agents/utils.py +0 -111
- universal_mcp/analytics.py +0 -111
- universal_mcp/applications/__init__.py +0 -70
- universal_mcp/utils/common.py +0 -278
- universal_mcp-0.1.24rc14.dist-info/RECORD +0 -99
- {universal_mcp-0.1.24rc14.dist-info → universal_mcp-0.1.24rc19.dist-info}/WHEEL +0 -0
- {universal_mcp-0.1.24rc14.dist-info → universal_mcp-0.1.24rc19.dist-info}/entry_points.txt +0 -0
- {universal_mcp-0.1.24rc14.dist-info → universal_mcp-0.1.24rc19.dist-info}/licenses/LICENSE +0 -0
universal_mcp/agentr/client.py
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import io
|
1
2
|
import os
|
2
3
|
from typing import Any
|
3
4
|
|
@@ -25,6 +26,7 @@ class AgentrClient:
|
|
25
26
|
base_url = base_url or os.getenv("AGENTR_BASE_URL", "https://api.agentr.dev")
|
26
27
|
self.base_url = f"{base_url.rstrip('/')}/v1"
|
27
28
|
api_key = api_key or os.getenv("AGENTR_API_KEY")
|
29
|
+
self.user_id = None
|
28
30
|
if api_key:
|
29
31
|
self.client = httpx.Client(
|
30
32
|
base_url=self.base_url,
|
@@ -34,6 +36,7 @@ class AgentrClient:
|
|
34
36
|
verify=False,
|
35
37
|
)
|
36
38
|
me_data = self.me()
|
39
|
+
self.user_id = me_data["id"]
|
37
40
|
logger.debug(f"Client initialized with user: {me_data['email']}")
|
38
41
|
elif auth_token:
|
39
42
|
logger.debug("Initializing client with auth token")
|
@@ -45,6 +48,7 @@ class AgentrClient:
|
|
45
48
|
verify=False,
|
46
49
|
)
|
47
50
|
me_data = self.me()
|
51
|
+
self.user_id = me_data["id"]
|
48
52
|
logger.debug(f"Client initialized with user: {me_data['email']}")
|
49
53
|
else:
|
50
54
|
raise ValueError("No API key or auth token provided")
|
@@ -207,3 +211,10 @@ class AgentrClient:
|
|
207
211
|
response = self.client.get("/tools/", params=params)
|
208
212
|
response.raise_for_status()
|
209
213
|
return response.json().get("items", [])
|
214
|
+
|
215
|
+
def _upload_file(self, file_name: str, mime_type: str, base64_data: str) -> str:
|
216
|
+
"""Upload a file to the server."""
|
217
|
+
files = {"file": (file_name, io.BytesIO(base64_data), mime_type)}
|
218
|
+
reponse = self.client.post("/files/upload", files=files)
|
219
|
+
reponse.raise_for_status()
|
220
|
+
return reponse.json()
|
universal_mcp/agentr/registry.py
CHANGED
@@ -1,15 +1,34 @@
|
|
1
|
+
import base64
|
1
2
|
from typing import Any
|
2
3
|
|
3
4
|
from loguru import logger
|
4
5
|
|
5
6
|
from universal_mcp.agentr.client import AgentrClient
|
6
|
-
from universal_mcp.applications import app_from_slug
|
7
|
+
from universal_mcp.applications.utils import app_from_slug
|
8
|
+
from universal_mcp.exceptions import ToolError
|
7
9
|
from universal_mcp.tools.manager import ToolManager, _get_app_and_tool_name
|
8
10
|
from universal_mcp.tools.registry import ToolRegistry
|
9
11
|
from universal_mcp.types import ToolConfig, ToolFormat
|
10
12
|
|
11
13
|
from .integration import AgentrIntegration
|
12
14
|
|
15
|
+
MARKDOWN_INSTRUCTIONS = """Always render the URL in markdown format for images and media files. Here are examples:
|
16
|
+
The url is provided in the response as "signed_url".
|
17
|
+
For images:
|
18
|
+
- Use markdown image syntax: 
|
19
|
+
- Example: 
|
20
|
+
- Always include descriptive alt text that explains what the image shows
|
21
|
+
|
22
|
+
For audio files:
|
23
|
+
- Use markdown link syntax with audio description: [🔊 Audio file description](url)
|
24
|
+
- Example: [🔊 Generated speech audio](https://example.com/audio.mp3)
|
25
|
+
|
26
|
+
For other media:
|
27
|
+
- Use descriptive link text: [📄 File description](url)
|
28
|
+
- Example: [📄 Generated document](https://example.com/document.pdf)
|
29
|
+
|
30
|
+
Always make the links clickable and include relevant context about what the user will see or hear when they access the URL."""
|
31
|
+
|
13
32
|
|
14
33
|
class AgentrRegistry(ToolRegistry):
|
15
34
|
"""Platform manager implementation for AgentR platform."""
|
@@ -133,7 +152,7 @@ class AgentrRegistry(ToolRegistry):
|
|
133
152
|
try:
|
134
153
|
# Clear tools from tool manager before loading new tools
|
135
154
|
self.tool_manager.clear_tools()
|
136
|
-
if isinstance(tools,
|
155
|
+
if isinstance(tools, dict):
|
137
156
|
logger.info("Loading tools from tool config")
|
138
157
|
self._load_tools_from_tool_config(tools, self.tool_manager)
|
139
158
|
else:
|
@@ -176,12 +195,28 @@ class AgentrRegistry(ToolRegistry):
|
|
176
195
|
tool_config: The tool configuration containing app names and tools
|
177
196
|
tool_manager: The tool manager to register tools with
|
178
197
|
"""
|
179
|
-
for app_name,
|
180
|
-
self._load_tools(app_name,
|
198
|
+
for app_name, tool_names in tool_config.items():
|
199
|
+
self._load_tools(app_name, tool_names, tool_manager)
|
181
200
|
|
182
201
|
async def call_tool(self, tool_name: str, tool_args: dict[str, Any]) -> dict[str, Any]:
|
183
202
|
"""Call a tool with the given name and arguments."""
|
184
|
-
|
203
|
+
data = await self.tool_manager.call_tool(tool_name, tool_args)
|
204
|
+
logger.debug(f"Tool {tool_name} called with args {tool_args} and returned {data}")
|
205
|
+
if isinstance(data, dict):
|
206
|
+
type_ = data.get("type")
|
207
|
+
if type_ == "image" or type_ == "audio":
|
208
|
+
# Special handling for images and audio
|
209
|
+
base64_data = data.get("data")
|
210
|
+
mime_type = data.get("mime_type")
|
211
|
+
file_name = data.get("file_name")
|
212
|
+
if not mime_type or not file_name:
|
213
|
+
raise ToolError("Mime type or file name is missing")
|
214
|
+
bytes_data = base64.b64decode(base64_data)
|
215
|
+
response = self.client._upload_file(file_name, mime_type, bytes_data)
|
216
|
+
# Hard code instructions for llm
|
217
|
+
response = {**response, "instructions": MARKDOWN_INSTRUCTIONS}
|
218
|
+
return response
|
219
|
+
return data
|
185
220
|
|
186
221
|
async def list_connected_apps(self) -> list[str]:
|
187
222
|
"""List all apps that the user has connected."""
|
@@ -9,7 +9,6 @@ from gql.transport.requests import RequestsHTTPTransport
|
|
9
9
|
from graphql import DocumentNode
|
10
10
|
from loguru import logger
|
11
11
|
|
12
|
-
from universal_mcp.analytics import analytics
|
13
12
|
from universal_mcp.integrations.integration import Integration
|
14
13
|
|
15
14
|
|
@@ -37,7 +36,6 @@ class BaseApplication(ABC):
|
|
37
36
|
"""
|
38
37
|
self.name = name
|
39
38
|
logger.debug(f"Initializing Application '{name}' with kwargs: {kwargs}")
|
40
|
-
analytics.track_app_loaded(name) # Track app loading
|
41
39
|
|
42
40
|
@abstractmethod
|
43
41
|
def list_tools(self) -> list[Callable]:
|
@@ -1,22 +1,25 @@
|
|
1
1
|
import datetime
|
2
2
|
|
3
3
|
import httpx
|
4
|
+
from loguru import logger
|
4
5
|
|
5
6
|
from universal_mcp.applications.application import BaseApplication
|
6
7
|
|
7
8
|
|
8
|
-
class
|
9
|
+
class SampleApp(BaseApplication):
|
9
10
|
"""A sample application providing basic utility tools."""
|
10
11
|
|
11
|
-
def __init__(self):
|
12
|
+
def __init__(self, **kwargs):
|
12
13
|
"""Initializes the SampleToolApp with the name 'sample_tool_app'."""
|
13
|
-
super().__init__(name="
|
14
|
+
super().__init__(name="sample")
|
14
15
|
|
15
16
|
def get_current_time(self):
|
16
17
|
"""Get the current system time as a formatted string.
|
17
18
|
|
18
19
|
Returns:
|
19
20
|
str: The current time in the format 'YYYY-MM-DD HH:MM:SS'.
|
21
|
+
Tags:
|
22
|
+
time, date, current, system, utility, important
|
20
23
|
"""
|
21
24
|
return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
22
25
|
|
@@ -25,6 +28,8 @@ class SampleToolApp(BaseApplication):
|
|
25
28
|
|
26
29
|
Returns:
|
27
30
|
str: The current date in the format 'YYYY-MM-DD'.
|
31
|
+
Tags:
|
32
|
+
time, date, current, system, utility, important
|
28
33
|
"""
|
29
34
|
return datetime.datetime.now().strftime("%Y-%m-%d")
|
30
35
|
|
@@ -36,6 +41,8 @@ class SampleToolApp(BaseApplication):
|
|
36
41
|
|
37
42
|
Returns:
|
38
43
|
str: The result of the calculation, or an error message if evaluation fails.
|
44
|
+
Tags:
|
45
|
+
math, calculation, utility, important
|
39
46
|
"""
|
40
47
|
try:
|
41
48
|
# Safe evaluation of mathematical expressions
|
@@ -44,29 +51,41 @@ class SampleToolApp(BaseApplication):
|
|
44
51
|
except Exception as e:
|
45
52
|
return f"Error in calculation: {str(e)}"
|
46
53
|
|
47
|
-
def
|
48
|
-
"""
|
54
|
+
def read_file(self, filename: str):
|
55
|
+
"""Read content from a file.
|
49
56
|
|
50
57
|
Args:
|
51
|
-
|
52
|
-
filename (str): The name of the file to operate on.
|
53
|
-
content (str, optional): The content to write to the file (used only for 'write'). Defaults to "".
|
58
|
+
filename (str): The name of the file to read from.
|
54
59
|
|
55
60
|
Returns:
|
56
|
-
str: The
|
61
|
+
str: The content of the file, or an error message if the operation fails.
|
62
|
+
Tags:
|
63
|
+
file, read, utility, important
|
57
64
|
"""
|
58
65
|
try:
|
59
|
-
|
60
|
-
|
61
|
-
return f"File content:\n{f.read()}"
|
62
|
-
elif operation == "write":
|
63
|
-
with open(filename, "w") as f:
|
64
|
-
f.write(content)
|
65
|
-
return f"Successfully wrote to {filename}"
|
66
|
-
else:
|
67
|
-
return "Invalid operation. Use 'read' or 'write'"
|
66
|
+
with open(filename) as f:
|
67
|
+
return f"File content:\n{f.read()}"
|
68
68
|
except Exception as e:
|
69
|
-
return f"File
|
69
|
+
return f"File read error: {str(e)}"
|
70
|
+
|
71
|
+
def write_file(self, filename: str, content: str):
|
72
|
+
"""Write content to a file.
|
73
|
+
|
74
|
+
Args:
|
75
|
+
filename (str): The name of the file to write to.
|
76
|
+
content (str): The content to write to the file.
|
77
|
+
|
78
|
+
Returns:
|
79
|
+
str: Success message or an error message if the operation fails.
|
80
|
+
Tags:
|
81
|
+
file, write, utility, important
|
82
|
+
"""
|
83
|
+
try:
|
84
|
+
with open(filename, "w") as f:
|
85
|
+
f.write(content)
|
86
|
+
return f"Successfully wrote to {filename}"
|
87
|
+
except Exception as e:
|
88
|
+
return f"File write error: {str(e)}"
|
70
89
|
|
71
90
|
def get_weather(
|
72
91
|
self,
|
@@ -230,6 +249,44 @@ class SampleToolApp(BaseApplication):
|
|
230
249
|
except Exception as e:
|
231
250
|
return {"error": str(e)}
|
232
251
|
|
252
|
+
def generate_image(self, prompt: str):
|
253
|
+
"""Generate an image based on a prompt.
|
254
|
+
A
|
255
|
+
Args:
|
256
|
+
prompt (str): The prompt to generate an image from.
|
257
|
+
|
258
|
+
Returns:
|
259
|
+
dict: The generated image.
|
260
|
+
Tags:
|
261
|
+
image, generate, utility, important
|
262
|
+
"""
|
263
|
+
import base64
|
264
|
+
import io
|
265
|
+
|
266
|
+
from PIL import Image, ImageDraw, ImageFont
|
267
|
+
|
268
|
+
# Create a simple placeholder image
|
269
|
+
img = Image.new("RGB", (600, 400), color="lightblue")
|
270
|
+
draw = ImageDraw.Draw(img)
|
271
|
+
|
272
|
+
# Add text to the image
|
273
|
+
try:
|
274
|
+
# Try to use a default font
|
275
|
+
font = ImageFont.load_default()
|
276
|
+
except Exception as e:
|
277
|
+
logger.error(f"Error loading font: {e}")
|
278
|
+
font = None
|
279
|
+
|
280
|
+
text = f"Generated: {prompt[:50]}..."
|
281
|
+
draw.text((50, 200), text, fill="black", font=font)
|
282
|
+
|
283
|
+
# Convert to base64
|
284
|
+
buffer = io.BytesIO()
|
285
|
+
img.save(buffer, format="PNG")
|
286
|
+
img_base64 = base64.b64encode(buffer.getvalue()).decode("utf-8")
|
287
|
+
|
288
|
+
return {"type": "image", "data": img_base64, "mime_type": "image/png", "file_name": "sample.png"}
|
289
|
+
|
233
290
|
def list_tools(self):
|
234
291
|
"""List all available tool methods in this application.
|
235
292
|
|
@@ -240,6 +297,8 @@ class SampleToolApp(BaseApplication):
|
|
240
297
|
self.get_current_time,
|
241
298
|
self.get_current_date,
|
242
299
|
self.calculate,
|
243
|
-
self.
|
300
|
+
self.read_file,
|
301
|
+
self.write_file,
|
244
302
|
self.get_simple_weather,
|
303
|
+
self.generate_image,
|
245
304
|
]
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import importlib
|
2
|
+
|
3
|
+
from loguru import logger
|
4
|
+
|
5
|
+
from universal_mcp.applications.application import BaseApplication
|
6
|
+
|
7
|
+
# --- Default Name Generators ---
|
8
|
+
|
9
|
+
|
10
|
+
def get_default_package_name(slug: str) -> str:
|
11
|
+
"""
|
12
|
+
Convert a repository slug to a package name.
|
13
|
+
"""
|
14
|
+
slug = slug.strip().lower().replace("-", "_")
|
15
|
+
package_name = f"universal_mcp.applications.{slug}"
|
16
|
+
return package_name
|
17
|
+
|
18
|
+
|
19
|
+
def get_default_module_path(slug: str) -> str:
|
20
|
+
"""
|
21
|
+
Convert a repository slug to a module path.
|
22
|
+
"""
|
23
|
+
package_name = get_default_package_name(slug)
|
24
|
+
module_path = f"{package_name}.app"
|
25
|
+
return module_path
|
26
|
+
|
27
|
+
|
28
|
+
def get_default_class_name(slug: str) -> str:
|
29
|
+
"""
|
30
|
+
Convert a repository slug to a class name.
|
31
|
+
"""
|
32
|
+
slug = slug.strip().lower()
|
33
|
+
parts = slug.replace("-", "_").split("_")
|
34
|
+
class_name = "".join(part.capitalize() for part in parts) + "App"
|
35
|
+
return class_name
|
36
|
+
|
37
|
+
|
38
|
+
# --- Application Loaders ---
|
39
|
+
|
40
|
+
|
41
|
+
def app_from_slug(slug: str) -> type[BaseApplication]:
|
42
|
+
"""Loads an application from a slug."""
|
43
|
+
return load_app_from_package(slug)
|
44
|
+
|
45
|
+
|
46
|
+
def load_app_from_package(slug: str) -> type[BaseApplication]:
|
47
|
+
"""Loads an application from a pip-installable package."""
|
48
|
+
logger.debug(f"Loading '{slug}' as a package.")
|
49
|
+
module_path_str = get_default_module_path(slug)
|
50
|
+
class_name_str = get_default_class_name(slug)
|
51
|
+
module = importlib.import_module(module_path_str)
|
52
|
+
return getattr(module, class_name_str)
|
universal_mcp/servers/server.py
CHANGED
@@ -5,7 +5,8 @@ from loguru import logger
|
|
5
5
|
from mcp.server.fastmcp import FastMCP
|
6
6
|
from mcp.types import TextContent
|
7
7
|
|
8
|
-
from universal_mcp.applications import BaseApplication
|
8
|
+
from universal_mcp.applications.application import BaseApplication
|
9
|
+
from universal_mcp.applications.utils import app_from_slug
|
9
10
|
from universal_mcp.config import ServerConfig
|
10
11
|
from universal_mcp.exceptions import ConfigurationError, ToolError
|
11
12
|
from universal_mcp.integrations.integration import ApiKeyIntegration, OAuthIntegration
|
@@ -44,8 +45,8 @@ def load_from_local_config(config: ServerConfig, tool_manager: ToolManager) -> N
|
|
44
45
|
integration = OAuthIntegration(config.name, store=store, **app_config.integration.credentials)
|
45
46
|
else:
|
46
47
|
raise ValueError(f"Unsupported integration type: {app_config.integration.type}")
|
47
|
-
app =
|
48
|
-
tool_manager.register_tools_from_app(app, app_config.actions)
|
48
|
+
app = app_from_slug(app_config.name)(integration=integration)
|
49
|
+
tool_manager.register_tools_from_app(app, tool_names=app_config.actions)
|
49
50
|
logger.info(f"Loaded app: {app_config.name}")
|
50
51
|
except Exception as e:
|
51
52
|
logger.error(f"Failed to load app {app_config.name}: {e}", exc_info=True)
|
universal_mcp/tools/manager.py
CHANGED
@@ -3,7 +3,6 @@ from typing import Any
|
|
3
3
|
|
4
4
|
from loguru import logger
|
5
5
|
|
6
|
-
from universal_mcp.analytics import analytics
|
7
6
|
from universal_mcp.applications.application import BaseApplication
|
8
7
|
from universal_mcp.exceptions import ToolNotFoundError
|
9
8
|
from universal_mcp.tools.adapters import (
|
@@ -298,8 +297,6 @@ class ToolManager:
|
|
298
297
|
raise ToolNotFoundError(f"Unknown tool: {name}")
|
299
298
|
try:
|
300
299
|
result = await tool.run(arguments, context)
|
301
|
-
analytics.track_tool_called(name, app_name, "success")
|
302
300
|
return result
|
303
301
|
except Exception as e:
|
304
|
-
analytics.track_tool_called(name, app_name, "error", str(e))
|
305
302
|
raise e
|
universal_mcp/types.py
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
from enum import Enum
|
2
|
-
from typing import Literal
|
3
|
-
|
4
|
-
from pydantic import BaseModel
|
5
2
|
|
6
3
|
# Constants
|
7
4
|
DEFAULT_IMPORTANT_TAG = "important"
|
@@ -18,21 +15,4 @@ class ToolFormat(str, Enum):
|
|
18
15
|
OPENAI = "openai"
|
19
16
|
|
20
17
|
|
21
|
-
|
22
|
-
tools: list[str]
|
23
|
-
|
24
|
-
|
25
|
-
class MCPConnection(BaseModel):
|
26
|
-
transport: Literal["stdio", "sse", "streamable-http"]
|
27
|
-
command: str | None = None
|
28
|
-
args: list[str] | None = None
|
29
|
-
url: str | None = None
|
30
|
-
headers: dict[str, str] | None = None
|
31
|
-
|
32
|
-
|
33
|
-
class AgentrToolConfig(BaseModel):
|
34
|
-
agentrServers: dict[str, AgentrConnection] | None = None
|
35
|
-
|
36
|
-
|
37
|
-
class ToolConfig(AgentrToolConfig):
|
38
|
-
mcpServers: dict[str, MCPConnection] | None = None
|
18
|
+
ToolConfig = dict[str, list[str]]
|
universal_mcp/utils/prompts.py
CHANGED
@@ -229,7 +229,6 @@ from loguru import logger
|
|
229
229
|
|
230
230
|
import httpx
|
231
231
|
|
232
|
-
from universal_mcp.analytics import analytics
|
233
232
|
from universal_mcp.integrations import Integration
|
234
233
|
|
235
234
|
class BaseApplication(ABC):
|
@@ -256,7 +255,6 @@ class BaseApplication(ABC):
|
|
256
255
|
"""
|
257
256
|
self.name = name
|
258
257
|
logger.debug(f"Initializing Application '{name}' with kwargs: {kwargs}")
|
259
|
-
analytics.track_app_loaded(name) # Track app loading
|
260
258
|
|
261
259
|
@abstractmethod
|
262
260
|
def list_tools(self) -> list[Callable]:
|
universal_mcp/utils/testing.py
CHANGED
@@ -8,7 +8,7 @@ from pydantic import BaseModel, SecretStr
|
|
8
8
|
|
9
9
|
from universal_mcp.agentr import AgentrIntegration
|
10
10
|
from universal_mcp.agentr.client import AgentrClient
|
11
|
-
from universal_mcp.applications import APIApplication, BaseApplication
|
11
|
+
from universal_mcp.applications.application import APIApplication, BaseApplication
|
12
12
|
from universal_mcp.tools import Tool, ToolManager
|
13
13
|
from universal_mcp.types import ToolFormat
|
14
14
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: universal-mcp
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.24rc19
|
4
4
|
Summary: Universal MCP acts as a middle ware for your API applications. It can store your credentials, authorize, enable disable apps on the fly and much more.
|
5
5
|
Author-email: Manoj Bajaj <manojbajaj95@gmail.com>
|
6
6
|
License: MIT
|
@@ -0,0 +1,54 @@
|
|
1
|
+
universal_mcp/cli.py,sha256=pPnIWLhSrLV9ukI8YAg2znehCR3VovhEkmh8XkRT3MU,2505
|
2
|
+
universal_mcp/config.py,sha256=lOlDAgQMT7f6VymmsuCP9sYLlxGKj0hDF3hFcJ2nzS4,8135
|
3
|
+
universal_mcp/exceptions.py,sha256=Uen8UFgLHGlSwXgRUyF-nhqTwdiBuL3okgBVRV2AgtA,2150
|
4
|
+
universal_mcp/logger.py,sha256=VmH_83efpErLEDTJqz55Dp0dioTXfGvMBLZUx5smOLc,2116
|
5
|
+
universal_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
universal_mcp/types.py,sha256=DAzYyS7Zqdi38SpnhdOm08_JeN2CJiC0hDIpLLIhlSw,316
|
7
|
+
universal_mcp/agentr/README.md,sha256=t15pVgkCwZM5wzgLgrf0Zv6hVL7dPmKXvAeTf8CiXPQ,6641
|
8
|
+
universal_mcp/agentr/__init__.py,sha256=fv1ZnOCduIUiJ9oN4e6Ya_hA2oWQvcEuDU3Ek1vEufI,180
|
9
|
+
universal_mcp/agentr/client.py,sha256=CwfmOAgWsApm0buxZPni3vW6MFgrwdddXsXmQA5UYrA,7882
|
10
|
+
universal_mcp/agentr/integration.py,sha256=V5GjqocqS02tRoI8MeV9PL6m-BzejwBzgJhOHo4MxAE,4212
|
11
|
+
universal_mcp/agentr/registry.py,sha256=cWkg9cUEmksWqeuh4xazFf1WtRQ3lEZf1s53hqTlmG4,8657
|
12
|
+
universal_mcp/agentr/server.py,sha256=bIPmHMiKKwnUYnxmfZVRh1thcn7Rytm_-bNiXTfANzc,2098
|
13
|
+
universal_mcp/applications/application.py,sha256=do45GC0jnNepZHL8US2yDNq9s0ZnE6bII4Xbw90GRTc,23727
|
14
|
+
universal_mcp/applications/utils.py,sha256=8Pp9lZU6IPt9z9BnuJ-vpv-NGuzryt1c4e4-ShDd2XI,1450
|
15
|
+
universal_mcp/applications/sample/app.py,sha256=D9zPezC13xXVMlfO2A0fHgJQD_I-bnpf9UOOHveHMek,10537
|
16
|
+
universal_mcp/client/oauth.py,sha256=O00zOUfQxINaruFU2zt-64DIR1_mAqrY8ykLQo-teJU,8679
|
17
|
+
universal_mcp/client/token_store.py,sha256=6VAzjzJG49wYvmEDqksFvb-fVqdjHIKWv7yYyh_AuF8,3912
|
18
|
+
universal_mcp/client/transport.py,sha256=qqtb0ky6yvLBxsaA9-oFU0v9MwfcQb4eomq-O2fmwtQ,11850
|
19
|
+
universal_mcp/integrations/__init__.py,sha256=tfzLyPEPly5tfIcT8K6-oKCr_MEFGxOROHy_NeVy0KM,200
|
20
|
+
universal_mcp/integrations/integration.py,sha256=H-hOoDHqk78A4Fi_TGN7OOFS7PDfqXK_nedH8iSz-6A,16459
|
21
|
+
universal_mcp/servers/__init__.py,sha256=speBb_E94UJa4A6Fv8RHFeoJ7cR-q2bCMtKV7R21P5w,142
|
22
|
+
universal_mcp/servers/server.py,sha256=bJTG86X_kn0R8lWIYvCZw-cp-rVAOKd12-E5WOEsz8Y,5950
|
23
|
+
universal_mcp/stores/__init__.py,sha256=quvuwhZnpiSLuojf0NfmBx2xpaCulv3fbKtKaSCEmuM,603
|
24
|
+
universal_mcp/stores/store.py,sha256=yWbEGZb53z3fpVyqGWbes63z1CtIzC_IuM49OXy__UY,10137
|
25
|
+
universal_mcp/tools/__init__.py,sha256=jC8hsqfTdtn32yU57AVFUXiU3ZmUOCfCERSCaNEIH7E,395
|
26
|
+
universal_mcp/tools/adapters.py,sha256=YJ2oqgc8JgmtsdRRtvO-PO0Q0bKqTJ4Y3J6yxlESoTo,3947
|
27
|
+
universal_mcp/tools/docstring_parser.py,sha256=efEOE-ME7G5Jbbzpn7pN2xNuyu2M5zfZ1Tqu1lRB0Gk,8392
|
28
|
+
universal_mcp/tools/func_metadata.py,sha256=F4jd--hoZWKPBbZihVtluYKUsIdXdq4a0VWRgMl5k-Q,10838
|
29
|
+
universal_mcp/tools/manager.py,sha256=T8iSk7Q6s3MFaQcwUapPvcQ6_l7_g4Xt2xXk55lPJ1w,10321
|
30
|
+
universal_mcp/tools/registry.py,sha256=LD0J_bPsd8PRTObyvXglqTW1jfZX98m7KBdyP8Yn7wA,2585
|
31
|
+
universal_mcp/tools/tools.py,sha256=Lk-wUO3rfhwdxaRANtC7lQr5fXi7nclf0oHzxNAb79Q,4927
|
32
|
+
universal_mcp/utils/__init__.py,sha256=8wi4PGWu-SrFjNJ8U7fr2iFJ1ktqlDmSKj1xYd7KSDc,41
|
33
|
+
universal_mcp/utils/installation.py,sha256=PU_GfHPqzkumKk-xG4L9CkBzSmABxmchwblZkx-zY-I,7204
|
34
|
+
universal_mcp/utils/prompts.py,sha256=yaZ8lj5GooA8bbT42lcWR2r35HAnOalCvyWS1I2ltGM,27439
|
35
|
+
universal_mcp/utils/singleton.py,sha256=RoOiKxBOAhp0TK1QaMDYi-8GjRcy2Vh-bAOuIAcYan0,775
|
36
|
+
universal_mcp/utils/testing.py,sha256=PJYB-QVlBuDkRW-luHkJapf4T1oaNjxt8gvQoTS7cCA,8021
|
37
|
+
universal_mcp/utils/openapi/__inti__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
38
|
+
universal_mcp/utils/openapi/api_generator.py,sha256=sygUE8Sropq3Pz09N1kSwGelgnTCAz_lOGspTaYCWEs,6985
|
39
|
+
universal_mcp/utils/openapi/api_splitter.py,sha256=io7fV-E8hUIR4NxFlakqydbgrQF6aBAnZHPMlpxw-wc,20967
|
40
|
+
universal_mcp/utils/openapi/cli.py,sha256=az5ObS74R-MmDCOZ1PHTJVKZJrHnsBOAweOUa7A-GqA,25918
|
41
|
+
universal_mcp/utils/openapi/docgen.py,sha256=DNmwlhg_-TRrHa74epyErMTRjV2nutfCQ7seb_Rq5hE,21366
|
42
|
+
universal_mcp/utils/openapi/filters.py,sha256=96FajO5nLbvjNPy2A1HvSS9jqpzMDHd4q_QTP-DIsPI,3842
|
43
|
+
universal_mcp/utils/openapi/openapi.py,sha256=mcmahLJrR-CS-r2RDaYOgMV1Eq7ZuCHMk7_Qrijadh4,62613
|
44
|
+
universal_mcp/utils/openapi/postprocessor.py,sha256=j_OZ5u2VCb44rfvnJZdKcxQRyGgrEVMr8ue9oN0Ed7A,12235
|
45
|
+
universal_mcp/utils/openapi/preprocessor.py,sha256=r4n0WQI__OzPL8FTza7jxiM4EYeZwa-3tvEJaJYZC44,63081
|
46
|
+
universal_mcp/utils/openapi/readme.py,sha256=R2Jp7DUXYNsXPDV6eFTkLiy7MXbSULUj1vHh4O_nB4c,2974
|
47
|
+
universal_mcp/utils/openapi/test_generator.py,sha256=vucBh9klWmQOUA740TFwfM9ry2nkwKWQiNRcsiZ9HbY,12229
|
48
|
+
universal_mcp/utils/templates/README.md.j2,sha256=Mrm181YX-o_-WEfKs01Bi2RJy43rBiq2j6fTtbWgbTA,401
|
49
|
+
universal_mcp/utils/templates/api_client.py.j2,sha256=972Im7LNUAq3yZTfwDcgivnb-b8u6_JLKWXwoIwXXXQ,908
|
50
|
+
universal_mcp-0.1.24rc19.dist-info/METADATA,sha256=zKP0JF9Lp3hnTW-8ZvLutdDpGEcqAishzXtrICY3a4Y,3255
|
51
|
+
universal_mcp-0.1.24rc19.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
52
|
+
universal_mcp-0.1.24rc19.dist-info/entry_points.txt,sha256=QlBrVKmA2jIM0q-C-3TQMNJTTWOsOFQvgedBq2rZTS8,56
|
53
|
+
universal_mcp-0.1.24rc19.dist-info/licenses/LICENSE,sha256=NweDZVPslBAZFzlgByF158b85GR0f5_tLQgq1NS48To,1063
|
54
|
+
universal_mcp-0.1.24rc19.dist-info/RECORD,,
|
universal_mcp/__init__.py
DELETED
File without changes
|
universal_mcp/agents/__init__.py
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
from universal_mcp.agents.autoagent import AutoAgent
|
2
|
-
from universal_mcp.agents.base import BaseAgent
|
3
|
-
from universal_mcp.agents.bigtool import BigToolAgent
|
4
|
-
from universal_mcp.agents.planner import PlannerAgent
|
5
|
-
from universal_mcp.agents.react import ReactAgent
|
6
|
-
from universal_mcp.agents.simple import SimpleAgent
|
7
|
-
from universal_mcp.agents.bigtool2 import BigToolAgent2
|
8
|
-
from universal_mcp.agents.builder import BuilderAgent
|
9
|
-
|
10
|
-
__all__ = ["BaseAgent", "ReactAgent", "SimpleAgent", "AutoAgent", "BigToolAgent", "PlannerAgent", "BuilderAgent" ,"BigToolAgent2"]
|
@@ -1,30 +0,0 @@
|
|
1
|
-
from langgraph.checkpoint.base import BaseCheckpointSaver
|
2
|
-
|
3
|
-
from universal_mcp.agents.autoagent.graph import build_graph
|
4
|
-
from universal_mcp.agents.base import BaseAgent
|
5
|
-
from universal_mcp.tools.registry import ToolRegistry
|
6
|
-
|
7
|
-
|
8
|
-
class AutoAgent(BaseAgent):
|
9
|
-
def __init__(
|
10
|
-
self,
|
11
|
-
name: str,
|
12
|
-
instructions: str,
|
13
|
-
model: str,
|
14
|
-
memory: BaseCheckpointSaver | None = None,
|
15
|
-
registry: ToolRegistry | None = None,
|
16
|
-
**kwargs,
|
17
|
-
):
|
18
|
-
super().__init__(name, instructions, model, memory, **kwargs)
|
19
|
-
self.tool_registry = registry
|
20
|
-
|
21
|
-
async def _build_graph(self):
|
22
|
-
builder = await build_graph(self.tool_registry, self.instructions)
|
23
|
-
return builder.compile(checkpointer=self.memory)
|
24
|
-
|
25
|
-
@property
|
26
|
-
def graph(self):
|
27
|
-
return self._graph
|
28
|
-
|
29
|
-
|
30
|
-
__all__ = ["AutoAgent"]
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import asyncio
|
2
|
-
|
3
|
-
from loguru import logger
|
4
|
-
|
5
|
-
from universal_mcp.agentr.registry import AgentrRegistry
|
6
|
-
from universal_mcp.agents.autoagent import AutoAgent
|
7
|
-
|
8
|
-
|
9
|
-
async def main():
|
10
|
-
agent = AutoAgent(
|
11
|
-
name="autoagent",
|
12
|
-
instructions="You are a helpful assistant that can use tools to help the user.",
|
13
|
-
model="azure/gpt-4.1",
|
14
|
-
registry=AgentrRegistry(),
|
15
|
-
)
|
16
|
-
async for event in agent.stream(
|
17
|
-
user_input="Send an email to manoj@agentr.dev",
|
18
|
-
thread_id="test123",
|
19
|
-
):
|
20
|
-
logger.info(event.content)
|
21
|
-
# from loguru import logger; logger.debug(result)
|
22
|
-
|
23
|
-
|
24
|
-
if __name__ == "__main__":
|
25
|
-
asyncio.run(main())
|
@@ -1,26 +0,0 @@
|
|
1
|
-
from dataclasses import dataclass, field
|
2
|
-
from typing import Annotated
|
3
|
-
|
4
|
-
from universal_mcp.agents.autoagent.prompts import SYSTEM_PROMPT
|
5
|
-
|
6
|
-
|
7
|
-
@dataclass(kw_only=True)
|
8
|
-
class Context:
|
9
|
-
"""The context for the agent."""
|
10
|
-
|
11
|
-
system_prompt: str = field(
|
12
|
-
default=SYSTEM_PROMPT,
|
13
|
-
metadata={
|
14
|
-
"description": "The system prompt to use for the agent's interactions. "
|
15
|
-
"This prompt sets the context and behavior for the agent."
|
16
|
-
},
|
17
|
-
)
|
18
|
-
|
19
|
-
model: Annotated[str, {"__template_metadata__": {"kind": "llm"}}] = field(
|
20
|
-
default="anthropic/claude-4-sonnet-20250514",
|
21
|
-
# default="vertex/gemini-2.5-flash",
|
22
|
-
metadata={
|
23
|
-
"description": "The name of the language model to use for the agent's main interactions. "
|
24
|
-
"Should be in the form: provider/model-name."
|
25
|
-
},
|
26
|
-
)
|