Skip to content

Commit eacd83c

Browse files
fix: remove duplicate mcp() function in cli.py (#31)
PR #30 (squash-merged) reintroduced an old mcp() implementation alongside the new one (added in commit a9f3d55). The old mcp() used click_to_mcp directly, while the new mcp() uses run_for_app from the .mcp_server module. Python silently shadowed the first mcp() with the second, so tests passed and the CLI worked, but having two definitions of the same function is a code smell that could cause confusion or future bugs. This commit removes the first (old) mcp() and keeps the newer implementation that uses the project's mcp_server abstraction. Verified: 108/108 tests pass
1 parent a6ff6e2 commit eacd83c

1 file changed

Lines changed: 0 additions & 14 deletions

File tree

src/deploydiff/cli.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,6 @@ def rollback(terraform_file, cloudformation_file, pulumi_file) -> None:
114114
console.print(cmd)
115115

116116

117-
@main.command()
118-
def mcp():
119-
"""Run as an MCP (Model Context Protocol) server over stdio.
120-
121-
AI coding agents (Claude Code, Cursor, etc.) use this to interact
122-
with deploydiff tools directly.
123-
"""
124-
try:
125-
from click_to_mcp import serve_stdio
126-
except ImportError:
127-
click.echo("Error: click-to-mcp is required for MCP support. Install with: pip install click-to-mcp", err=True)
128-
raise SystemExit(1) from None
129-
serve_stdio(main, name="deploydiff")
130-
131117

132118
def _load_plan(
133119
terraform_file: str | None,

0 commit comments

Comments
 (0)