Skip to content

Commit 9e9c2b0

Browse files
committed
refactor(bootstrap): add CLI entry point support
1 parent 2cec71f commit 9e9c2b0

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ dev = [
3232
[project.entry-points."mcpstack.tools"]
3333
your_tool_name = "mcpstack_your_tool_name.tool:YourTool"
3434

35+
# Let MCPStack discover tool-specific CLIs (mounted by the mother library)
36+
[project.entry-points."mcpstack.tool_clis"]
37+
your_tool_name = "mcpstack_your_tool_name.cli:YourToolCLI.get_app"
38+
3539
[tool.ruff]
3640
line-length = 88
3741
target-version = "py310"

scripts/bootstrap.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,13 @@ def doctor() -> None:
600600
pkg_dirs = [p for p in (SRC).glob("mcpstack_*") if p.is_dir()]
601601
rows.append(("Package dirs", ", ".join(p.name for p in pkg_dirs) or "(none)"))
602602
pt = (TEMPLATE_ROOT / "pyproject.toml").read_text(encoding="utf-8")
603-
ep_ok = '[project.entry-points."mcpstack.tools"]' in pt
604-
rows.append(("Entry point", "present" if ep_ok else "missing"))
603+
604+
# Check both entry-point groups
605+
ep_tools_ok = '[project.entry-points."mcpstack.tools"]' in pt
606+
ep_clis_ok = '[project.entry-points."mcpstack.tool_clis"]' in pt
607+
rows.append(("Entry point (tools)", "present" if ep_tools_ok else "missing"))
608+
rows.append(("Entry point (tool_clis)", "present" if ep_clis_ok else "missing"))
609+
605610
ph = [f"{k} → `{v}`" for k, v in PLACEHOLDERS.items()]
606611
rows.append(("Placeholders", "; ".join(ph)))
607612

scripts/scaffold/pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ dev = [
3232
[project.entry-points."mcpstack.tools"]
3333
your_tool_name = "mcpstack_your_tool_name.tool:YourTool"
3434

35+
# Let MCPStack discover tool-specific CLIs (mounted by the mother library)
36+
[project.entry-points."mcpstack.tool_clis"]
37+
your_tool_name = "mcpstack_your_tool_name.cli:YourToolCLI.get_app"
38+
3539
[tool.ruff]
3640
line-length = 88
3741
target-version = "py310"
@@ -46,4 +50,4 @@ testpaths = ["tests"]
4650
python_files = ["test_*.py"]
4751

4852
[tool.uv.sources]
49-
mcpstack = { path = "../MCPStack" }
53+
mcpstack = { path = "../../MCPStack" }

0 commit comments

Comments
 (0)