Skip to main content
Glama
Realmagnum

DeepSeek Search & Fetch MCP

by Realmagnum

DeepSeek Search & Fetch MCP

DeepSeek Search & Fetch MCP

A lightweight stdio MCP server for DeepSeek's official Search and Fetch APIs. It uses only Python's standard library and works with Hermes, OpenCode v2, Codex, Claude Code, and any MCP client that supports stdio servers.

Requirements

  • Python 3.10 or newer

  • A DeepSeek API key with Search & Fetch API access

Related MCP server: ollama-search-mcp

Install

For an agent

Configure the MCP client to start the server and pass DEEPSEEK_API_KEY as an environment variable. Do not put the key in the project files or commit it.

The server can be run directly from a cloned repository:

git clone https://github.com/Realmagnum/deepseek-search-mcp.git
cd deepseek-search-mcp
DEEPSEEK_API_KEY="your-api-key" python3 deepseek_search_mcp.py

For a persistent agent configuration, use the absolute path to deepseek_search_mcp.py and provide the key through the client's environment/secrets mechanism. Examples follow.

Hermes

Add an stdio MCP server using the Hermes CLI, then enter the script path and environment variable when prompted:

hermes mcp add deepseek-search --command "python3 /absolute/path/deepseek_search_mcp.py"

Set DEEPSEEK_API_KEY in the environment available to Hermes, then verify and enable the server:

hermes mcp list
hermes mcp test deepseek-search

OpenCode v2

The following configuration was tested with OpenCode v2.0.29. OpenCode v2 stores MCP servers under mcp.servers in its config. For example, add this entry to ~/.config/opencode/opencode.json (global) or the project's opencode.json:

{
  "mcp": {
    "servers": {
      "deepseek-search": {
        "type": "local",
        "command": ["python3", "/absolute/path/deepseek_search_mcp.py"],
        "environment": {
          "DEEPSEEK_API_KEY": "your-api-key"
        }
      }
    }
  }
}

Or register it through the OpenCode v2 CLI:

opencode mcp add deepseek-search \\
  --env DEEPSEEK_API_KEY=your-api-key \\
  -- python3 /absolute/path/deepseek_search_mcp.py
opencode mcp list

OpenCode v1 uses a different config shape (mcp entries directly, without the servers object). This example targets v2 only. Use a secret manager or a local untracked config instead of committing an API key.

Codex CLI

Add the server using the Codex CLI:

codex mcp add deepseek-search --env DEEPSEEK_API_KEY=your-api-key -- python3 /absolute/path/deepseek_search_mcp.py

Or add this to ~/.codex/config.toml:

[mcp_servers.deepseek-search]
command = "python3"
args = ["/absolute/path/deepseek_search_mcp.py"]

[mcp_servers.deepseek-search.env]
DEEPSEEK_API_KEY = "your-api-key"

Claude Code

Register the server for the current project:

claude mcp add --transport stdio --scope project \
  --env DEEPSEEK_API_KEY=your-api-key \
  deepseek-search -- python3 /absolute/path/deepseek_search_mcp.py

Choose user scope instead of project scope to make the server available across projects. Use a local, untracked configuration or secret manager for API keys.

For a person (without an agent)

Install nothing beyond Python. Set the key in the shell and run a search or fetch with any MCP-compatible desktop client. For example, with Claude Desktop, add an mcpServers entry to its configuration:

{
  "mcpServers": {
    "deepseek-search": {
      "command": "python3",
      "args": ["/absolute/path/deepseek_search_mcp.py"],
      "env": {
        "DEEPSEEK_API_KEY": "your-api-key"
      }
    }
  }
}

Restart the client after changing its MCP configuration. Consult the client's documentation for the configuration file location and supported secret-variable syntax.

Tools

Searches the web and returns ranked results, including title, URL, snippet, summary, relevance score, and authority tier.

Arguments:

  • query (required): 1–128 characters; supports operators such as site:, lang:, after:, before:, quoted phrases, and exclusions.

  • count (optional): 1–50, defaults to 10.

  • need_content (optional): include extracted page content in results; defaults to false.

  • ori_question (optional): original user question, up to 128 characters.

  • localization (optional): IP address for localized results.

deepseek_fetch

Fetches an HTTP or HTTPS page and returns its title and Markdown content.

Billing and limits

DeepSeek bills Search and Fetch per successful request. Current pricing and rate limits are documented in the DeepSeek Search & Fetch guide. A search with need_content: true is one Search request; separately fetching pages makes additional Fetch requests.

Local check

python3 test_smoke.py deepseek_search_mcp.py

License

MIT. See LICENSE.

Available Tools

2 tools
deepseek_fetchA

Fetch a public HTTP(S) webpage with DeepSeek and return its title and extracted Markdown content.

NameRequiredDescriptionDefault
urlYesHTTP(S) page URL.

TDQS

A3.6/5.0
Behavior3/5

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

No annotations exist, so the description carries the burden alone; it discloses the return shape (title + extracted Markdown) and the public-page restriction, which is genuinely useful. It says nothing about authentication requirements, rate limits, payload size limits, or how non-HTML or failed fetches behave.

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

Conciseness5/5

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

One sentence, front-loaded with the verb and resource, with the return value appended. Nothing is redundant and nothing is buried.

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

Completeness4/5

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

For a one-parameter fetch tool with no output schema, the description covers what it does, the input domain, and the return format, which is enough to call it correctly. Failure modes and content-type handling are the only meaningful omissions.

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

Parameters3/5

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

Schema coverage is 100% and the single url parameter is already documented as "HTTP(S) page URL." The description's only addition is the "public" qualifier, which marginally narrows valid values but adds no format or syntax detail beyond the schema.

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?

A specific verb ("Fetch") plus a specific resource ("a public HTTP(S) webpage") and an explicit statement of what comes back (title and extracted Markdown). It implicitly contrasts with deepseek_search (URL retrieval vs. query), but never names the sibling or states the boundary explicitly.

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 word "public" is the only usage constraint given, telling the agent which targets are in-scope. There is no guidance on when to prefer this over deepseek_search, no prerequisites, and no exclusions (e.g., authenticated or JS-rendered pages).

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv1.0.0
    • First observeddeepseek_fetch
    • First observeddeepseek_search

TDQS

A3.9/5.0

Scored across 2 tools

Disambiguation5/5

search and fetch are clearly distinct operations: one queries a search index, the other retrieves a single known URL. There is no plausible way for an agent to confuse them, since descriptions explicitly delineate query-based discovery vs. direct page retrieval.

Naming Consistency5/5

Both tools follow a consistent deepseek_<verb> pattern with matching snake_case and a shared server prefix. This is a clean, predictable convention with no deviations.

Tool Count3/5

Two tools is on the thin side for the stated scope, though the search+fetch pairing is a natural minimal set. It earns its place but leaves little flexibility (e.g. no batch or pagination tooling).

Completeness4/5

The discovery+retrieval pair covers the core web-search workflow, and search optionally returning page content reduces reliance on fetch. Minor gaps exist (no pagination, batch fetch, or cache/refresh control), but agents can work around them.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    An MCP server that provides web search powered by DeepSeek's native search API, returning AI-generated answers with source links. Integrates with MCP-compatible clients like Claude Code and Cursor.
    1
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Enables MCP clients to search the live web and fetch any URL as clean text through Ollama's web search and fetch APIs, returning ranked results with page text and outgoing links. Runs as a single dependency-free stdio server, so agents can ground their answers with current web content without a separate search vendor.
    2
    37 npm
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Exposes DeepSeek's Search and Fetch REST APIs as two read-only MCP tools, letting any MCP-capable agent run ranked web searches and retrieve individual pages as truncated Markdown. Works with whichever model the host runs, over stdio or Streamable HTTP.
    2
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI agents to perform real-time web search and fetch/parse webpages into clean Markdown through DeepSeek's Search and Fetch APIs. It provides configurable summaries, scoring, and robust retries for integration with MCP-compatible assistants.
    2
    1
    MIT