Skip to content

Commit 3439591

Browse files
arizen-devclaude
andcommitted
v0.2.0: bake in epistemic honesty guard against quantitative fabrication
Add DEFAULT_SYSTEM_PROMPT injected into every call. DeepSeek invents plausible-sounding numbers (percentages, timeframes, ratios) when asked to be "concrete" without this guard. The prompt blocks fabrication at the server level so callers don't need to remember per-prompt fixes. The optional `system` parameter now appends after the default rather than replacing it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 251dd43 commit 3439591

2 files changed

Lines changed: 27 additions & 6 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.1.0"
7+
version = "0.2.0"
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/server.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,18 @@
1313

1414
PROTOCOL_VERSION = "2024-11-05"
1515
SERVER_NAME = "deepseek-mcp"
16-
SERVER_VERSION = "0.1.0"
16+
SERVER_VERSION = "0.2.0"
17+
18+
# Injected into every call. Guards against the confirmed failure mode where DeepSeek
19+
# invents plausible-sounding numbers when asked for "concrete" output.
20+
DEFAULT_SYSTEM_PROMPT = (
21+
"You are a precise assistant completing bounded tasks. "
22+
"Do not fabricate specific numbers, percentages, timeframes, durations, "
23+
"or statistics unless they appear verbatim in the input. "
24+
"When asked to be concrete or specific, use qualitative language "
25+
"rather than invented quantities. "
26+
"If you are uncertain about a fact, say so explicitly rather than guessing."
27+
)
1728

1829

1930
def api_client() -> OpenAI:
@@ -38,7 +49,14 @@ def api_client() -> OpenAI:
3849
"type": "object",
3950
"properties": {
4051
"prompt": {"type": "string", "description": "Task prompt"},
41-
"system": {"type": "string", "description": "Optional system prompt"},
52+
"system": {
53+
"type": "string",
54+
"description": (
55+
"Optional additional system instructions. "
56+
"Appended after the built-in epistemic honesty guard — "
57+
"do not repeat it."
58+
),
59+
},
4260
"model": {
4361
"type": "string",
4462
"default": "deepseek-v4-flash",
@@ -59,10 +77,13 @@ def api_client() -> OpenAI:
5977

6078

6179
def call_deepseek(args: dict[str, Any], progress_token: Any = None) -> str:
62-
messages: list[dict[str, str]] = []
80+
system_parts = [DEFAULT_SYSTEM_PROMPT]
6381
if args.get("system"):
64-
messages.append({"role": "system", "content": args["system"]})
65-
messages.append({"role": "user", "content": args["prompt"]})
82+
system_parts.append(args["system"])
83+
messages: list[dict[str, str]] = [
84+
{"role": "system", "content": "\n\n".join(system_parts)},
85+
{"role": "user", "content": args["prompt"]},
86+
]
6687

6788
model = args.get("model", "deepseek-v4-flash")
6889
started_at = time.time()

0 commit comments

Comments
 (0)