Skip to content

Commit b98a5e9

Browse files
committed
v0.5.1 — gate show_reasoning behind opt-in flag
reasoning_content blocks can be large; default to off on advise tool and CLI (--show-reasoning to enable). Matches original spec intent.
1 parent 3bc3991 commit b98a5e9

4 files changed

Lines changed: 23 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "deepseek-mcp"
7-
version = "0.5.0"
7+
version = "0.5.1"
88
description = "A tiny MCP stdio server that exposes DeepSeek as a Claude/Codex tool."
99
readme = "README.md"
1010
requires-python = ">=3.10"

src/deepseek_mcp/__main__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ def main() -> None:
3333
advise_parser.add_argument(
3434
"--effort", choices=["medium", "high", "max"], default="max",
3535
)
36+
advise_parser.add_argument(
37+
"--show-reasoning", action="store_true",
38+
help="Include <reasoning> block from thinking mode in output",
39+
)
3640

3741
args = parser.parse_args()
3842

@@ -81,7 +85,12 @@ def _cmd_advise(args: argparse.Namespace) -> None:
8185
sys.exit(2)
8286

8387
from deepseek_mcp.server import call_advisor
84-
call_args = {"prompt": args.prompt, "effort": args.effort, "system": None}
88+
call_args = {
89+
"prompt": args.prompt,
90+
"effort": args.effort,
91+
"system": None,
92+
"show_reasoning": args.show_reasoning,
93+
}
8594
result = call_advisor(call_args)
8695
print(result)
8796

src/deepseek_mcp/server.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
PROTOCOL_VERSION = "2024-11-05"
1616
SERVER_NAME = "deepseek-mcp"
17-
SERVER_VERSION = "0.5.0"
17+
SERVER_VERSION = "0.5.1"
1818

1919
PRICING: dict[str, dict[str, float]] = {
2020
"deepseek-v4-flash": {"in": 0.14, "out": 0.28},
@@ -146,6 +146,15 @@ def _log_call(entry: dict[str, Any]) -> None:
146146
"medium: lighter thinking, quicker (~30s)."
147147
),
148148
},
149+
"show_reasoning": {
150+
"type": "boolean",
151+
"default": False,
152+
"description": (
153+
"If true, prepend a <reasoning>...</reasoning> block "
154+
"with the model's chain-of-thought. Off by default to "
155+
"keep responses compact — reasoning_content can be large."
156+
),
157+
},
149158
},
150159
"required": ["prompt"],
151160
},
@@ -242,7 +251,7 @@ def call_advisor(args: dict[str, Any], progress_token: Any = None) -> str:
242251
"latency_s": round(time.time() - started_at, 2),
243252
"cost_usd": round(cost, 6) if cost else None,
244253
})
245-
if reasoning_text:
254+
if reasoning_text and args.get("show_reasoning"):
246255
result = f"<reasoning>\n{reasoning_text}\n</reasoning>\n\n{result}"
247256
return result
248257

tests/test_protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_initialize_response():
1515
assert response["id"] == 1
1616
assert response["result"]["protocolVersion"] == "2024-11-05"
1717
assert response["result"]["serverInfo"]["name"] == "deepseek-mcp"
18-
assert response["result"]["serverInfo"]["version"] == "0.5.0"
18+
assert response["result"]["serverInfo"]["version"] == "0.5.1"
1919
assert response["result"]["serverInfo"]["apiKey"] in ("set", "missing")
2020

2121

0 commit comments

Comments
 (0)