Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ jobs:
BRAVE_API_KEY: ""
SEMANTIC_SCHOLAR_API_KEY: ""
NVD_API_KEY: ""
browser-absence:
name: browser absent degradation contract
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable snapshot 2026-09-28
with:
toolchain: "1.89"
- name: Run deterministic missing-browser library tests
run: cargo test --locked --features mock --lib browser_absent
- name: Run deterministic missing-browser CLI tests
run: cargo test --locked --features mock --bin eggsearch browser_absent
- name: Run feature-absent CLI error test
run: cargo test --locked --no-default-features --bin eggsearch browser_not_compiled_cli_request_has_stable_code
- name: Run browser launch-failure contract test
run: cargo test --locked --features mock --lib browser_launch_failure_is_named_and_does_not_repeat_http
windows-portability:
name: windows portability (x86_64-pc-windows-msvc all-features check)
runs-on: windows-latest
Expand Down
175 changes: 174 additions & 1 deletion .github/workflows/python-native-qualification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ jobs:
python -m pip install packaging==26.0
python -m pip install --no-index --no-deps --only-binary=:all: dist/*.whl
python -c "from importlib.metadata import distribution; from packaging.utils import parse_wheel_filename; from pathlib import Path; d=distribution('eggsearch'); wheels=list(Path('dist').glob('*.whl')); assert len(wheels) == 1; name, version, build, tags=parse_wheel_filename(wheels[0].name); assert name == 'eggsearch' and str(version) == d.version; assert all(tag.abi == 'abi3' and tag.interpreter == 'cp311' for tag in tags); print(d.metadata['Name'], d.version, d.metadata['Requires-Python']); print(*d.files, sep='\\n')" > dist/metadata.txt
python - <<'PY'
import os
from pathlib import Path
wheels = list(Path("dist").glob("*.whl"))
if len(wheels) != 1:
raise SystemExit(f"expected one wheel, found {len(wheels)}")
wheel = wheels[0]
size = wheel.stat().st_size
line = f"- {wheel.name}: {size} bytes ({size / 1_000_000:.2f} MB)"
print(line)
with open(os.environ["GITHUB_STEP_SUMMARY"], "a", encoding="utf-8") as summary:
summary.write(line + "\n")
if size > 20_000_000:
raise SystemExit(f"{wheel.name} exceeds 20 MB; maintainer review required")
PY
sha256sum dist/*.whl | tee dist/SHA256SUMS
cat dist/SHA256SUMS >> "$GITHUB_STEP_SUMMARY"
- id: upload
Expand Down Expand Up @@ -140,11 +155,137 @@ jobs:
shell: bash
working-directory: ${{ runner.temp }}

browser-with-chrome:
name: Verify browser rendering with Chrome
needs: build-wheel
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: "3.11"
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: wheel-linux-x86_64
path: ${{ runner.temp }}/wheelhouse
- uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87
with:
toolchain: 1.89.0
- name: Install the release wheel in a clean environment
run: |
python -m venv "$RUNNER_TEMP/.venv"
"$RUNNER_TEMP/.venv/bin/python" -m pip install --no-index --no-deps --only-binary=:all: "$RUNNER_TEMP"/wheelhouse/*.whl
"$RUNNER_TEMP/.venv/bin/python" -m pip install pytest==8.4.2
shell: bash
- name: Assert Chrome discovery in the release wheel
env:
EGGSEARCH_TEST_BROWSER_WITH_CHROME: "1"
run: >-
"$RUNNER_TEMP/.venv/bin/python" -m pytest -q -s
"$GITHUB_WORKSPACE/bindings/python/tests/test_native.py" -k
browser_capability_with_chrome
shell: bash
working-directory: ${{ runner.temp }}
- name: Build and install a mock-only deterministic fixture wheel
run: |
python -m pip install maturin==1.15.0
maturin build --manifest-path bindings/python/Cargo.toml --release --locked --features eggsearch/mock --out "$RUNNER_TEMP/fixture-wheelhouse" -i python3.11
python -m venv "$RUNNER_TEMP/fixture-venv"
"$RUNNER_TEMP/fixture-venv/bin/python" -m pip install --no-index --no-deps --only-binary=:all: "$RUNNER_TEMP"/fixture-wheelhouse/*.whl
"$RUNNER_TEMP/fixture-venv/bin/python" -m pip install pytest==8.4.2
shell: bash
- name: Assert real Chrome renders the deterministic fixture and lifecycle bounds
env:
EGGSEARCH_TEST_BROWSER_WITH_CHROME: "1"
run: >-
"$RUNNER_TEMP/fixture-venv/bin/python" -m pytest -q -s
"$GITHUB_WORKSPACE/bindings/python/tests/test_native.py" -k
"browser_render_with_chrome or browser_idle_and_session_cap_counters_are_visible"
shell: bash
working-directory: ${{ runner.temp }}

browser-without-chrome:
name: Verify explicit browser absence ${{ matrix.id }}
needs: build-wheel
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- { id: linux-x86_64, runner: ubuntu-24.04 }
- { id: linux-aarch64, runner: ubuntu-24.04-arm }
- { id: macos-x86_64, runner: macos-15-intel }
- { id: macos-arm64, runner: macos-15 }
- { id: windows-x86_64, runner: windows-2022 }
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: "3.11"
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: wheel-${{ matrix.id }}
path: ${{ runner.temp }}/wheelhouse
- name: Create a clean consumer environment
run: python -m venv "$RUNNER_TEMP/.venv"
shell: bash
- name: Assert deterministic explicit-path absence and unaffected operations
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
python_bin="$(cygpath -u "$RUNNER_TEMP")/.venv/Scripts/python.exe"
else
python_bin="$RUNNER_TEMP/.venv/bin/python"
fi
"$python_bin" -m pip install --no-index --no-deps --only-binary=:all: "$RUNNER_TEMP"/wheelhouse/*.whl
"$python_bin" -m pip install pytest==8.4.2
"$python_bin" -m pytest -q -s "$GITHUB_WORKSPACE/bindings/python/tests/test_native.py" -k browser_absence_is_explicit_and_http_operations_still_work
shell: bash
working-directory: ${{ runner.temp }}

browser-auto-discovery-no-chrome:
name: Verify automatic discovery without Chrome
needs: build-wheel
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: wheel-linux-x86_64
path: ${{ runner.temp }}/wheelhouse
- name: Run installed-wheel contract in a browser-free container
env:
EGGSEARCH_TEST_BROWSER_AUTO_ABSENCE: "1"
run: |
docker run --rm \
-e EGGSEARCH_TEST_BROWSER_AUTO_ABSENCE \
-v "$GITHUB_WORKSPACE:/source:ro" \
-v "$RUNNER_TEMP/wheelhouse:/wheelhouse:ro" \
python:3.11-slim-bookworm \
/bin/sh -euxc '
python -m venv /tmp/eggsearch-venv
/tmp/eggsearch-venv/bin/python -m pip install --no-index --no-deps --only-binary=:all: /wheelhouse/*.whl
/tmp/eggsearch-venv/bin/python -m pip install pytest==8.4.2
cd /tmp
/tmp/eggsearch-venv/bin/python -m pytest -q -s /source/bindings/python/tests/test_native.py -k browser_absence_is_explicit_and_http_operations_still_work
'
shell: bash
working-directory: ${{ runner.temp }}

armv7-build:
name: Build ARMv7 hard-float wheel
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87
with:
toolchain: 1.89.0
targets: armv7-unknown-linux-gnueabihf
- name: Install ARMv7 C compiler for the binding check
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
- name: Check Python binding for ARMv7
env:
CC_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-gcc
run: RUSTUP_TOOLCHAIN=1.89.0 cargo check --locked --manifest-path bindings/python/Cargo.toml --target armv7-unknown-linux-gnueabihf
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b
with:
maturin-version: v1.15.0
Expand All @@ -157,8 +298,23 @@ jobs:
run: |
python -m pip install packaging==26.0
python bindings/python/scripts/audit_armv7_wheel.py dist/*.whl | tee dist/armv7-audit.txt
sha256sum dist/*.whl | tee dist/SHA256SUMS
cat dist/armv7-audit.txt >> "$GITHUB_STEP_SUMMARY"
python - <<'PY'
import os
from pathlib import Path
wheels = list(Path("dist").glob("*.whl"))
if len(wheels) != 1:
raise SystemExit(f"expected one ARMv7 wheel, found {len(wheels)}")
wheel = wheels[0]
size = wheel.stat().st_size
line = f"- linux-armv7l: {wheel.name}, {size} bytes ({size / 1_000_000:.2f} MB)"
print(line)
with open(os.environ["GITHUB_STEP_SUMMARY"], "a", encoding="utf-8") as summary:
summary.write(line + "\n")
if size > 20_000_000:
raise SystemExit(f"{wheel.name} exceeds 20 MB; maintainer review required")
PY
sha256sum dist/*.whl | tee dist/SHA256SUMS
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: wheel-linux-armv7l
Expand Down Expand Up @@ -229,6 +385,23 @@ jobs:
cd "$RUNNER_TEMP"
"$RUNNER_TEMP/runtime-venv/bin/python" -m pytest -q "$source_dir/bindings/python/tests"
"$RUNNER_TEMP/runtime-venv/bin/python" -c "import tomllib; from pathlib import Path; import eggsearch; from importlib.metadata import distribution; expected=tomllib.loads(Path('$GITHUB_WORKSPACE/bindings/python/pyproject.toml').read_text())['project']['version']; assert len(eggsearch.tool_names()) == 9; assert distribution('eggsearch').version == expected"
python - <<'PY'
import os
from pathlib import Path
workspace = Path(os.environ["GITHUB_WORKSPACE"])
artifacts = sorted([
*workspace.joinpath("dist").glob("*.tar.gz"),
*workspace.joinpath("extracted-wheel").glob("*.whl"),
])
if not artifacts:
raise SystemExit("no sdist or rebuilt wheel found")
with open(os.environ["GITHUB_STEP_SUMMARY"], "a", encoding="utf-8") as summary:
for artifact in artifacts:
size = artifact.stat().st_size
line = f"- {artifact.name}: {size} bytes ({size / 1_000_000:.2f} MB)"
print(line)
summary.write(line + "\n")
PY
sha256sum "$GITHUB_WORKSPACE"/dist/* "$GITHUB_WORKSPACE"/extracted-wheel/* | tee "$GITHUB_WORKSPACE/dist/SHA256SUMS"
cat "$GITHUB_WORKSPACE/dist/SHA256SUMS" >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Batch fetch budgets now measure each item after its selected response-detail projection, and `payload_chars` / `total_payload_chars` match the returned projected payloads. Web document structure degrades before text clipping or omission, under the existing aggregate cap and envelope-overhead exclusion.
- HTML extraction preserves source whitespace around inline text, links, and code in text and Markdown output. Repeated whitespace still normalizes, but words are not merged and no spaces are invented when absent from the source.

### Added

- The Python wheel now compiles browser rendering alongside PDF extraction, so a
`pip install eggsearch` consumer gets the same capability as the released
binary. A system Chrome or Chromium is discovered at runtime and is never
bundled. A host without one still installs, imports, searches, and fetches: an
explicit browser request returns `browser_unavailable` naming the cause, and
an automatic one returns the HTTP result with a `browser_unavailable`
warning.

- `web_fetch`, `batch_fetch` web items, the unified `fetch` tool, and CLI `eggsearch fetch` now
reach a browser-gated origin for the same reason `web_search` already did. A `429` or `5xx` from
such an origin escalates once to the shipped browser render under `render: "auto"` instead of
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "eggsearch"
version = "0.4.4"
version = "0.4.5"
edition = "2021"
rust-version = "1.89"
authors = ["eggstack"]
Expand Down
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
[![License](https://img.shields.io/crates/l/eggsearch.svg)](LICENSE)
[![Downloads](https://img.shields.io/crates/d/eggsearch.svg)](https://crates.io/crates/eggsearch)

A lightweight MCP (Model Context Protocol) search and fetch server for AI agents:
live web metasearch with RRF dedup, bounded fetch, and deterministic evidence
bundling, over client-owned stdio or explicit loopback-only Streamable HTTP.
Eggsearch adds live search and bounded source fetching to MCP-compatible AI
clients. It combines public search sources, returns evidence as source cards, and
can package selected material into deterministic evidence bundles. Connect it
over client-owned stdio or run an explicit loopback-only Streamable HTTP server.

**No API keys are required for the default installation.** The default install is
keyless across web, fetch, advisory, package-registry, and scholarly paths.
Expand Down Expand Up @@ -52,21 +53,12 @@ eggsearch providers # per-provider enabled / configured / routable
```

```bash
$ eggsearch search "rust tokio" --max-results 1
# Results for 'rust tokio' (1 items, 1 failed)

1. <<<EXTERNAL_UNTRUSTED field=title id=src_9778070202700542>>>
Tokio - An asynchronous Rust runtime
<<<END>>>
https://tokio.rs/
[duckduckgo]
<<<EXTERNAL_UNTRUSTED field=snippet id=src_9778070202700542>>> Tokio is a library for
writing fast, reliable, and easy network applications with Rust. … <<<END>>>

Failed providers:
- yahoo: engine 'yahoo' returned status 500 (http_status)
eggsearch search "rust tokio" --max-results 3
```

Search uses live public sources, so results vary and an individual provider can
fail without making the whole query fail.

```bash
$ eggsearch fetch "https://example.com" --metadata-only
# Fetch: https://example.com
Expand All @@ -84,8 +76,8 @@ Truncated: false
Every card carries a content-derived stable ID and an `<<<EXTERNAL_UNTRUSTED>>>`
frame: treat fetched text as data, never instructions. Results merge across
providers, so one provider failing is reported as a warning rather than failing
the query. One URL per `web_fetch`, `batch_fetch` for explicit fan-out, `--json`
for machine output.
the query. The MCP `fetch` tool accepts one or more explicitly selected web or
repository items. Use `--json` for machine-readable CLI output.

Preview client configuration first. Rendering is read-only; `--apply` is opt-in:

Expand Down Expand Up @@ -133,16 +125,24 @@ for codebases, `security_search` for advisories, `research_search` for compariso
`provider_status` is for hosts and troubleshooting, not a first research step.
Responses include machine-readable `next_actions`, so keep the working set small
and load specialized tools only as needed. `web_search` returns source cards, not
a synthesized answer; read useful sources with `web_fetch`. See [Tool matrix](docs/tool-matrix.md)
and [Agent workflows](docs/agent-workflows.md) for details.
a synthesized answer; read useful sources with `fetch`. See the
[Tool matrix](docs/tool-matrix.md) and [Agent workflows](docs/agent-workflows.md)
for details.

## Safety

- Fetched content is `external_untrusted`: data, not instructions. `sanitize_output` defaults to `true`, with injection markers reported as `injection_hits`.
- Fetch is bounded and explicit: one URL per `web_fetch`, no autonomous crawling, SSRF checks against blocked address ranges.
- Fetched content is `external_untrusted`: data, not instructions.
`sanitize_output` defaults to `true`, with injection markers reported as
`injection_hits`.
- Fetch is bounded and explicit. `fetch` reads only selected web or repository
targets and checks for blocked address ranges.
- Current source builds enable PDF extraction and browser rendering by default.
Published `v0.4.4` binaries predate that change and include neither feature.
Browser rendering requires an existing Chrome or Chromium installation.
Browser rendering requires an existing Chrome or Chromium installation; when
none is found, browser functionality reports itself unavailable and the rest
of the product keeps working.
The Python wheels are built from the same source and compile both features;
the published `eggsearch==0.4.4` wheel is PDF-only.
The opt-in `egress` proxy route is limited to provider upstreams and is
excluded from prebuilt binaries.

Expand Down
Loading
Loading