Coverage for mcpgateway / tools / cli.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-02-11 07:10 +0000

1# -*- coding: utf-8 -*- 

2"""Location: ./mcpgateway/tools/cli.py 

3Copyright 2025 

4SPDX-License-Identifier: Apache-2.0 

5Authors: Teryl Taylor 

6 

7cforge CLI ─ command line tools for building and deploying the 

8MCP Gateway and its plugins. 

9 

10This module is exposed as a **console-script** via: 

11 

12 [project.scripts] 

13 cforge = "mcpgateway.tools.cli:main" 

14 

15so that a user can simply type `cforge ...` to use the CLI. 

16 

17Features 

18───────── 

19* plugin: 

20 - bootstrap: Creates a new plugin project from template │ 

21 - install: Installs plugins into a Python environment │ 

22 - package: Builds an MCP server to serve plugins as tools 

23* gateway: 

24 - Validates deploy.yaml configuration 

25 - Builds plugin containers from git repos 

26 - Generates mTLS certificates 

27 - Deploys to Kubernetes or Docker Compose 

28 - Integrates with CI/CD vault secrets 

29 

30 

31Typical usage 

32───────────── 

33```console 

34$ cforge --help 

35``` 

36""" 

37 

38# Third-Party 

39import typer 

40 

41# First-Party 

42import mcpgateway.plugins.tools.cli as plugins 

43import mcpgateway.tools.builder.cli as builder 

44 

45app = typer.Typer(help="Command line tools for building, deploying, and interacting with the ContextForge MCP Gateway") 

46 

47app.add_typer(plugins.app, name="plugin", help="Manage the plugin lifecycle") 

48app.add_typer(builder.app, name="gateway", help="Manage the building and deployment of the gateway") 

49 

50 

51def main() -> None: # noqa: D401 - imperative mood is fine here 

52 """Entry point for the *cforge* console script.""" 

53 app(obj={}) 

54 

55 

56if __name__ == "__main__": 

57 main()