universal-mcp 0.1.13rc3__py3-none-any.whl → 0.1.13rc14__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.
@@ -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.13rc3
3
+ Version: 0.1.13rc14
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,38 +1,39 @@
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=kJwUvIG3RJQ62wiZaf8qgO_N7Gnrye7kH5BBOCDXeaQ,8212
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=7rghGqPTKDqpzjYo7JshagaAEyU8CcLaQ07TjwM4TTU,2808
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
- universal_mcp/integrations/__init__.py,sha256=fx0dn79M1YhCwxtDy5QKrqtez2fbowhfJtQeWCLm1wU,922
11
+ universal_mcp/integrations/__init__.py,sha256=tg6Yk59AEhwPsrTp0hZQ3NBfmJuYGu2sNCOXuph-h9k,922
12
12
  universal_mcp/integrations/integration.py,sha256=genBiaWuzCs-XCf3UD1j8PQYyGU3GiVO4uupSdJRHnA,12601
13
13
  universal_mcp/servers/README.md,sha256=ytFlgp8-LO0oogMrHkMOp8SvFTwgsKgv7XhBVZGNTbM,2284
14
14
  universal_mcp/servers/__init__.py,sha256=dDtvvMzbWskABlobTZHztrWMb3hbzgidza3BmEmIAD8,474
15
- universal_mcp/servers/server.py,sha256=j_WreQSSed-e_QFFffsuQxhr7XDexiR5Cls50qkdX-g,9439
15
+ universal_mcp/servers/server.py,sha256=0oJQQUiwPdG2q79tzsVv3WPMV5YIFbF14PRvBF-SxMQ,9395
16
16
  universal_mcp/stores/README.md,sha256=jrPh_ow4ESH4BDGaSafilhOVaN8oQ9IFlFW-j5Z5hLA,2465
17
17
  universal_mcp/stores/__init__.py,sha256=quvuwhZnpiSLuojf0NfmBx2xpaCulv3fbKtKaSCEmuM,603
18
- universal_mcp/stores/store.py,sha256=eaS2S2V0pg-9qj5gUup0de7RY1lW8GglA-isJdeg6l8,6898
18
+ universal_mcp/stores/store.py,sha256=lYaFd-9YKC404BPeqzNw_Xm3ziQjksZyvQtaW1yd9FM,6900
19
19
  universal_mcp/templates/README.md.j2,sha256=gNry-IrGUdumhgWyHFVxOKgXf_MR4RFK6SI6jF3Tuns,2564
20
20
  universal_mcp/templates/api_client.py.j2,sha256=972Im7LNUAq3yZTfwDcgivnb-b8u6_JLKWXwoIwXXXQ,908
21
21
  universal_mcp/tools/README.md,sha256=RuxliOFqV1ZEyeBdj3m8UKfkxAsfrxXh-b6V4ZGAk8I,2468
22
22
  universal_mcp/tools/__init__.py,sha256=hVL-elJLwD_K87Gpw_s2_o43sQRPyRNOnxlzt0_Pfn8,72
23
23
  universal_mcp/tools/adapters.py,sha256=2HvpyFiI0zg9dp0XshnG7t6KrVqFHM7hgtmgY1bsHN0,927
24
24
  universal_mcp/tools/func_metadata.py,sha256=f_5LdDNsOu1DpXvDUeZYiJswVmwGZz6IMPtpJJ5B2-Y,7975
25
- universal_mcp/tools/tools.py,sha256=Q1MoYSjKCBnQNv-lFWwbXzrYrVaVp-69bzLLOE5GyrE,12919
25
+ universal_mcp/tools/tools.py,sha256=9YzFbX0YHdz7RrVyKKBx-eyFEnYD4HPoUVtSAftgdk4,12889
26
26
  universal_mcp/utils/__init__.py,sha256=8wi4PGWu-SrFjNJ8U7fr2iFJ1ktqlDmSKj1xYd7KSDc,41
27
- universal_mcp/utils/agentr.py,sha256=RkKDbOu5M2q-_3jSQcTqI1vQdTCsidJri5QufzyUD20,3410
28
- universal_mcp/utils/api_generator.py,sha256=bs7BTuEKWz9FNb49BofsLP29BHL3B0PRCtBaKLXoR0A,7949
29
- universal_mcp/utils/docgen.py,sha256=yGBcBIr7dz3mNMGrCb_-JFsDf-ShmCKWWiPpuEj2SIU,21878
27
+ universal_mcp/utils/agentr.py,sha256=3sobve7Odk8pIAZm3RHTX4Rc21rkBClcXQgXXslbSUA,3490
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
32
  universal_mcp/utils/installation.py,sha256=H6woSY5AljEy_m5KgiAlHtNfe8eygOu4ZXNs5Q4H_y4,10307
33
- universal_mcp/utils/openapi.py,sha256=Mojlihskv0xO0RGGhvjjFjVMBJEoRIcE1a2h_Tt9Ir0,15998
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.13rc3.dist-info/METADATA,sha256=goT3MkIrlpp_BRyvRONlf-SNrE4k_mX_tChpl4Bep1o,12805
36
- universal_mcp-0.1.13rc3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
37
- universal_mcp-0.1.13rc3.dist-info/entry_points.txt,sha256=QlBrVKmA2jIM0q-C-3TQMNJTTWOsOFQvgedBq2rZTS8,56
38
- universal_mcp-0.1.13rc3.dist-info/RECORD,,
36
+ universal_mcp-0.1.13rc14.dist-info/METADATA,sha256=2lpAZEt7uenPEs6meQ9c4kE65jno2gcWcIVZCHuxbxk,9804
37
+ universal_mcp-0.1.13rc14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
38
+ universal_mcp-0.1.13rc14.dist-info/entry_points.txt,sha256=QlBrVKmA2jIM0q-C-3TQMNJTTWOsOFQvgedBq2rZTS8,56
39
+ universal_mcp-0.1.13rc14.dist-info/RECORD,,