이제 Spicrawl은 OpenAI Agents SDK, LangChain, Codex, Claude Code 등과 함께 작동합니다.통합 보기
본문으로 건너뛰기

VS Code에서 Copilot으로 웹 스크래핑

VS Code에 Spicrawl MCP 서버를 추가하세요. 그러면 에이전트 모드의 Copilot이 웹 페이지를 깔끔한 Markdown으로 읽을 수 있습니다.

설정하기

세 단계로 Copilot에 도구, Spicrawl 코드를 작성하는 노하우, 둘을 쓰는 규칙을 갖춰 줍니다. spicrawl init --client vscode가 앞의 두 단계를 대신 처리합니다.

  1. 프로젝트에 .vscode/mcp.json를 만드세요. VS Code는 mcpServers가 아니라 servers 키를 사용합니다. 비밀번호 입력란을 사용하면 VS Code가 키를 한 번 물어보고 저장하므로 파일을 커밋해도 안전합니다:

    .vscode/mcp.json
    {
      "inputs": [
        {
          "type": "promptString",
          "id": "spicrawl-api-key",
          "description": "Spicrawl API key",
          "password": true
        }
      ],
      "servers": {
        "spicrawl": {
          "type": "http",
          "url": "https://mcp.spicrawl.com/mcp",
          "headers": { "Authorization": "Bearer ${input:spicrawl-api-key}" }
        }
      }
    }
  2. 명령 팔레트에서 MCP: 서버 목록를 실행하고 spicrawl를 시작하세요. 요청하면 키를 입력하세요.

  3. 스킬을 설치하고 커밋하세요:

    bash
    spicrawl skill install --client vscode
    
    # Without the CLI:
    mkdir -p .github/skills/spicrawl
    curl -fsSL https://app.spicrawl.com/skill.md -o .github/skills/spicrawl/SKILL.md
  4. .github/copilot-instructions.md로 저장하거나 이미 사용 중인 파일에 추가하세요:

    .github/copilot-instructions.md
    # Web data (Spicrawl)
    
    Use Spicrawl to read web pages: the spicrawl_* MCP tools in chat, or
    POST https://api.spicrawl.com/v1/scrape with `Authorization: Bearer $SPICRAWL_API_KEY` in code.
    Docs: https://docs.spicrawl.com/llms.txt (append .md to any page URL for Markdown).
    
    - Ask for markdown: `response_format: "markdown"` (API default is html); on spicrawl_scrape, `format: "markdown"`.
    - Check the site's status, not only the HTTP status: `X-Target-Status` header, or `status`
      in the JSON envelope (spicrawl_scrape with `format: "json"`). 200 is the page; 404/410
      mean it does not exist; 403/429/503 mean the site refused, so escalate.
    - On an error, switch on `code`. Retry only when `retryable` is true, after
      `retry_after_seconds`. Read `diagnostics.hint` and change what it names first.
      Never retry ERR::REQUEST::*, ERR::AUTH::* or ERR::LIMIT::QUOTA_EXCEEDED.
    - Escalate one step at a time and stop at the first that works:
      plain fetch (1 credit) -> `js_render: true` (3) -> add the user's own `proxy`
      if they have one. Empty or skeleton content means render; ERR::UPSTREAM::CHALLENGE
      or a 403 target status means retry once, then the user's own proxy.
    - Set `max_cost` on every request to the price of the step you intend.
    - Keep the cache on (default). Set `cache: false` only for prices, stock or other live data.
    - Trim tokens with `main_content_only` (on by default for markdown), `include_tags`, `exclude_tags`.
    - For more than 20 URLs, use a batch job (spicrawl_batch_submit / POST /v1/batch).
      Batch items return html, markdown or text (spicrawl_batch_submit defaults to markdown,
      POST /v1/batch to html). Extraction, screenshots, actions and sessions are refused
      with a 400 before anything is charged: scrape those URLs one by one.
    - Never print or commit SPICRAWL_API_KEY. Log `X-Request-Id` for failures.
  5. Chat 보기를 열고 에이전트 모드로 전환한 뒤 도구 선택기를 여세요. spicrawl에 spicrawl_* 도구 25개가 나열됩니다.

Copilot CLI와 Copilot 클라우드 에이전트는 각자의 MCP 설정을 읽습니다. 문서 페이지에서 둘 다 다룹니다.

먼저 해 볼 작업

Agent 모드에서 Copilot Chat을 열고 다음과 같이 물어보세요:

prompt
Use Spicrawl to read https://example.com/pricing as markdown. List each plan with its monthly price.
If the page comes back empty, retry with rendering.

에이전트는 format: "markdown"로 spicrawl_scrape를 호출해야 합니다. 첫 결과가 비어 있을 때만 render: true를 추가해야 합니다.

할 수 있는 일

이 서버는 에이전트에게 spicrawl_* 도구 25개를 제공합니다. 각 호출은 API를 직접 호출할 때와 같은 한도와 크레딧으로 사용자의 API 키로 실행됩니다.

  • 페이지 하나 읽기: spicrawl_scrape는 Markdown(기본값), 텍스트, HTML, JSON 또는 PDF를 반환합니다.
  • 여러 페이지 읽기: spicrawl_batch_submit는 최대 10,000개의 URL을 대기열에 넣습니다. 이어서 spicrawl_batch_status와 spicrawl_batch_results를 사용하세요.
  • 로그인이 필요한 페이지: spicrawl_session_create는 호출 사이에 쿠키와 스토리지를 유지합니다.
  • 실패 디버깅: spicrawl_requests_list와 spicrawl_request_get.
  • 사용량 확인: spicrawl_usage_summary 및 기타 사용량 도구입니다. 이 도구에는 read 범위가 있는 키가 필요합니다.
  • 조회하기: spicrawl_docs_search와 spicrawl_docs_read로 Spicrawl 문서를 검색하고 읽습니다.

도구 하나, spicrawl_browser_connect_url는 목록에 있지만 곧 제공될 예정입니다. spicrawl_scrape에서 렌더링 인수는 API의 js_render가 아니라 render입니다.

알아 두세요

  • 크롤링은 지원하지 않습니다. Spicrawl은 링크를 따라가거나 페이지를 찾지 않습니다. 에이전트에게 URL을 주세요.
  • 요청당 크레딧. 일반 fetch는 1 크레딧, JavaScript 렌더링은 3, 전체 브라우저 렌더링은 8입니다.
  • 실패는 무료입니다. 실패한 요청은 0 크레딧입니다.
  • 캐시는 시간을 절약해 줄 뿐 크레딧을 절약해 주지는 않습니다. 캐시 적중 비용은 그 결과를 저장한 요청과 같습니다.
  • 호출마다 상한을 두세요. max_cost를 설정하면 더 많은 비용이 들 수 있는 요청은 실행 전에 거부됩니다.
  • 곧 제공 예정: 관리형 프록시, 스텔스 모드, 원격 브라우저, 일반 문장 프롬프트를 이용한 AI 추출. 현재는 직접 프록시를 사용할 수 있습니다.

자주 묻는 질문

VS Code는 왜 "mcpServers"가 아니라 "servers"를 쓰나요?

VS Code 고유의 형식입니다. 이 페이지의 예제처럼 .vscode/mcp.json의 servers 키를 사용하세요.

내 키는 어디에 저장되나요?

The inputs entry with password: true makes VS Code ask for the key once and store it. The file only holds ${input:spicrawl-api-key}, so you can commit it.

Copilot CLI와 클라우드 에이전트에서도 작동하나요?

가능하지만 각자 자체 MCP 설정을 읽습니다. Copilot CLI는 copilot mcp add를 사용합니다. 클라우드 에이전트는 저장소 관리자가 Settings → Copilot → MCP servers에서 설정합니다. 문서 페이지에 둘 다 나와 있습니다.

spicrawl init --client vscode는 무엇을 작성하나요?

.vscode/mcp.json과 .github/skills/spicrawl/SKILL.md의 스킬을 작성합니다. 지침 파일이나 Copilot CLI 또는 클라우드 에이전트 설정은 작성하지 않습니다.

페이지당 비용이 얼마인가요?

일반 fetch는 1 크레딧, JavaScript 렌더링은 3, 풀 브라우저 렌더링은 8입니다. 실패한 요청은 0 크레딧입니다. 캐시 적중은 그 결과를 저장한 fetch와 같은 비용이 듭니다. 에이전트가 예상보다 많이 쓰지 않도록 요청마다 max_cost를 설정하게 하세요.