mcp2cli 2.6.0__tar.gz → 2.7.0__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.
- {mcp2cli-2.6.0 → mcp2cli-2.7.0}/PKG-INFO +1 -1
- {mcp2cli-2.6.0 → mcp2cli-2.7.0}/pyproject.toml +1 -1
- {mcp2cli-2.6.0 → mcp2cli-2.7.0}/src/mcp2cli/__init__.py +38 -5
- {mcp2cli-2.6.0 → mcp2cli-2.7.0}/README.md +0 -0
- {mcp2cli-2.6.0 → mcp2cli-2.7.0}/src/mcp2cli/__main__.py +0 -0
- {mcp2cli-2.6.0 → mcp2cli-2.7.0}/src/mcp2cli/py.typed +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
__version__ = "2.
|
|
5
|
+
__version__ = "2.7.0"
|
|
6
6
|
|
|
7
7
|
import argparse
|
|
8
8
|
import copy
|
|
@@ -481,6 +481,7 @@ def build_oauth_provider(
|
|
|
481
481
|
*,
|
|
482
482
|
client_id: str | None = None,
|
|
483
483
|
client_secret: str | None = None,
|
|
484
|
+
client_name: str = "mcp2cli",
|
|
484
485
|
scope: str | None = None,
|
|
485
486
|
redirect_uri: str | None = None,
|
|
486
487
|
flow: str = "auto",
|
|
@@ -559,6 +560,7 @@ def build_oauth_provider(
|
|
|
559
560
|
redirect_uri = f"http://127.0.0.1:{port}/callback"
|
|
560
561
|
|
|
561
562
|
client_metadata = OAuthClientMetadata(
|
|
563
|
+
client_name=client_name,
|
|
562
564
|
redirect_uris=[redirect_uri],
|
|
563
565
|
grant_types=["authorization_code", "refresh_token"],
|
|
564
566
|
response_types=["code"],
|
|
@@ -1481,6 +1483,8 @@ def _baked_to_argv(config: dict) -> list[str]:
|
|
|
1481
1483
|
argv += ["--oauth-client-id", config["oauth_client_id"]]
|
|
1482
1484
|
if config.get("oauth_client_secret"):
|
|
1483
1485
|
argv += ["--oauth-client-secret", config["oauth_client_secret"]]
|
|
1486
|
+
if config.get("oauth_client_name") and config["oauth_client_name"] != "mcp2cli":
|
|
1487
|
+
argv += ["--oauth-client-name", config["oauth_client_name"]]
|
|
1484
1488
|
if config.get("oauth_scope"):
|
|
1485
1489
|
argv += ["--oauth-scope", config["oauth_scope"]]
|
|
1486
1490
|
if config.get("oauth_redirect_uri"):
|
|
@@ -1499,9 +1503,17 @@ _BAKE_NAME_RE = re.compile(r"^[a-z][a-z0-9-]*$")
|
|
|
1499
1503
|
|
|
1500
1504
|
def _handle_bake(argv: list[str]) -> None:
|
|
1501
1505
|
"""Dispatch bake subcommands."""
|
|
1502
|
-
if not argv:
|
|
1503
|
-
print("Usage: mcp2cli bake <
|
|
1504
|
-
|
|
1506
|
+
if not argv or argv[0] in ("-h", "--help"):
|
|
1507
|
+
print("Usage: mcp2cli bake <command> [options]\n")
|
|
1508
|
+
print("Commands:")
|
|
1509
|
+
print(" create Save connection settings as a named baked tool")
|
|
1510
|
+
print(" list List all baked tools")
|
|
1511
|
+
print(" show Show config for a baked tool (secrets masked)")
|
|
1512
|
+
print(" remove Delete a baked tool")
|
|
1513
|
+
print(" update Update settings on an existing baked tool")
|
|
1514
|
+
print(" install Create a ~/.local/bin wrapper script")
|
|
1515
|
+
print("\nRun 'mcp2cli bake <command> --help' for command-specific help.")
|
|
1516
|
+
sys.exit(0 if argv else 1)
|
|
1505
1517
|
sub = argv[0]
|
|
1506
1518
|
rest = argv[1:]
|
|
1507
1519
|
dispatch = {
|
|
@@ -1533,6 +1545,7 @@ def _bake_create(argv: list[str]) -> None:
|
|
|
1533
1545
|
p.add_argument("--oauth", action="store_true")
|
|
1534
1546
|
p.add_argument("--oauth-client-id", default=None)
|
|
1535
1547
|
p.add_argument("--oauth-client-secret", default=None)
|
|
1548
|
+
p.add_argument("--oauth-client-name", default="mcp2cli")
|
|
1536
1549
|
p.add_argument("--oauth-scope", default=None)
|
|
1537
1550
|
p.add_argument("--oauth-redirect-uri", default=None, metavar="URI")
|
|
1538
1551
|
p.add_argument(
|
|
@@ -1598,6 +1611,7 @@ def _bake_create(argv: list[str]) -> None:
|
|
|
1598
1611
|
"oauth": args.oauth,
|
|
1599
1612
|
"oauth_client_id": args.oauth_client_id,
|
|
1600
1613
|
"oauth_client_secret": args.oauth_client_secret,
|
|
1614
|
+
"oauth_client_name": args.oauth_client_name,
|
|
1601
1615
|
"oauth_scope": args.oauth_scope,
|
|
1602
1616
|
"oauth_redirect_uri": args.oauth_redirect_uri,
|
|
1603
1617
|
"oauth_flow": args.oauth_flow,
|
|
@@ -3068,7 +3082,19 @@ def main():
|
|
|
3068
3082
|
|
|
3069
3083
|
def _build_main_parser() -> argparse.ArgumentParser:
|
|
3070
3084
|
"""Build the global ArgumentParser for _main_impl."""
|
|
3071
|
-
pre = argparse.ArgumentParser(
|
|
3085
|
+
pre = argparse.ArgumentParser(
|
|
3086
|
+
add_help=False,
|
|
3087
|
+
allow_abbrev=False,
|
|
3088
|
+
epilog=(
|
|
3089
|
+
"subcommands:\n"
|
|
3090
|
+
" bake Manage baked tool configurations\n"
|
|
3091
|
+
" (create, list, show, remove, update, install)\n"
|
|
3092
|
+
" @<name> Run a previously baked tool\n"
|
|
3093
|
+
"\n"
|
|
3094
|
+
"Run 'mcp2cli bake --help' for bake subcommand details."
|
|
3095
|
+
),
|
|
3096
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
3097
|
+
)
|
|
3072
3098
|
pre.add_argument("--spec", default=None, help="OpenAPI spec URL or file path")
|
|
3073
3099
|
pre.add_argument("--mcp", default=None, help="MCP server URL (HTTP/SSE)")
|
|
3074
3100
|
pre.add_argument("--mcp-stdio", default=None, help="MCP server command (stdio)")
|
|
@@ -3161,6 +3187,12 @@ def _build_main_parser() -> argparse.ArgumentParser:
|
|
|
3161
3187
|
default=None,
|
|
3162
3188
|
help="OAuth client secret — supports env:VAR and file:/path prefixes",
|
|
3163
3189
|
)
|
|
3190
|
+
pre.add_argument(
|
|
3191
|
+
"--oauth-client-name",
|
|
3192
|
+
default="mcp2cli",
|
|
3193
|
+
help="Client name sent during OAuth Dynamic Client Registration (default: mcp2cli). "
|
|
3194
|
+
"Some servers require a specific client name for DCR to succeed.",
|
|
3195
|
+
)
|
|
3164
3196
|
pre.add_argument(
|
|
3165
3197
|
"--oauth-scope",
|
|
3166
3198
|
default=None,
|
|
@@ -3309,6 +3341,7 @@ def _setup_oauth(pre_args):
|
|
|
3309
3341
|
server_url,
|
|
3310
3342
|
client_id=client_id,
|
|
3311
3343
|
client_secret=client_secret,
|
|
3344
|
+
client_name=getattr(pre_args, "oauth_client_name", "mcp2cli"),
|
|
3312
3345
|
scope=pre_args.oauth_scope,
|
|
3313
3346
|
redirect_uri=pre_args.oauth_redirect_uri,
|
|
3314
3347
|
flow=flow,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|