Skip to main content
Glama
HarshJ23

DeepSeek-Claude MCP Server

by HarshJ23

reason

Process queries using DeepSeek's R1 reasoning engine to generate structured analysis for Claude integration, handling complex multi-step reasoning tasks with precision.

Instructions

Process a query using DeepSeek's R1 reasoning engine and prepare it for integration with Claude.

DeepSeek R1 leverages advanced reasoning capabilities that naturally evolved from large-scale 
reinforcement learning, enabling sophisticated reasoning behaviors. The output is enclosed 
within `<ant_thinking>` tags to align with Claude's thought processing framework.

Args:
    query (dict): Contains the following keys:
        - context (str): Optional background information for the query.
        - question (str): The specific question to be analyzed.

Returns:
    str: The reasoning output from DeepSeek, formatted with `<ant_thinking>` tags for seamless use with Claude.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • server.py:61-88 (handler)
    The handler function for the 'reason' tool. It processes the input query dictionary, fetches reasoning from DeepSeek API using a helper function, formats the output with <ant_thinking> tags, and handles errors.
    @mcp.tool()
    async def reason(query: dict) -> str:
        """
        Process a query using DeepSeek's R1 reasoning engine and prepare it for integration with Claude.
    
        DeepSeek R1 leverages advanced reasoning capabilities that naturally evolved from large-scale 
        reinforcement learning, enabling sophisticated reasoning behaviors. The output is enclosed 
        within `<ant_thinking>` tags to align with Claude's thought processing framework.
    
        Args:
            query (dict): Contains the following keys:
                - context (str): Optional background information for the query.
                - question (str): The specific question to be analyzed.
    
        Returns:
            str: The reasoning output from DeepSeek, formatted with `<ant_thinking>` tags for seamless use with Claude.
        """
        try:
            # Format the query from the input
            context = query.get("context", "")
            question = query.get("question", "")
            full_query = f"{context}\n{question}" if context else question
    
            reasoning = await get_deepseek_reasoning(full_query)
    
            return f"<ant_thinking>\n{reasoning}\n</ant_thinking>\n\nNow we should provide our final answer based on the above thinking."
        except Exception as e:
            return f"<reasoning_error>\nError: {str(e)}\n</reasoning_error>\n\nExplain the error."
  • Helper function that performs the actual API call to DeepSeek's reasoning model, streaming and collecting the 'reasoning_content' from the response chunks.
    async def get_deepseek_reasoning(query: str) -> str:
        """
        Get reasoning from the DeepSeek API.
    
        Args:
            query (str): The input query to process.
    
        Returns:
            str: The reasoning output from the API.
        """
        async with httpx.AsyncClient() as client:
            headers = {
                "Content-type": "application/json",
                "Authorization": f"Bearer {DEEPSEEK_API_KEY}",
            }
    
            payload_body = {
                "model": "deepseek-reasoner",
                "messages": [{"role": "user", "content": query}],
                "streaming": True,
                "max_tokens": 2048,
            }
    
            async with client.stream(
                "POST",
                f"{DEEPSEEK_API_BASE}/chat/completions",
                headers=headers,
                json=payload_body,
            ) as response:
                reasoning_data = []
                async for line in response.aiter_lines():
                    if line.startswith("data: "):
                        data = line[6:]
                        if data == "DONE":
                            continue
                        try:
                            chunk_data = json.loads(data)
                            if content := chunk_data.get("choices", [{}])[0].get("delta", {}).get("reasoning_content", ""):
                                reasoning_data.append(content)
                        except json.JSONDecodeError:
                            continue
    
                return " ".join(reasoning_data)
  • Docstring defining the input schema (query dict with 'context' and 'question' keys) and output format for the 'reason' tool.
    """
    Process a query using DeepSeek's R1 reasoning engine and prepare it for integration with Claude.
    
    DeepSeek R1 leverages advanced reasoning capabilities that naturally evolved from large-scale 
    reinforcement learning, enabling sophisticated reasoning behaviors. The output is enclosed 
    within `<ant_thinking>` tags to align with Claude's thought processing framework.
    
    Args:
        query (dict): Contains the following keys:
            - context (str): Optional background information for the query.
            - question (str): The specific question to be analyzed.
    
    Returns:
        str: The reasoning output from DeepSeek, formatted with `<ant_thinking>` tags for seamless use with Claude.
    """
  • server.py:61-61 (registration)
    The @mcp.tool() decorator registers the 'reason' function as an MCP tool.
    @mcp.tool()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the reasoning engine's capabilities and output formatting with tags, but fails to address critical aspects like rate limits, error handling, authentication needs, or performance characteristics. For a tool with no annotation coverage, this leaves significant gaps in understanding its operational behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections for purpose, technical background, parameters, and returns. It avoids unnecessary fluff, but the second sentence about R1's evolution could be trimmed for brevity without losing clarity. Overall, it's efficient and front-loaded with key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a nested parameter structure, the description is moderately complete. It covers the tool's purpose, parameter details, and return format, but lacks information on error cases, performance, or integration specifics. For a tool with such complexity, it should provide more operational context to be fully adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaningful semantics by detailing the 'query' parameter's structure with 'context' and 'question' keys, including that 'context' is optional. This goes beyond the bare schema, providing essential context for parameter usage, though it could specify data types or constraints more explicitly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Process a query using DeepSeek's R1 reasoning engine and prepare it for integration with Claude.' It specifies the verb ('process'), resource ('query'), and technology ('DeepSeek R1'), though it doesn't need to differentiate from siblings since none exist. The purpose is specific but could be more precise about what 'process' entails.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by mentioning integration with Claude and the reasoning capabilities, but it lacks explicit guidance on when to use this tool versus alternatives. With no sibling tools, this is less critical, but it doesn't provide context on prerequisites, limitations, or ideal scenarios for application.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HarshJ23/deepseek-claude-MCP-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server