Skip to main content
Glama
DeepSeek Search & Fetch MCP

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: mcp-deepseek-search

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.

Inputs: url (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    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 recent community issues

    Related MCP Connectors

    Related MCP Servers

    • 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
      C
      maintenance
      Exposes DeepSeek's web search and page-fetch tools to any MCP client, letting any LLM run searches with quality signals like rerank score and source authority, plus advanced query syntax. It also retrieves single pages as Markdown, with built-in throttling, retries, and size-conscious summaries.
      2
      101 npm
      2
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables MCP clients such as Claude Code to run real-time web searches and fetch public web pages as Markdown through DeepSeek's official search and fetch APIs, with result pagination and response caching. Runs over stdio and only requires a DeepSeek API key, needing no browser, Docker, or database.
      2
      140 npm
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      A local stdio MCP server that exposes DeepSeek's Web Search and Fetch APIs, letting AI clients run structured web queries, fetch page contents, and receive DeepSeek's raw JSON responses unfiltered and untruncated. It supports filtering by site, language, and date range, with configurable timeouts and retries.
      2
      MIT