universal-mcp 0.1.24rc3__tar.gz → 0.1.24rc4__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 (81) hide show
  1. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/PKG-INFO +2 -2
  2. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/pyproject.toml +2 -2
  3. universal_mcp-0.1.24rc4/src/universal_mcp/agentr/README.md +201 -0
  4. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/.gitignore +0 -0
  5. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/LICENSE +0 -0
  6. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/README.md +0 -0
  7. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/tests/__init__.py +0 -0
  8. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/tests/conftest.py +0 -0
  9. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/tests/test_api_generator.py +0 -0
  10. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/tests/test_api_integration.py +0 -0
  11. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/tests/test_applications.py +0 -0
  12. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/tests/test_localserver.py +0 -0
  13. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/tests/test_stores.py +0 -0
  14. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/tests/test_tool.py +0 -0
  15. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/tests/test_tool_manager.py +0 -0
  16. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/tests/test_zenquotes.py +0 -0
  17. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/__init__.py +0 -0
  18. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agentr/__init__.py +0 -0
  19. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agentr/agentr.py +0 -0
  20. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agentr/client.py +0 -0
  21. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agentr/integration.py +0 -0
  22. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agentr/registry.py +0 -0
  23. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agentr/server.py +0 -0
  24. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agents/__init__.py +0 -0
  25. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agents/auto.py +0 -0
  26. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agents/base.py +0 -0
  27. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agents/cli.py +0 -0
  28. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agents/codeact/__init__.py +0 -0
  29. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agents/codeact/sandbox.py +0 -0
  30. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agents/codeact/test.py +0 -0
  31. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agents/codeact/utils.py +0 -0
  32. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agents/hil.py +0 -0
  33. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agents/llm.py +0 -0
  34. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agents/react.py +0 -0
  35. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agents/simple.py +0 -0
  36. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/agents/utils.py +0 -0
  37. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/analytics.py +0 -0
  38. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/applications/__init__.py +0 -0
  39. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/applications/application.py +0 -0
  40. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/applications/sample/app.py +0 -0
  41. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/cli.py +0 -0
  42. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/client/oauth.py +0 -0
  43. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/client/token_store.py +0 -0
  44. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/client/transport.py +0 -0
  45. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/config.py +0 -0
  46. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/exceptions.py +0 -0
  47. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/integrations/__init__.py +0 -0
  48. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/integrations/integration.py +0 -0
  49. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/logger.py +0 -0
  50. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/py.typed +0 -0
  51. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/servers/__init__.py +0 -0
  52. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/servers/server.py +0 -0
  53. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/stores/__init__.py +0 -0
  54. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/stores/store.py +0 -0
  55. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/tools/__init__.py +0 -0
  56. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/tools/adapters.py +0 -0
  57. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/tools/docstring_parser.py +0 -0
  58. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/tools/func_metadata.py +0 -0
  59. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/tools/manager.py +0 -0
  60. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/tools/registry.py +0 -0
  61. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/tools/tools.py +0 -0
  62. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/types.py +0 -0
  63. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/__init__.py +0 -0
  64. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/common.py +0 -0
  65. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/installation.py +0 -0
  66. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/openapi/__inti__.py +0 -0
  67. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/openapi/api_generator.py +0 -0
  68. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/openapi/api_splitter.py +0 -0
  69. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/openapi/cli.py +0 -0
  70. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/openapi/docgen.py +0 -0
  71. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/openapi/filters.py +0 -0
  72. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/openapi/openapi.py +0 -0
  73. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/openapi/postprocessor.py +0 -0
  74. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/openapi/preprocessor.py +0 -0
  75. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/openapi/readme.py +0 -0
  76. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/openapi/test_generator.py +0 -0
  77. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/prompts.py +0 -0
  78. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/singleton.py +0 -0
  79. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/templates/README.md.j2 +0 -0
  80. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/templates/api_client.py.j2 +0 -0
  81. {universal_mcp-0.1.24rc3 → universal_mcp-0.1.24rc4}/src/universal_mcp/utils/testing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: universal-mcp
3
- Version: 0.1.24rc3
3
+ Version: 0.1.24rc4
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
@@ -8,7 +8,7 @@ License-File: LICENSE
8
8
  Requires-Python: >=3.11
9
9
  Requires-Dist: black>=25.1.0
10
10
  Requires-Dist: cookiecutter>=2.6.0
11
- Requires-Dist: gql[all]>=3.5.2
11
+ Requires-Dist: gql[all]==4.0.0
12
12
  Requires-Dist: jinja2>=3.1.3
13
13
  Requires-Dist: jsonref>=1.1.0
14
14
  Requires-Dist: keyring>=25.6.0
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "universal-mcp"
7
- version = "0.1.24-rc3"
7
+ version = "0.1.24-rc4"
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 = [
@@ -16,7 +16,7 @@ dependencies = [
16
16
  "Jinja2>=3.1.3",
17
17
  "black>=25.1.0",
18
18
  "cookiecutter>=2.6.0",
19
- "gql[all]>=3.5.2",
19
+ "gql[all]==4.0.0",
20
20
  "jsonref>=1.1.0",
21
21
  "keyring>=25.6.0",
22
22
  "langchain-mcp-adapters>=0.1.9",
@@ -0,0 +1,201 @@
1
+ # AgentR Python SDK
2
+
3
+ The official Python SDK for the AgentR platform, a component of the Universal MCP framework.
4
+ Currently in beta, breaking changes are expected.
5
+
6
+ The AgentR Python SDK provides convenient access to the AgentR REST API from any Python 3.10+
7
+ application, allowing for dynamic loading and management of tools and integrations.
8
+
9
+ ## Installation
10
+ ```bash
11
+ pip install universal-mcp
12
+ ```
13
+
14
+ ## Usage
15
+ The AgentR platform is designed to seamlessly integrate a wide array of tools into your agentic applications. The primary entry point for this is the `Agentr` class, which provides a high-level interface for loading and listing tools.
16
+
17
+ ### High-Level Client (`Agentr`)
18
+ This is the recommended way to get started. It abstracts away the details of the registry and tool management.
19
+
20
+ ```python
21
+ import os
22
+ from universal_mcp.agentr import Agentr
23
+ from universal_mcp.tools import ToolFormat
24
+
25
+ # Initialize the main client
26
+ # It reads from environment variables by default (AGENTR_API_KEY, AGENTR_BASE_URL)
27
+ agentr = Agentr(
28
+ api_key=os.environ.get("AGENTR_API_KEY")
29
+ )
30
+
31
+ # Load specific tools from the AgentR server into the tool manager
32
+ agentr.load_tools(["reddit_search_subreddits", "google_drive_list_files"])
33
+
34
+ # List the tools that are now loaded and ready to be used
35
+ # You can specify a format compatible with your LLM (e.g., OPENAI)
36
+ tools = agentr.list_tools(format=ToolFormat.OPENAI)
37
+ print(tools)
38
+ ```
39
+
40
+ ### Low-Level API
41
+
42
+ For more granular control over the AgentR platform, you can use the lower-level components directly.
43
+
44
+ ### AgentrClient
45
+ The `AgentrClient` provides direct access to the AgentR REST API endpoints.
46
+
47
+ #### Methods
48
+ ```python
49
+ import os
50
+ from universal_mcp.agentr import AgentrClient
51
+ from universal_mcp.exceptions import NotAuthorizedError
52
+
53
+ # Initialize the low-level client
54
+ client = AgentrClient(
55
+ api_key=os.environ.get("AGENTR_API_KEY")
56
+ )
57
+
58
+ # Fetch all available applications from the AgentR server
59
+ apps = client.fetch_apps()
60
+ print(apps)
61
+
62
+ # Get credentials for a specific integration
63
+ # This will raise a NotAuthorizedError if the user needs to authenticate
64
+ try:
65
+ credentials = client.get_credentials("reddit")
66
+ print("Reddit credentials found.")
67
+ except NotAuthorizedError as e:
68
+ print(e) # "Please ask the user to visit the following url to authorize..."
69
+
70
+ # Example of fetching a single app and its actions
71
+ if apps:
72
+ app_id = apps[0].id # Assuming AppConfig has an 'id' attribute
73
+
74
+ # Fetch a single app's configuration
75
+ app_config = client.fetch_app(app_id)
76
+ print(f"Fetched config for app {app_id}:", app_config)
77
+
78
+ # List all actions for that app
79
+ actions = client.list_actions(app_id)
80
+ print(f"Actions for app {app_id}:", actions)
81
+
82
+ # List all apps (returns raw JSON data)
83
+ all_apps = client.list_all_apps()
84
+ print("All available apps:", all_apps)
85
+ ```
86
+
87
+ ### AgentrIntegration
88
+ This class handles the authentication and authorization flow for a single integration (e.g., "reddit"). It's used under the hood by applications to acquire credentials.
89
+
90
+ #### Methods
91
+ ```python
92
+ from universal_mcp.agentr import AgentrIntegration, AgentrClient
93
+ from universal_mcp.exceptions import NotAuthorizedError
94
+
95
+ client = AgentrClient()
96
+
97
+ # Create an integration for a specific service
98
+ reddit_integration = AgentrIntegration(name="reddit", client=client)
99
+
100
+ # If credentials are not present, this will raise NotAuthorizedError
101
+ try:
102
+ creds = reddit_integration.credentials
103
+ print("Successfully retrieved credentials.")
104
+ except NotAuthorizedError:
105
+ # Get the URL to send the user to for authentication
106
+ auth_url = reddit_integration.authorize()
107
+ print(f"Please authorize here: {auth_url}")
108
+
109
+ # You can also use the get_credentials() method
110
+ try:
111
+ creds = reddit_integration.get_credentials()
112
+ print("Successfully retrieved credentials again.")
113
+ except NotAuthorizedError:
114
+ print("Still not authorized.")
115
+ ```
116
+
117
+ ### AgentrRegistry
118
+ The registry is responsible for discovering which tools are available on the AgentR platform.
119
+
120
+ #### Methods
121
+ ```python
122
+ import asyncio
123
+ from universal_mcp.agentr import AgentrRegistry, AgentrClient
124
+
125
+ client = AgentrClient()
126
+ registry = AgentrRegistry(client=client)
127
+
128
+ async def main():
129
+ # List all apps available on the AgentR platform
130
+ available_apps = await registry.list_apps()
131
+ print(available_apps)
132
+
133
+ if available_apps:
134
+ app_id = available_apps[0]['id']
135
+ # Get details for a specific app
136
+ app_details = await registry.get_app_details(app_id)
137
+ print(f"Details for {app_id}:", app_details)
138
+
139
+ # The load_tools method is used internally by the high-level Agentr client
140
+ # but can be called directly if needed.
141
+ # from universal_mcp.tools import ToolManager
142
+ # tool_manager = ToolManager()
143
+ # registry.load_tools(["reddit_search_subreddits"], tool_manager)
144
+ # print(tool_manager.list_tools())
145
+
146
+
147
+ if __name__ == "__main__":
148
+ asyncio.run(main())
149
+ ```
150
+
151
+ ### AgentrServer
152
+ For server-side deployments, `AgentrServer` can be used to load all configured applications and their tools from an AgentR instance on startup.
153
+
154
+ ```python
155
+ from universal_mcp.config import ServerConfig
156
+ from universal_mcp.agentr.server import AgentrServer
157
+
158
+ # Configuration for the server
159
+ config = ServerConfig(
160
+ type="agentr",
161
+ api_key="your-agentr-api-key"
162
+ )
163
+
164
+ # The server will automatically fetch and register all tools on initialization
165
+ server = AgentrServer(config=config)
166
+
167
+ # The tool manager is now populated with tools from the AgentR instance
168
+ tool_manager = server.tool_manager
169
+ print(tool_manager.list_tools())
170
+ ```
171
+
172
+ ## Executing Tools
173
+ Once tools are loaded, you can execute them using the `call_tool` method on the `ToolManager` instance, which is available via `agentr.manager`.
174
+
175
+ ```python
176
+ import os
177
+ import asyncio
178
+ from universal_mcp.agentr import Agentr
179
+
180
+ async def main():
181
+ # 1. Initialize Agentr
182
+ agentr = Agentr(api_key=os.environ.get("AGENTR_API_KEY"))
183
+
184
+ # 2. Load the tool(s) you want to use
185
+ tool_name = "reddit_search_subreddits"
186
+ agentr.load_tools([tool_name])
187
+
188
+ # 3. Execute the tool using the tool manager
189
+ try:
190
+ # Note the 'await' since call_tool is an async method
191
+ result = await agentr.manager.call_tool(
192
+ name=tool_name,
193
+ arguments={"query": "elon musk", "limit": 5, "sort": "relevance"}
194
+ )
195
+ print("Execution result:", result)
196
+ except Exception as e:
197
+ print(f"An error occurred: {e}")
198
+
199
+ if __name__ == "__main__":
200
+ asyncio.run(main())
201
+ ```