universal-mcp 0.1.24rc8__tar.gz → 0.1.24rc9__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 (89) hide show
  1. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/.gitignore +1 -0
  2. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/PKG-INFO +1 -1
  3. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/pyproject.toml +1 -1
  4. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agentr/client.py +10 -10
  5. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/autoagent/context.py +1 -0
  6. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/autoagent/graph.py +24 -11
  7. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/autoagent/prompts.py +3 -2
  8. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/llm.py +3 -1
  9. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/LICENSE +0 -0
  10. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/README.md +0 -0
  11. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/tests/__init__.py +0 -0
  12. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/tests/conftest.py +0 -0
  13. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/tests/test_api_generator.py +0 -0
  14. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/tests/test_api_integration.py +0 -0
  15. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/tests/test_applications.py +0 -0
  16. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/tests/test_localserver.py +0 -0
  17. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/tests/test_stores.py +0 -0
  18. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/tests/test_tool.py +0 -0
  19. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/tests/test_tool_manager.py +0 -0
  20. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/tests/test_zenquotes.py +0 -0
  21. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/__init__.py +0 -0
  22. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agentr/README.md +0 -0
  23. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agentr/__init__.py +0 -0
  24. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agentr/integration.py +0 -0
  25. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agentr/registry.py +0 -0
  26. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agentr/server.py +0 -0
  27. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/__init__.py +0 -0
  28. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/auto.py +0 -0
  29. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/autoagent/__init__.py +0 -0
  30. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/autoagent/__main__.py +0 -0
  31. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/autoagent/state.py +0 -0
  32. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/autoagent/studio.py +0 -0
  33. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/autoagent/utils.py +0 -0
  34. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/base.py +0 -0
  35. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/cli.py +0 -0
  36. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/codeact/__init__.py +0 -0
  37. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/codeact/sandbox.py +0 -0
  38. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/codeact/test.py +0 -0
  39. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/codeact/utils.py +0 -0
  40. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/hil.py +0 -0
  41. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/react.py +0 -0
  42. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/simple.py +0 -0
  43. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/tools.py +0 -0
  44. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/agents/utils.py +0 -0
  45. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/analytics.py +0 -0
  46. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/applications/__init__.py +0 -0
  47. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/applications/application.py +0 -0
  48. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/applications/sample/app.py +0 -0
  49. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/cli.py +0 -0
  50. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/client/oauth.py +0 -0
  51. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/client/token_store.py +0 -0
  52. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/client/transport.py +0 -0
  53. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/config.py +0 -0
  54. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/exceptions.py +0 -0
  55. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/integrations/__init__.py +0 -0
  56. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/integrations/integration.py +0 -0
  57. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/logger.py +0 -0
  58. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/py.typed +0 -0
  59. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/servers/__init__.py +0 -0
  60. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/servers/server.py +0 -0
  61. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/stores/__init__.py +0 -0
  62. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/stores/store.py +0 -0
  63. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/tools/__init__.py +0 -0
  64. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/tools/adapters.py +0 -0
  65. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/tools/docstring_parser.py +0 -0
  66. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/tools/func_metadata.py +0 -0
  67. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/tools/manager.py +0 -0
  68. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/tools/registry.py +0 -0
  69. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/tools/tools.py +0 -0
  70. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/types.py +0 -0
  71. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/__init__.py +0 -0
  72. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/common.py +0 -0
  73. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/installation.py +0 -0
  74. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/openapi/__inti__.py +0 -0
  75. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/openapi/api_generator.py +0 -0
  76. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/openapi/api_splitter.py +0 -0
  77. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/openapi/cli.py +0 -0
  78. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/openapi/docgen.py +0 -0
  79. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/openapi/filters.py +0 -0
  80. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/openapi/openapi.py +0 -0
  81. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/openapi/postprocessor.py +0 -0
  82. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/openapi/preprocessor.py +0 -0
  83. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/openapi/readme.py +0 -0
  84. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/openapi/test_generator.py +0 -0
  85. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/prompts.py +0 -0
  86. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/singleton.py +0 -0
  87. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/templates/README.md.j2 +0 -0
  88. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/templates/api_client.py.j2 +0 -0
  89. {universal_mcp-0.1.24rc8 → universal_mcp-0.1.24rc9}/src/universal_mcp/utils/testing.py +0 -0
@@ -57,3 +57,4 @@ site/
57
57
  # langgraph temporary files
58
58
  .langgraph_api/
59
59
  langgraph.json
60
+ agentr-1-6c4ebd5cc914.json
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: universal-mcp
3
- Version: 0.1.24rc8
3
+ Version: 0.1.24rc9
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
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "universal-mcp"
7
- version = "0.1.24-rc8"
7
+ version = "0.1.24-rc9"
8
8
  description = "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."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -50,7 +50,7 @@ class AgentrClient:
50
50
  raise ValueError("No API key or auth token provided")
51
51
 
52
52
  def me(self):
53
- response = self.client.get("/users/me")
53
+ response = self.client.get("/users/me/")
54
54
  logger.debug(f"Me response: {response.status_code}")
55
55
  response.raise_for_status()
56
56
  data = response.json()
@@ -70,7 +70,7 @@ class AgentrClient:
70
70
  HTTPError: For other API errors.
71
71
  """
72
72
  response = self.client.get(
73
- "/credentials",
73
+ "/credentials/",
74
74
  params={"app_id": app_id},
75
75
  )
76
76
  logger.debug(f"Credentials response: {response.status_code}")
@@ -93,7 +93,7 @@ class AgentrClient:
93
93
  Raises:
94
94
  HTTPError: If the API request fails.
95
95
  """
96
- response = self.client.post("/connections/authorize", json={"app_id": app_id})
96
+ response = self.client.post("/connections/authorize/", json={"app_id": app_id})
97
97
  response.raise_for_status()
98
98
  url = response.json().get("authorize_url")
99
99
  return f"Please ask the user to visit the following url to authorize the application: {url}. Render the url in proper markdown format with a clickable link."
@@ -117,7 +117,7 @@ class AgentrClient:
117
117
  Returns:
118
118
  List[Dict[str, Any]]: A list of user app data dictionaries.
119
119
  """
120
- response = self.client.get("/apps/me")
120
+ response = self.client.get("/apps/me/")
121
121
  response.raise_for_status()
122
122
  return response.json().get("items", [])
123
123
 
@@ -127,7 +127,7 @@ class AgentrClient:
127
127
  Returns:
128
128
  List[Dict[str, Any]]: A list of user connection data dictionaries.
129
129
  """
130
- response = self.client.get("/connections")
130
+ response = self.client.get("/connections/")
131
131
  response.raise_for_status()
132
132
  return response.json().get("items", [])
133
133
 
@@ -143,7 +143,7 @@ class AgentrClient:
143
143
  Raises:
144
144
  httpx.HTTPError: If the API request fails.
145
145
  """
146
- response = self.client.get(f"/apps/{app_id}")
146
+ response = self.client.get(f"/apps/{app_id}/")
147
147
  response.raise_for_status()
148
148
  return response.json()
149
149
 
@@ -159,7 +159,7 @@ class AgentrClient:
159
159
  params = {}
160
160
  if app_id:
161
161
  params["app_id"] = app_id
162
- response = self.client.get("/tools", params=params)
162
+ response = self.client.get("/tools/", params=params)
163
163
  response.raise_for_status()
164
164
  return response.json().get("items", [])
165
165
 
@@ -175,7 +175,7 @@ class AgentrClient:
175
175
  Raises:
176
176
  httpx.HTTPError: If the API request fails.
177
177
  """
178
- response = self.client.get(f"/tools/{tool_id}")
178
+ response = self.client.get(f"/tools/{tool_id}/")
179
179
  response.raise_for_status()
180
180
  return response.json()
181
181
 
@@ -189,7 +189,7 @@ class AgentrClient:
189
189
  Returns:
190
190
  List[Dict[str, Any]]: A list of app data dictionaries.
191
191
  """
192
- response = self.client.get("/apps", params={"search": query, "limit": limit})
192
+ response = self.client.get("/apps/", params={"search": query, "limit": limit})
193
193
  response.raise_for_status()
194
194
  return response.json().get("items", [])
195
195
 
@@ -204,6 +204,6 @@ class AgentrClient:
204
204
  params = {"search": query, "limit": limit}
205
205
  if app_id:
206
206
  params["app_id"] = app_id
207
- response = self.client.get("/tools", params=params)
207
+ response = self.client.get("/tools/", params=params)
208
208
  response.raise_for_status()
209
209
  return response.json().get("items", [])
@@ -18,6 +18,7 @@ class Context:
18
18
 
19
19
  model: Annotated[str, {"__template_metadata__": {"kind": "llm"}}] = field(
20
20
  default="anthropic/claude-4-sonnet-20250514",
21
+ # default="vertex/gemini-2.5-flash",
21
22
  metadata={
22
23
  "description": "The name of the language model to use for the agent's main interactions. "
23
24
  "Should be in the form: provider/model-name."
@@ -18,7 +18,7 @@ from universal_mcp.types import ToolFormat
18
18
  async def build_graph(tool_registry: ToolRegistry, instructions: str = ""):
19
19
  @tool()
20
20
  async def search_tools(query: str, app_ids: list[str] | None = None) -> list[str]:
21
- """Retrieve tools using a search query and app id. Use multiple times if you require tools for different tasks."""
21
+ """Retrieve tools using a search query and a list of app ids. Use multiple times if you require tools for different queries."""
22
22
  tools_list = []
23
23
  if app_ids is not None:
24
24
  for app_id in app_ids:
@@ -46,7 +46,13 @@ async def build_graph(tool_registry: ToolRegistry, instructions: str = ""):
46
46
  ):
47
47
  system_prompt = runtime.context.system_prompt if runtime.context.system_prompt else SYSTEM_PROMPT
48
48
  app_ids = await tool_registry.list_all_apps()
49
- app_id_descriptions = "\n".join([f"{app['id']}: {app['description']}" for app in app_ids])
49
+ connections = tool_registry.client.list_my_connections()
50
+ connection_ids = set([connection["app_id"] for connection in connections])
51
+ connected_apps = [app['id'] for app in app_ids if app["id"] in connection_ids]
52
+ unconnected_apps = [app['id'] for app in app_ids if app["id"] not in connection_ids]
53
+ app_id_descriptions = "These are the apps connected to the user's account:\n" + "\n".join([f"{app}" for app in connected_apps])
54
+ if unconnected_apps:
55
+ app_id_descriptions += "\n\nOther (not connected) apps: " + "\n".join([f"{app}" for app in unconnected_apps])
50
56
  print(app_id_descriptions)
51
57
  system_prompt = system_prompt.format(system_time=datetime.now(tz=UTC).isoformat(), app_ids=app_id_descriptions)
52
58
 
@@ -62,8 +68,6 @@ async def build_graph(tool_registry: ToolRegistry, instructions: str = ""):
62
68
  token_usage[key] += response_raw.usage_metadata[key]
63
69
  else:
64
70
  token_usage[key] = response_raw.usage_metadata[key]
65
- print(response_raw.usage_metadata)
66
- print(token_usage)
67
71
  response = cast(AIMessage, response_raw)
68
72
  return {"messages": [response], "token_usage": token_usage}
69
73
 
@@ -122,14 +126,23 @@ async def build_graph(tool_registry: ToolRegistry, instructions: str = ""):
122
126
  )
123
127
  else:
124
128
  await tool_registry.export_tools([tool_call["name"]], ToolFormat.LANGCHAIN)
125
- tool_result = await tool_registry.call_tool(tool_call["name"], tool_call["args"])
126
- outputs.append(
127
- ToolMessage(
128
- content=json.dumps(tool_result),
129
- name=tool_call["name"],
130
- tool_call_id=tool_call["id"],
129
+ try:
130
+ tool_result = await tool_registry.call_tool(tool_call["name"], tool_call["args"])
131
+ outputs.append(
132
+ ToolMessage(
133
+ content=json.dumps(tool_result),
134
+ name=tool_call["name"],
135
+ tool_call_id=tool_call["id"],
136
+ )
137
+ )
138
+ except Exception as e:
139
+ outputs.append(
140
+ ToolMessage(
141
+ content=json.dumps("Error: "+str(e)),
142
+ name=tool_call["name"],
143
+ tool_call_id=tool_call["id"],
144
+ )
131
145
  )
132
- )
133
146
  return {"messages": outputs, "selected_tool_ids": tool_ids}
134
147
 
135
148
 
@@ -3,6 +3,7 @@
3
3
  SYSTEM_PROMPT = """You are a helpful AI assistant. When you lack tools for any task you should use the `search_tools` function to unlock relevant tools. Whenever you need to ask the user for any information, or choose between multiple different applications, you can ask the user using the `ask_user` function.
4
4
 
5
5
  System time: {system_time}
6
- App IDs: {app_ids}
7
- Note that when multiple apps seem relevant for a task, you should ask the user to choose the app.
6
+ These are the list of apps available to you:
7
+ {app_ids}
8
+ Note that when multiple apps seem relevant for a task, you MUST ask the user to choose the app. Prefer connected apps over unconnected apps while breaking a tie. If more than one relevant app (or none of the relevant apps) are connected, you must ask the user to choose the app.
8
9
  """
@@ -1,12 +1,12 @@
1
1
  from langchain_anthropic import ChatAnthropic
2
2
  from langchain_core.language_models import BaseChatModel
3
3
  from langchain_google_vertexai.model_garden import ChatAnthropicVertex
4
+ from langchain_google_vertexai import ChatVertexAI
4
5
  from langchain_openai import AzureChatOpenAI
5
6
 
6
7
 
7
8
  def load_chat_model(fully_specified_name: str, tags: list[str] | None = None) -> BaseChatModel:
8
9
  """Load a chat model from a fully specified name.
9
-
10
10
  Args:
11
11
  fully_specified_name (str): String in the format 'provider/model'.
12
12
  """
@@ -19,6 +19,8 @@ def load_chat_model(fully_specified_name: str, tags: list[str] | None = None) ->
19
19
  ) # pyright: ignore[reportCallIssue]
20
20
  elif provider == "azure":
21
21
  return AzureChatOpenAI(model=model, api_version="2024-12-01-preview", azure_deployment=model, tags=tags)
22
+ elif provider == "vertex":
23
+ return ChatVertexAI(model=model, temperature=0.1, tags=tags)
22
24
  else:
23
25
  raise ValueError(f"Unsupported provider: {provider}")
24
26