Skip to main content
Glama
ygboy1986

DeepSeek-Claude MCP Server

by ygboy1986

reason

Process complex queries using DeepSeek's reasoning engine to generate structured analysis for Claude integration, enabling multi-step problem-solving with formatted outputs.

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-89 (handler)
    The handler function for the 'reason' tool. Decorated with @mcp.tool(), it processes the input query dictionary, fetches reasoning from DeepSeek API via helper, and formats the output with thinking tags.
    @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 reasoner model to obtain streaming reasoning content.
    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 in the reason handler defines the input schema (query dict with context and question) and output format.
    """
    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 (name inferred from function name).
    @mcp.tool()
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool uses 'DeepSeek's R1 reasoning engine' with 'advanced reasoning capabilities,' and notes the output format ('enclosed within <ant_thinking> tags'). However, it misses key behavioral traits like performance characteristics (e.g., speed, accuracy), error handling, or any limitations (e.g., input size constraints). It adds some context but is incomplete for a tool with no annotation support.

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 appropriately sized and front-loaded, starting with the core purpose. The first sentence clearly states what the tool does, and subsequent sentences add necessary details about the engine and output format. However, the second sentence about 'advanced reasoning capabilities' could be trimmed as it's somewhat promotional and doesn't add practical value for tool selection.

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 the complexity (reasoning engine with nested input), no annotations, and no output schema, the description is moderately complete. It explains the input structure and output format, but lacks details on error cases, performance, or integration specifics with Claude. For a tool with no structured support, it should do more to cover behavioral aspects and potential pitfalls.

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?

The description adds significant meaning beyond the input schema, which has 0% coverage. It details that the 'query' parameter is a dict with keys 'context' (optional background) and 'question' (specific question to analyze), clarifying the structure and purpose of the nested object. This compensates well for the low schema coverage, though it doesn't cover all potential edge cases or examples.

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 slightly 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 'prepare it for integration with Claude' and the output format, suggesting it's for scenarios where reasoning output needs to be compatible with Claude. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., other reasoning engines or direct processing), and there are no siblings to compare against. The context is clear but not comprehensive.

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/ygboy1986/AIClaude'

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