Logo DataForSEO

DataForSEO

Tổ chức
dataforseo

DataForSEO API modelcontextprotocol server

Nhà phát hànhdataforseo
Kho mãmcp-server-typescript
Ngôn ngữTypeScript
Bản fork
116
Sao
246
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépApache-2.0
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    DataForSEO cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    246 sao và 116 bản fork từ kho mã được liên kết.

DataForSEO MCP Server

This is the new v3 MCP server. The previous v2+ MCP server is deprecated and lives at dataforseo/mcp-server-typescript-deprecated.

MCP server and CLI for LLM agents to browse DataForSEO API documentation and make authenticated API requests. By default the binary starts an MCP server on stdio; CLI commands are an optional second mode.

Quick Start

Start the MCP server on stdio (default mode; set DATAFORSEO_LOGIN / DATAFORSEO_PASSWORD):

bash
npx dataforseo-mcp-server@latest

HTTP transport (port 3000; override with PORT):

bash
npx dataforseo-mcp-server@latest --mode http

Authentication

OAuth 2.0 (default for HTTP MCP): works out of the box. MCP clients discover the DataForSEO authorization server via Protected Resource metadata and send Authorization: Bearer tokens.

Fallback: API login/password via environment variables (HTTP Basic). Required for CLI and stdio MCP; on HTTP it is used when no Authorization header is present.

bash
# bash / macOS / Linux
export DATAFORSEO_LOGIN="your_api_login"
export DATAFORSEO_PASSWORD="your_api_password"
powershell
# PowerShell
$env:DATAFORSEO_LOGIN="your_api_login"
$env:DATAFORSEO_PASSWORD="your_api_password"
cmd
REM CMD
set DATAFORSEO_LOGIN=your_api_login
set DATAFORSEO_PASSWORD=your_api_password

DATAFORSEO_USERNAME is accepted as an alias for DATAFORSEO_LOGIN. Get API keys at https://app.dataforseo.com/api-access.

MCP Server

The same tool implementations power both the MCP server and the CLI. One binary serves both modes; MCP is the default.

How the binary chooses a mode:

  • MCP stdio — default when no CLI command is passed
  • MCP HTTP — pass --mode http (Streamable HTTP on port 3000; override with PORT)
  • CLI — when the first command is docs or request, or when --cli / --help / --version is passed

MCP stdio (default):

bash
npx dataforseo-mcp-server

MCP HTTP:

bash
npx dataforseo-mcp-server --mode http

CLI:

bash
npx dataforseo-mcp-server docs index

MCP client config (Cursor, Claude Desktop, and similar clients that use mcpServers):

Via URL — use the hosted remote MCP server, or start a local HTTP server (npx dataforseo-mcp-server --mode http) and point the client at it. OAuth works out of the box; env credentials are optional fallback only.

Public remote MCP server URL: https://mcp.dataforseo.com/v3/mcp

json
{
  "mcpServers": {
    "dataforseo": {
      "url": "https://mcp.dataforseo.com/v3/mcp"
    }
  }
}

Local server (default port 3000):

json
{
  "mcpServers": {
    "dataforseo": {
      "url": "http://localhost:3000/mcp"
    }
  }
}

Via command (stdio) — the client starts the binary itself (stdio is the default mode). OAuth is not used on this transport — set env credentials (or pass them in the MCP client env block):

jsonc
{
  "mcpServers": {
    "dataforseo": {
      "command": "npx",
      "args": [
        "dataforseo-mcp-server",
        // Optional additional args:
        // "--docs-cache-dir", "D:\\my-docs-cache",
        // "--configuration", "field-config.json"
      ],
      "env": {
        "DATAFORSEO_LOGIN": "your_api_login",
        "DATAFORSEO_PASSWORD": "your_api_password",
        // Optional additional env:
        // "FIELD_CONFIG_PATH": "field-config.json"
      }
    }
  }
}

From the repo root during development:

json
{
  "mcpServers": {
    "dataforseo": {
      "command": "npx",
      "args": ["tsx", "src/index.ts"],
      "cwd": "/path/to/mcp-server-typescript"
    }
  }
}

MCP Tools

ToolTitleDescription
docs_indexDocs IndexFetch documentation index, optionally filtered by section (24h cache)
docs_list_sectionsDocs List SectionsReturn available documentation section names
docs_searchDocs SearchFetch documentation from a documentation URL (needCodeExample, 24h cache)
api_requestAPI RequestMake an authenticated API request

api_request uses .ai paths by default. Set noAiMode to true in MCP requests, or pass --no-ai-mode in the CLI, to use the standard path. Request body is passed as data (JSON object or array). The --param option is CLI-only.

HTTP transport

Streamable HTTP endpoints:

  • POST /mcp
  • POST /http

OAuth 2.0 Protected Resource metadata (RFC 9728) is always exposed so MCP clients can discover the authorization server and authenticate with Bearer tokens:

  • GET /.well-known/oauth-protected-resource
  • GET /.well-known/oauth-protected-resource/mcp
  • GET /.well-known/oauth-protected-resource/http

Behind a reverse proxy, set TRUST_PROXY=true so metadata URLs use https.

Auth priority on HTTP requests:

  1. Authorization: Basic header
  2. Authorization: Bearer header (OAuth access token)
  3. Env credentials (DATAFORSEO_LOGIN / DATAFORSEO_PASSWORD) — fallback when no Authorization header is sent

CLI (optional)

In addition to MCP, the same binary exposes docs and request as CLI commands.

Commands

CommandDescription
npx dataforseo-mcp-server docs indexFetch full API documentation index
npx dataforseo-mcp-server docs index --section "SERP API"Filter index by API section
npx dataforseo-mcp-server docs index --list-sectionsList available sections
npx dataforseo-mcp-server docs search <url>Fetch documentation from a documentation URL or path (cURL example only by default)
npx dataforseo-mcp-server docs search <url> --need-code-exampleFetch documentation with PHP, Node.js, Python, and C# examples
npx dataforseo-mcp-server request -X <method> -p <path>Make an authenticated API request (.ai path by default)

From a built local clone you can also use npx . instead of npx dataforseo-mcp-server.

Examples

bash
# Browse SERP API endpoints
npx dataforseo-mcp-server docs index --section "SERP API"

# Read endpoint documentation (path or full docs URL)
npx dataforseo-mcp-server docs search serp/google/organic/live/regular
npx dataforseo-mcp-server docs search https://docs.dataforseo.com/v3/serp/google/organic/live/regular

# Include multi-language code examples (PHP, Node.js, Python, C#)
npx dataforseo-mcp-server docs search backlinks/referring_networks/live --need-code-example

# Live SERP request (recommended: use --param)
npx dataforseo-mcp-server request -X POST -p /v3/serp/google/organic/live/regular \
  --param keyword=dataforseo --param language_code=en --param location_code=2840

# Same request via JSON body
npx dataforseo-mcp-server request -X POST -p /v3/serp/google/organic/live/regular \
  -d '[{"keyword":"dataforseo","location_code":2840,"language_code":"en"}]'

Documentation responses are cached for 24 hours. Default cache directory:

  • Windows: %LOCALAPPDATA%\dataforseo-mcp-server\docs-cache
  • macOS: ~/Library/Caches/dataforseo-mcp-server/docs-cache
  • Linux: ~/.cache/dataforseo-mcp-server/docs-cache (or $XDG_CACHE_HOME)

Override with --cache-dir <path> on CLI docs commands. For MCP, pass --docs-cache-dir <path> in server startup args.

API responses are returned as the response body only (parsed JSON when possible). When a field configuration is loaded, api_request / request responses are trimmed to the configured fields for that endpoint path (see Field configuration).

Field configuration

Optionally limit which fields are returned from API responses. Unlike the previous multi-tool MCP server (keys = tool names), this package keys the config by API endpoint path.

bash
# MCP stdio (default when no CLI command is passed)
npx dataforseo-mcp-server --configuration field-config.json

# MCP HTTP
npx dataforseo-mcp-server --mode http --configuration field-config.json

# CLI
npx dataforseo-mcp-server --configuration field-config.json request -X POST -p /v3/backlinks/summary/live --param target=example.com

Or set env:

  • FIELD_CONFIG_PATH — path to a JSON file (Node)
  • FIELD_CONFIG_JSON — inline JSON string (Node / Cloudflare Worker)

Minimal example (see field-config.example.json for a fuller sample):

json
{
  "supported_fields": {
    "/v3/serp/google/organic/live/advanced": ["id", "items.title", "items.url", "status_code"],
    "/v3/backlinks/summary/live": ["id", "items.backlinks", "items.referring_domains", "status_code"]
  }
}

Behavior:

  • Built-in defaults always apply for /v3/on_page/lighthouse/live/json (shrunk Lighthouse payload). Custom config merges on top and can override any path.
  • Path match ignores .ai suffix, trailing slash, and host (full URLs work).
  • If the path is configured with a non-empty field list → only those fields are kept (applied to each tasks[].result[] item).
  • If the path has an empty field list [] → full response for that path (disables filtering).
  • If the path is missing from both defaults and custom config → full response.

Copy the example and trim to the endpoints you use:

bash
cp field-config.example.json my-config.json

Architecture

src/
├── index.ts            # Unified entry (MCP by default stdio; CLI if docs/request/--cli)
├── config/             # URLs, sections, auth server
├── core/
│   ├── api/            # auth, client, path, request-body
│   ├── cli/            # program, error, output
│   ├── config/         # field configuration + defaults
│   ├── docs/           # path, section, cache
│   ├── http/           # fetch
│   ├── mcp/            # startup args (--configuration, --docs-cache-dir)
│   ├── tools/          # shared CLI + MCP tool implementations
│   ├── utils/          # field filter
│   ├── env.ts
│   └── version.ts
├── mcp/
│   ├── init-mcp-server.ts
│   ├── tool-definition.ts
│   ├── auth-middleware.ts
│   ├── http-routes.ts
│   ├── index.ts        # stdio transport
│   └── index-http.ts   # streamable HTTP
└── worker/             # Cloudflare Worker entry (built separately)

Build outputs

TargetCommandOutputUsed by
Node (MCP + CLI)npm run build (tsc)dist/index.jsbin, Docker, start* scripts
Cloudflare Workernpm run worker:buildbuild/worker/worker/index-worker.jswrangler.jsonc → main

Worker path is build/worker/worker/... because tsconfig.worker.json sets rootDir to src and the entry lives at src/worker/index-worker.ts.

For LLM Agents

Read SKILL.md in this repo for full agent instructions.

Development

Requires Node.js 20+.

bash
npm install
npm run build

# Dev (tsx, no build step)
npm run dev              # MCP stdio (default)
npm run dev:mcp:http     # MCP HTTP
npm run dev -- docs index --section "SERP API"   # CLI

# After build
npm run start            # MCP stdio (default)
npm run start:mcp:http   # Streamable HTTP
npx . docs index --list-sections

Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "data-for-seo": {
      "command": "npx",
      "args": [
        "dataforseo-mcp-server"
      ],
      "env": {
        "DATAFORSEO_USERNAME": "your_username",
        "DATAFORSEO_PASSWORD": "your_password"
      }
    }
  }
}

Dùng MCP DataForSEO với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối DataForSEO, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm DataForSEO làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của DataForSEO.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "dataforseo": {
      "command": "npx",
      "args": [
        "-y",
        "dataforseo-mcp-server"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của DataForSEO, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của DataForSEO.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng DataForSEO giúp tôi làm việc này không?
DataForSEO
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng DataForSEO.

Câu hỏi thường gặp

Máy chủ MCP DataForSEO dùng để làm gì?

DataForSEO là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP DataForSEO với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng DataForSEO với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP DataForSEO với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối DataForSEO, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP DataForSEO với TypingMind?

DataForSEO hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP DataForSEO cung cấp những công cụ nào trong TypingMind?

DataForSEO cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP DataForSEO không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu DataForSEO yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇