ping
Checks if the DeepSeek MCP server is alive, returning version and configuration status. Use before delegating tasks to ensure the server is ready.
Instructions
Health check. Confirms the deepseek-mcp server is alive.
Use this before delegate_to_deepseek if you're not sure whether DeepSeek is configured. Returns version, mode (auto/off), and whether config is loadable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/deepseek_mcp/server.py:67-67 (registration)Registers the 'ping' tool via the @mcp.tool() decorator.
@mcp.tool() - src/deepseek_mcp/server.py:67-81 (handler)The ping tool handler: health-check that returns version, mode (auto/off), and config status.
@mcp.tool() def ping() -> str: """Health check. Confirms the deepseek-mcp server is alive. Use this before delegate_to_deepseek if you're not sure whether DeepSeek is configured. Returns version, mode (auto/off), and whether config is loadable. """ mode = os.getenv("DEEPSEEK_MODE", "auto") try: cfg = Config.load() ws_short = _shorten_path(cfg.workspace) config_status = f"workspace={ws_short} (sandbox), model={cfg.model}" except Exception as e: config_status = f"NOT_CONFIGURED ({e})" return f"pong from deepseek-mcp v{__version__} | mode={mode} | {config_status}" - src/deepseek_mcp/server.py:84-94 (helper)Helper that shortens paths for display in the ping response (avoids overly long output).
def _shorten_path(p: Path) -> str: """长路径压成 ~ + 最后几段,避免 ping 输出爆屏。""" s = str(p) home = str(Path.home()) if s.startswith(home): s = "~" + s[len(home):] if len(s) > 60: parts = s.split("/") if len(parts) > 4: s = "/".join(parts[:2] + ["..."] + parts[-2:]) return s - src/deepseek_mcp/server.py:67-81 (schema)Ping has no parameters and returns a string — the schema is implicitly defined by the FastMCP decorator and the function signature.
@mcp.tool() def ping() -> str: """Health check. Confirms the deepseek-mcp server is alive. Use this before delegate_to_deepseek if you're not sure whether DeepSeek is configured. Returns version, mode (auto/off), and whether config is loadable. """ mode = os.getenv("DEEPSEEK_MODE", "auto") try: cfg = Config.load() ws_short = _shorten_path(cfg.workspace) config_status = f"workspace={ws_short} (sandbox), model={cfg.model}" except Exception as e: config_status = f"NOT_CONFIGURED ({e})" return f"pong from deepseek-mcp v{__version__} | mode={mode} | {config_status}"