universal-mcp 0.1.13rc7__py3-none-any.whl → 0.1.14__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/applications/__init__.py +12 -2
- universal_mcp/cli.py +27 -11
- universal_mcp/utils/api_generator.py +3 -93
- universal_mcp/utils/docgen.py +2 -2
- universal_mcp/utils/installation.py +8 -8
- universal_mcp/utils/openapi.py +523 -297
- universal_mcp/utils/readme.py +92 -0
- {universal_mcp-0.1.13rc7.dist-info → universal_mcp-0.1.14.dist-info}/METADATA +2 -53
- {universal_mcp-0.1.13rc7.dist-info → universal_mcp-0.1.14.dist-info}/RECORD +11 -10
- {universal_mcp-0.1.13rc7.dist-info → universal_mcp-0.1.14.dist-info}/WHEEL +0 -0
- {universal_mcp-0.1.13rc7.dist-info → universal_mcp-0.1.14.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,92 @@
|
|
1
|
+
import importlib
|
2
|
+
from pathlib import Path
|
3
|
+
|
4
|
+
from jinja2 import Environment, FileSystemLoader, TemplateError, select_autoescape
|
5
|
+
from loguru import logger
|
6
|
+
|
7
|
+
|
8
|
+
def _import_class(module_path: str, class_name: str):
|
9
|
+
"""
|
10
|
+
Helper to import a class by name from a module.
|
11
|
+
Raises ModuleNotFoundError if module or class does not exist.
|
12
|
+
"""
|
13
|
+
try:
|
14
|
+
spec = importlib.util.spec_from_file_location("temp_module", module_path)
|
15
|
+
module = importlib.util.module_from_spec(spec)
|
16
|
+
spec.loader.exec_module(module)
|
17
|
+
except ModuleNotFoundError as e:
|
18
|
+
logger.debug(f"Import failed for module '{module_path}': {e}")
|
19
|
+
raise
|
20
|
+
try:
|
21
|
+
return getattr(module, class_name)
|
22
|
+
except AttributeError as e:
|
23
|
+
logger.error(f"Class '{class_name}' not found in module '{module_path}'")
|
24
|
+
raise ModuleNotFoundError(
|
25
|
+
f"Class '{class_name}' not found in module '{module_path}'"
|
26
|
+
) from e
|
27
|
+
|
28
|
+
|
29
|
+
def generate_readme(app: Path, class_name: str) -> Path:
|
30
|
+
"""Generate README.md with API documentation.
|
31
|
+
|
32
|
+
Args:
|
33
|
+
app_dir: Directory where the README will be generated
|
34
|
+
folder_name: Name of the application folder
|
35
|
+
tools: List of Function objects from the OpenAPI schema
|
36
|
+
|
37
|
+
Returns:
|
38
|
+
Path to the generated README file
|
39
|
+
|
40
|
+
Raises:
|
41
|
+
FileNotFoundError: If the template directory doesn't exist
|
42
|
+
TemplateError: If there's an error rendering the template
|
43
|
+
IOError: If there's an error writing the README file
|
44
|
+
"""
|
45
|
+
|
46
|
+
# Import the app
|
47
|
+
app_instance = _import_class(app, class_name)(integration=None)
|
48
|
+
# List tools by calling list_tools()
|
49
|
+
tools = app_instance.list_tools()
|
50
|
+
# Format tools into (name, description) tuples
|
51
|
+
formatted_tools = []
|
52
|
+
for tool in tools:
|
53
|
+
name = tool.__name__
|
54
|
+
description = tool.__doc__.strip().split("\n")[0]
|
55
|
+
formatted_tools.append((name, description))
|
56
|
+
# Render the template
|
57
|
+
# Set up Jinja2 environment
|
58
|
+
template_dir = Path(__file__).parent.parent / "templates"
|
59
|
+
if not template_dir.exists():
|
60
|
+
logger.error(f"Template directory not found: {template_dir}")
|
61
|
+
raise FileNotFoundError(f"Template directory not found: {template_dir}")
|
62
|
+
|
63
|
+
try:
|
64
|
+
env = Environment(
|
65
|
+
loader=FileSystemLoader(template_dir), autoescape=select_autoescape()
|
66
|
+
)
|
67
|
+
template = env.get_template("README.md.j2")
|
68
|
+
except Exception as e:
|
69
|
+
logger.error(f"Error loading template: {e}")
|
70
|
+
raise TemplateError(f"Error loading template: {e}") from e
|
71
|
+
# Write the README file
|
72
|
+
try:
|
73
|
+
readme_content = template.render(name=class_name, tools=formatted_tools)
|
74
|
+
except Exception as e:
|
75
|
+
logger.error(f"Error rendering template: {e}")
|
76
|
+
raise TemplateError(f"Error rendering template: {e}") from e
|
77
|
+
|
78
|
+
# Write the README file
|
79
|
+
app_dir = app.parent
|
80
|
+
readme_file = app_dir / "README.md"
|
81
|
+
|
82
|
+
# Write the README file
|
83
|
+
readme_file = app_dir / "README.md"
|
84
|
+
try:
|
85
|
+
with open(readme_file, "w") as f:
|
86
|
+
f.write(readme_content)
|
87
|
+
logger.info(f"Documentation generated at: {readme_file}")
|
88
|
+
except Exception as e:
|
89
|
+
logger.error(f"Error writing README file: {e}")
|
90
|
+
raise OSError(f"Error writing README file: {e}") from e
|
91
|
+
|
92
|
+
return readme_file
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: universal-mcp
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.14
|
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
|
@@ -18,60 +18,9 @@ Requires-Dist: pydantic>=2.11.1
|
|
18
18
|
Requires-Dist: pyyaml>=6.0.2
|
19
19
|
Requires-Dist: rich>=14.0.0
|
20
20
|
Requires-Dist: typer>=0.15.2
|
21
|
-
Provides-Extra: all
|
22
|
-
Requires-Dist: langchain-mcp-adapters>=0.0.3; extra == 'all'
|
23
|
-
Requires-Dist: langchain-openai>=0.3.12; extra == 'all'
|
24
|
-
Requires-Dist: langgraph-checkpoint-sqlite>=2.0.6; extra == 'all'
|
25
|
-
Requires-Dist: langgraph>=0.3.24; extra == 'all'
|
26
|
-
Requires-Dist: litellm>=1.30.7; extra == 'all'
|
27
|
-
Requires-Dist: pyright>=1.1.398; extra == 'all'
|
28
|
-
Requires-Dist: pytest-asyncio>=0.26.0; extra == 'all'
|
29
|
-
Requires-Dist: pytest>=8.3.5; extra == 'all'
|
30
|
-
Requires-Dist: python-dotenv>=1.0.1; extra == 'all'
|
31
|
-
Requires-Dist: ruff>=0.11.4; extra == 'all'
|
32
|
-
Requires-Dist: streamlit>=1.44.1; extra == 'all'
|
33
|
-
Requires-Dist: watchdog>=6.0.0; extra == 'all'
|
34
|
-
Provides-Extra: applications
|
35
|
-
Requires-Dist: universal-mcp-ahrefs; extra == 'applications'
|
36
|
-
Requires-Dist: universal-mcp-cal-com-v2; extra == 'applications'
|
37
|
-
Requires-Dist: universal-mcp-calendly; extra == 'applications'
|
38
|
-
Requires-Dist: universal-mcp-clickup; extra == 'applications'
|
39
|
-
Requires-Dist: universal-mcp-coda; extra == 'applications'
|
40
|
-
Requires-Dist: universal-mcp-crustdata; extra == 'applications'
|
41
|
-
Requires-Dist: universal-mcp-e2b; extra == 'applications'
|
42
|
-
Requires-Dist: universal-mcp-elevenlabs; extra == 'applications'
|
43
|
-
Requires-Dist: universal-mcp-falai; extra == 'applications'
|
44
|
-
Requires-Dist: universal-mcp-figma; extra == 'applications'
|
45
|
-
Requires-Dist: universal-mcp-firecrawl; extra == 'applications'
|
46
|
-
Requires-Dist: universal-mcp-github; extra == 'applications'
|
47
|
-
Requires-Dist: universal-mcp-gong; extra == 'applications'
|
48
|
-
Requires-Dist: universal-mcp-google-calendar; extra == 'applications'
|
49
|
-
Requires-Dist: universal-mcp-google-docs; extra == 'applications'
|
50
|
-
Requires-Dist: universal-mcp-google-drive; extra == 'applications'
|
51
|
-
Requires-Dist: universal-mcp-google-mail; extra == 'applications'
|
52
|
-
Requires-Dist: universal-mcp-google-sheet; extra == 'applications'
|
53
|
-
Requires-Dist: universal-mcp-hashnode; extra == 'applications'
|
54
|
-
Requires-Dist: universal-mcp-heygen; extra == 'applications'
|
55
|
-
Requires-Dist: universal-mcp-mailchimp; extra == 'applications'
|
56
|
-
Requires-Dist: universal-mcp-markitdown; extra == 'applications'
|
57
|
-
Requires-Dist: universal-mcp-neon; extra == 'applications'
|
58
|
-
Requires-Dist: universal-mcp-notion; extra == 'applications'
|
59
|
-
Requires-Dist: universal-mcp-perplexity; extra == 'applications'
|
60
|
-
Requires-Dist: universal-mcp-reddit; extra == 'applications'
|
61
|
-
Requires-Dist: universal-mcp-replicate; extra == 'applications'
|
62
|
-
Requires-Dist: universal-mcp-resend; extra == 'applications'
|
63
|
-
Requires-Dist: universal-mcp-retell; extra == 'applications'
|
64
|
-
Requires-Dist: universal-mcp-rocketlane; extra == 'applications'
|
65
|
-
Requires-Dist: universal-mcp-serpapi; extra == 'applications'
|
66
|
-
Requires-Dist: universal-mcp-shortcut; extra == 'applications'
|
67
|
-
Requires-Dist: universal-mcp-spotify; extra == 'applications'
|
68
|
-
Requires-Dist: universal-mcp-supabase; extra == 'applications'
|
69
|
-
Requires-Dist: universal-mcp-tavily; extra == 'applications'
|
70
|
-
Requires-Dist: universal-mcp-wrike; extra == 'applications'
|
71
|
-
Requires-Dist: universal-mcp-youtube; extra == 'applications'
|
72
|
-
Requires-Dist: universal-mcp-zenquotes; extra == 'applications'
|
73
21
|
Provides-Extra: dev
|
74
22
|
Requires-Dist: litellm>=1.30.7; extra == 'dev'
|
23
|
+
Requires-Dist: pre-commit>=4.2.0; extra == 'dev'
|
75
24
|
Requires-Dist: pyright>=1.1.398; extra == 'dev'
|
76
25
|
Requires-Dist: pytest-asyncio>=0.26.0; extra == 'dev'
|
77
26
|
Requires-Dist: pytest>=8.3.5; extra == 'dev'
|
@@ -1,11 +1,11 @@
|
|
1
1
|
universal_mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
universal_mcp/analytics.py,sha256=aGCg0Okpcy06W70qCA9I8_ySOiCgAtzJAIWAdhBsOeA,2212
|
3
|
-
universal_mcp/cli.py,sha256=
|
3
|
+
universal_mcp/cli.py,sha256=aQioMc0ZpE5uL9h_qrk_eS514H0woQOsTsjEzL6Khto,8552
|
4
4
|
universal_mcp/config.py,sha256=sJaPI4q51CDPPG0z32rMJiE7a64eaa9nxbjJgYnaFA4,838
|
5
5
|
universal_mcp/exceptions.py,sha256=WApedvzArNujD0gZfUofYBxjQo97ZDJLqDibtLWZoRk,373
|
6
6
|
universal_mcp/logger.py,sha256=D947u1roUf6WqlcEsPpvmWDqGc8L41qF3MO1suK5O1Q,308
|
7
7
|
universal_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
universal_mcp/applications/__init__.py,sha256=
|
8
|
+
universal_mcp/applications/__init__.py,sha256=ZjV0P55Ej0vjIQ_bCSNatWTX-VphDJ6OGePWBu3bu3U,3196
|
9
9
|
universal_mcp/applications/application.py,sha256=0eC9D4HHRwIGpuFusaCxTZ0u64U68VbBpRSxjxGB5y8,8152
|
10
10
|
universal_mcp/integrations/README.md,sha256=lTAPXO2nivcBe1q7JT6PRa6v9Ns_ZersQMIdw-nmwEA,996
|
11
11
|
universal_mcp/integrations/__init__.py,sha256=tg6Yk59AEhwPsrTp0hZQ3NBfmJuYGu2sNCOXuph-h9k,922
|
@@ -25,14 +25,15 @@ universal_mcp/tools/func_metadata.py,sha256=f_5LdDNsOu1DpXvDUeZYiJswVmwGZz6IMPtp
|
|
25
25
|
universal_mcp/tools/tools.py,sha256=9YzFbX0YHdz7RrVyKKBx-eyFEnYD4HPoUVtSAftgdk4,12889
|
26
26
|
universal_mcp/utils/__init__.py,sha256=8wi4PGWu-SrFjNJ8U7fr2iFJ1ktqlDmSKj1xYd7KSDc,41
|
27
27
|
universal_mcp/utils/agentr.py,sha256=3sobve7Odk8pIAZm3RHTX4Rc21rkBClcXQgXXslbSUA,3490
|
28
|
-
universal_mcp/utils/api_generator.py,sha256=
|
29
|
-
universal_mcp/utils/docgen.py,sha256=
|
28
|
+
universal_mcp/utils/api_generator.py,sha256=x3LkJm3tXgl2qVQq-ZQW86w7IqbErEdFTfwBP3aOwyI,4763
|
29
|
+
universal_mcp/utils/docgen.py,sha256=zPmZ-b-fK6xk-dwHEx2hwShN-iquPD_O15CGuPwlj2k,21870
|
30
30
|
universal_mcp/utils/docstring_parser.py,sha256=j7aE-LLnBOPTJI0qXayf0NlYappzxICv5E_hUPNmAlc,11459
|
31
31
|
universal_mcp/utils/dump_app_tools.py,sha256=9bQePJ4ZKzGtcIYrBgLxbKDOZmL7ajIAHhXljT_AlyA,2041
|
32
|
-
universal_mcp/utils/installation.py,sha256=
|
33
|
-
universal_mcp/utils/openapi.py,sha256=
|
32
|
+
universal_mcp/utils/installation.py,sha256=1n5X_aIiuY8WNQn6Oji_gZ-aiRmNXxrg-qYRv-pGjxw,10195
|
33
|
+
universal_mcp/utils/openapi.py,sha256=GhUdSefVOrOFMw15ZAIaEma-XKu6ptHv65ds0g7ntBo,24924
|
34
|
+
universal_mcp/utils/readme.py,sha256=Q4E3RidWVg0ngYBGZCKcoA4eX6wlkCpvU-clU0E7Q20,3305
|
34
35
|
universal_mcp/utils/singleton.py,sha256=kolHnbS9yd5C7z-tzaUAD16GgI-thqJXysNi3sZM4No,733
|
35
|
-
universal_mcp-0.1.
|
36
|
-
universal_mcp-0.1.
|
37
|
-
universal_mcp-0.1.
|
38
|
-
universal_mcp-0.1.
|
36
|
+
universal_mcp-0.1.14.dist-info/METADATA,sha256=JAo05FMH7LppIZfg4WfPNwOZlMsiu5frf--u1y1llpI,9800
|
37
|
+
universal_mcp-0.1.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
38
|
+
universal_mcp-0.1.14.dist-info/entry_points.txt,sha256=QlBrVKmA2jIM0q-C-3TQMNJTTWOsOFQvgedBq2rZTS8,56
|
39
|
+
universal_mcp-0.1.14.dist-info/RECORD,,
|
File without changes
|
File without changes
|