Skip to main content
Glama

local-web-mcp

Version 0.3.0 · AGPL-3.0

このツールは AI の支援を受けて開発されていますが、アップロード前に人間による評価を受けています。

自分のマシン上で動作するフォールバック Web フェッチャーを Claude に提供する MCP サーバーです。組み込みのフェッチャーがブロックされた場合、こちらはあなたの IP、あなたの接続、そしてオプションでログイン済みセッションを使って試行します。

ツールは 1 つだけです: fetch_url_locally。

解決する問題

ホステッドフェッチャーはデータセンターの IP レンジから実行されるため、多くのサイトが真っ向から拒否します。ローカルの stdio MCP サーバーはそうではありません。クライアントがあなたのマシン上でプロセスを起動するため、リクエストはあなたの通常の接続から発信されます。

ホステッドフェッチャーが読めなかったサイト(CNBC、Politiken、Bloomberg を含む)で動作確認済みです。

Related MCP server: Proxy Browser MCP Server

変わらないもの

枠組みが過大評価を招きがちなので、はっきり述べておく価値があります。

  • モデルの推論は依然として Anthropic のサーバー上で実行されます。

  • 取得したページのテキストは、依然としてツール出力としてモデルに送信されます。認証済みセッションを通じて読み取られたものはすべてそれに含まれます。

  • 変更されるのは Web サイトと通信するのは誰か であり、モデルがどこで実行されるか ではありません。

厳格な境界

そのページは JavaScript を実行せずに読めますか?

読めるなら、このツールで対応できます。読めないなら、ヘッダー、TLS、Cookie のどの層でもそこに到達できず、User-Agent をどんなに調整しても役に立ちません。DataDome、Cloudflare Turnstile、PerimeterX などを使用しているサイトは、通過するために実行しなければならないチャレンジを配信します。そのような場合は、ブラウザベースのツールを使うか、自分でページを開いてください。

これは修正すべきバグではなく、認識すべき境界です。

判定

すべてのレスポンスにはラベルが付きます。危険なケースは明らかな 403 ではなく、ページではない 200 です。ボットの中間ページ、同意ウォール、空のクライアントレンダリングシェルなどです。これらはあたかも記事であるかのように要約されます。

判定

意味

対処

ok

実際のコンテンツ

使用する

challenge

ボット対策を検出

ブラウザが必要、停止する

blocked

全面的に拒否 (403)、通常はボット検出

ブラウザが必要、停止する

js_required

クライアントレンダリングされたシェル、JS なしではコンテンツなし

ブラウザが必要、停止する

login_required

401、ログインウォール、または購読ウォール

Cookie が役立つ場合がある

http_error

その他の非 2xx ステータス (404, 429, 5xx)

429/5xx の場合のみ後で再試行

empty

抽出された文字数が 200 未満

読み取り失敗、空のページではない

ok 以外の判定はすべて、モデルに対して本文をコンテンツとして扱わないよう明示的な警告を付加します。

本文の証拠はステータスコードよりも優先されます。ペイウォール付き記事を HTTP 403 として配信する出版社は、blocked ではなく login_required として報告されます。そこでの有益なアドバイスはブラウザに頼ることではなく、Cookie をエクスポートすることだからです。

検出は文言ではなくベンダーインフラに基づいて一致します。チャレンジページはローカライズされているため、captcha-delivery.com は「デバイスを確認しています」のような文言が信頼できない場合でも、信頼できるシグナルです。レスポンスヘッダー内のベンダー Cookie は、拒否ステータスと対になっている場合に証拠として扱われます。

ツール

fetch_url_locally(url, max_chars=20000, use_session=true)

パラメータ

型

デフォルト

目的

url

string

必須

取得するページ。http と https のみ

max_chars

integer

20000

返されるテキストの上限。200000 にクランプされる。切り捨てはヘッダーで報告される

use_session

boolean

true

Cookie を送信する。ページが本当に公開されているかテストするには false を渡す

応答は、短いヘッダーとそれに続く抽出テキストで構成されます:

URL: https://example.com/article
Status: 200
Verdict: ok
Title: The headline
Session: authenticated (the user's cookies were sent)

The article text...

Session: は、Cookie が実際に読み込まれ、そのホストにスコープされている場合にのみ表示されます。ok 以外の判定は、本文をコンテンツとして扱わないようモデルに指示する WARNING: 行を追加します。

失敗は原因を明示するエラーとして返されます。例: [blocked_host] Host '192.168.1.5' resolves to a private or internal address。コード: invalid_url, blocked_scheme, blocked_host, dns_failure, timeout, too_many_redirects, upstream_error, invalid_argument。

必要条件

  • Python 3.11+ (asyncio.timeout を使用)。uv を使えば自分でインストールする必要はありません。uv が適切なインタープリターを取得します

  • Claude Desktop または Claude Code。stdio サーバーはブラウザやモバイルアプリでは動作しません。これらは公開リーチ可能な HTTPS エンドポイントを必要とします。

インストール

uv を使うと、適切な Python と依存関係を uv 自身が取得します:

uv --directory /absolute/path/to/local-web-mcp run local-web-mcp

サーバーを登録する前に、ターミナルで一度実行してください。 初回実行は環境の解決と構築を行うため時間がかかり、クライアントがコールド起動すると、設定が正しくても諦めてサーバーが失敗したと報告する可能性があります。

Starting local-web と表示され、その後 stdin でクライアントを待ちます。これが正常に動作するサーバーの姿です。その行が表示されたら環境は構築されています。Ctrl+C を押して先に進んでください。

または、通常の仮想環境を使う場合:

python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

Claude Desktop への登録

claude_desktop_config.json に追加します (macOS: ~/Library/Application Support/Claude/、Linux: ~/.config/Claude/):

{
  "mcpServers": {
    "local-web": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/local-web-mcp",
        "run",
        "local-web-mcp"
      ]
    }
  }
}

uv がクライアントから見える PATH にない場合は、その絶対パスを command として使用します。仮想環境の場合の相当する設定は次のとおりです:

{
  "mcpServers": {
    "local-web": {
      "command": "/absolute/path/to/.venv/bin/python",
      "args": ["/absolute/path/to/local_web_mcp.py"]
    }
  }
}

Claude Code の場合:

claude mcp add local-web -- uv --directory /absolute/path/to/local-web-mcp run local-web-mcp

設定

すべてオプションです。すべての設定には動作するデフォルトがあります。

変数

デフォルト

目的

LOCALWEB_COOKIE_FILE

未設定

Cookie jar へのパス

LOCALWEB_COOKIE_DOMAINS

未設定

jar を使用できるドメイン。Cookie ファイルを設定するときは必ず設定すること

LOCALWEB_ALLOW_PRIVATE

false

プライベート、ループバック、リンクローカルターゲットを許可

LOCALWEB_ALLOWLIST

空

IP チェックから除外されるホスト名

LOCALWEB_USER_AGENT

Chrome UA

すべてのリクエストで送信される

LOCALWEB_ACCEPT_LANGUAGE

da,en-GB;q=0.9,en;q=0.8

言語の嗜好。サイトはこれを使って言語を選び、場合によっては地域版を選ぶ

LOCALWEB_CONNECT_TIMEOUT

5

秒

LOCALWEB_READ_TIMEOUT

20

秒

LOCALWEB_TOTAL_TIMEOUT

40

呼び出しごとのハード上限

LOCALWEB_MAX_BYTES

3000000

レスポンス本文の上限

LOCALWEB_MAX_REDIRECTS

5

リダイレクトのホップ数。meta リフレッシュと共用

デフォルトの Accept-Language は最初にデンマーク語を要求します。これは中立的なデフォルトではなく意図的なものです。英語や他の言語が必要な場合は LOCALWEB_ACCEPT_LANGUAGE を設定してください:

"env": { "LOCALWEB_ACCEPT_LANGUAGE": "en-GB,en;q=0.9" }

LOCALWEB_COOKIE_FILE にブラウザ拡張機能からエクスポートしたファイルを指定します。ローダーは、ヘッダー行があってもなくても Netscape cookies.txt を受け付け、一般的な拡張機能からの JSON エクスポートも受け付けます。cookies.txt.example を参照してください。

必ず LOCALWEB_COOKIE_DOMAINS を設定してください。 これがないと jar 全体が有効になり、どのフェッチも無関係なセッションを運ぶ可能性があります。設定すると、jar がクライアントに届く前に、ロード時にそれらのドメイン外のすべての Cookie が破棄されます。マッチングはサブドメインをカバーします (example.com は www.example.com をカバー) が、類似ドメイン (evil-example.com) はカバーしません。

留意すべき点が 3 つあります:

  1. セッションを通じて読み取られたコンテンツは、ツール出力としてモデルに送信されます。

  2. Cookie ファイルは資格情報ファイルです。chmod 600 にしてください。また、このリポジトリでは gitignore されています。

  3. Cookie は期限切れになります。以前は動作していたソースが login_required を返す場合、それはアクセス権の喪失ではなく、通常は古いエクスポートが原因です。

ページが本当に公開されているかどうかを確認するには、use_session=false を渡してください。

ローカルネットワークへのアクセス

プライベートアドレスはデフォルトでブロックされており、これは意図的です。モデルは直前に読んだテキストから URL を選ぶことがあるため、取得したページが 192.168.1.1 へ誘導しようとする可能性があります。ブロックリストにより、ページコンテンツへのプロンプトインジェクションでこれをネットワークスキャナーに変えることはできません。

全面許可スイッチよりも、狭い許可リストを優先してください:

"env": { "LOCALWEB_ALLOWLIST": "nas.local,nas" }

セキュリティ

  • スキームは http と https のみに制限。資格情報を含む URL は拒否

  • ホスト名を解決し、リクエスト前にすべての返されたアドレスを検証

  • チェック前に IPv6 マップされた IPv4 (::ffff:10.0.0.1) をアンラップ

  • クラウドメタデータエンドポイントは無条件にブロック。ホスト名は許可リストと ALLOW_PRIVATE の両方より前に解決されるため、どちらもそれらを開くことはできない

  • リダイレクトと meta リフレッシュは手動で追跡し、各ホップで再検証

  • 記録されるのは Cookie の数のみ。名前、値、ドメインは決して記録されない

既知の制限

  • JavaScript なし。 上記の厳格な境界。

  • DNS リバインディング。 ホスト名は検証のために解決され、接続時に再度解決されます。このギャップを埋めるには、接続を検証済み IP に固定する必要があります。信頼できないネットワークで ALLOW_PRIVATE を有効にする前に実施する価値があります。

  • チャレンジ検出はシグネチャベースであり、ベンダーがマークアップを変更するにつれてずれていきます。判定がおかしいと思ったら inspect_response.py を実行してください。

  • HTML からテキストへの抽出は依存関係なしの簡易的なものです。 本格的な記事抽出には trafilatura の方がはるかに優れているでしょう。

ファイル

ファイル

目的

local_web_mcp.py

サーバー

cookies.py

寛容な Cookie ローダー。必須、サーバーがインポートする

inspect_response.py

診断: フェッチャーが実際に受け取ったものをダンプする

unit_test.py

判定、ターゲット検証、Cookie の読み込みとスコープ

smoke_test.py

ブロック対象と 1 回のライブフェッチを stdio 経由でテスト

cookies.txt.example

Cookie jar の注釈付きテンプレート

pyproject.toml

パッケージメタデータと local-web-mcp エントリポイント

uv.lock

再現可能なインストールのための依存関係バージョン固定

requirements.txt

通常の venv ルート用のランタイム依存関係

.gitignore

venv、キャッシュ、およびすべての Cookie ファイルを除外

LICENSE

AGPL-3.0 の完全なテキスト

誤った判定の診断

uv run python inspect_response.py https://example.com/article

ステータス、注目すべきヘッダー、本文の先頭を表示し、その内容に対してサーバー自身の検出を実行します。検出ロジックを変更する前には必ずこれを確認してください。 ブラウザとこのフェッチャーには、しばしばまったく異なるレスポンスが返されます。したがって、画面に表示される内容はフェッチャーが受け取ったものの証拠にはなりません。

テスト

uv run python unit_test.py
uv run python smoke_test.py

unit_test.py はオフラインで動作し、失敗時には非ゼロの終了コードを返すため、pre-commit ゲートとして機能します。smoke_test.py は stdio を介してサーバーを駆動し、ライブリクエストを1回行うため、ネットワーク接続が必要です。両方ともリポジトリのルートから実行してください。

プレーンな venv を使用する場合は、uv run python の代わりに .venv/bin/python を使用してください。

ライセンス

Copyright (C) 2026 David Lindholm.

GNU Affero General Public License v3.0 またはそれ以降。LICENSE を参照してください。

このプログラムは、有用であることを願って配布されていますが、いかなる保証もありません。商品性または特定の目的への適合性についての暗黙の保証も一切ありません。

Available Tools

1 tool
fetch_url_locallyFetch a URL from the user's machineA
Read-only

Fetch a web page over the user's own internet connection and return its readable text.

USE THIS WHEN the built-in web fetch has already been tried and: it returned an error, 403, or 429; it returned a Cloudflare or captcha interstitial; it returned a cookie/consent wall or a near-empty page; the source is geo-restricted; the source sits behind the user's institutional access or paid subscription; or the URL is on the user's local network.

DO NOT use it as the first attempt for ordinary public pages -- the built-in fetcher is faster and does not use the user's bandwidth.

The response carries a verdict line. If the verdict is not 'ok', the body is an interstitial rather than the article and must not be summarised as though it were the content.

NameRequiredDescriptionDefault
urlYes
max_charsNo
use_sessionNo

Output Schema

NameRequiredDescription
resultYes

TDQS

A4.8/5.0
Behavior5/5

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

Clearly discloses that the response includes a verdict line that must be checked, and warns that a non-'ok' verdict means the body is an interstitial and must not be summarized as content. This is valuable behavioral context beyond the readOnlyHint annotation, and it directly prevents a likely misuse.

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 for the complexity, with the core purpose front-loaded and usage conditions clearly structured. It earns its length by giving concrete error cases and a safety caveat; it is not overly verbose, though it could be slightly tightened.

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

Completeness5/5

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

Given the tool's complexity and the fact that there is an output schema, the description is complete for an agent to call it correctly: it knows when to use it, what to expect in the response, and how to avoid misinterpreting interstitials. No critical operational detail is missing.

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?

Schema description coverage is 0%, so the description must compensate; it does not mention individual parameters like max_chars or use_session, but the core parameter 'url' is fully implied ('Fetch a web page...'). The behavioral verdict warning adds context that indirectly helps the agent interpret the output, but explicit parameter-level guidance is still missing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific action ('Fetch a web page over the user's own internet connection') and an explicit resource ('user's own... URL'), and it differentiates itself by emphasizing the local-network/user-machine execution path versus the built-in fetcher. It is unambiguous about what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides extensive when-to-use criteria: use only after built-in fetch fails with errors, interstitials, geo-restrictions, etc., and explicitly says DO NOT use as first attempt for ordinary pages. This is exactly the kind of conditional routing guidance an agent needs.

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. 1 tool updatev0.3.0
    • First observedfetch_url_locally

TDQS

A4.6/5.0

Scored across 1 tool

Disambiguation5/5

There is only one tool, so there is no possibility of confusing it with another tool. Its purpose is clearly described and scoped.

Naming Consistency5/5

The single tool name follows a clear, descriptive snake_case convention. With only one tool, there are no inconsistent patterns to evaluate.

Tool Count3/5

A single tool is borderline for a server, but it may be justified for a narrowly-focused fallback fetch utility. It feels thin compared to broader MCP servers, but not absurdly so.

Completeness4/5

The tool completely covers its stated purpose of fetching pages locally and returning readable text. Minor gaps exist around request customization or response metadata, but no core workflow dead ends are apparent.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables Claude to browse the web and make GET/POST/PUT requests with a real Chrome TLS/HTTP2 fingerprint to avoid anti-bot detection, supporting persistent cookie sessions and optional proxies.
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides a direct bridge between Claude and an authenticated Chrome session, enabling fetch requests with session cookies and JavaScript execution within live web pages.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables Claude and other MCP clients to read, extract, crawl, and export data from open browser tabs and specified URLs locally, including logged-in sessions, structured page data, contacts, images, sitemaps, and Shopify catalogues.
    MIT