loading…
Search for a command to run...
loading…
An MCP server that enables Claude and other LLMs to search and access archived Portuguese web content from Arquivo.pt, including full-text search, image search,
An MCP server that enables Claude and other LLMs to search and access archived Portuguese web content from Arquivo.pt, including full-text search, image search, version listing, and snapshot retrieval.
Python Versions License: MIT CI
Um servidor Model Context Protocol (MCP) para o Arquivo.pt — o arquivo web português. Permite que o Claude (ou qualquer outro LLM compatível com MCP) pesquise e leia conteúdo web português arquivado.
O arquivo-pt-mcp expõe seis ferramentas ao modelo de linguagem, permitindo-lhe consultar o Arquivo.pt como se fosse uma base de dados nativa:
| Ferramenta | Descrição |
|---|---|
search |
Pesquisa em texto integral no arquivo, com filtros opcionais de intervalo de datas e site |
image_search |
Pesquisa em mais de 1,8 mil milhões de imagens arquivadas |
list_versions |
Lista todas as capturas de um determinado URL através do servidor CDX |
get_snapshot |
Obtém uma página arquivada específica a partir de um URL + timestamp |
extract_text |
Obtém uma página arquivada e devolve o texto legível (HTML removido) |
get_screenshot |
Obtém o URL de uma captura PNG renderizada de uma página arquivada (opcionalmente com os bytes inline) |
pip install arquivo-pt-mcp
Ou, se preferir usar o uv:
uv add arquivo-pt-mcp
Para desenvolvimento (instalação a partir do código fonte):
git clone https://github.com/thaenor/arquivo-pt-mcp.git
cd arquivo-pt-mcp
pip install -e ".[dev]"
🚀 Caminho mais fácil — sem instalação
Existe uma instância pública alojada em Hugging Face Spaces. Aponte qualquer cliente MCP para:
https://decaf-squirrel-arquivo-pt-mcp.hf.space/mcpSem Python, sem
pip install, sem terminal. Basta o URL. (Ver instalação local abaixo se preferir correr no seu próprio computador.)
A configuração mais simples para utilizadores não-técnicos.
arquivo-pthttps://decaf-squirrel-arquivo-pt-mcp.hf.space/mcpEdite o ficheiro claude_desktop_config.json:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json{
"mcpServers": {
"arquivo-pt": {
"url": "https://decaf-squirrel-arquivo-pt-mcp.hf.space/mcp"
}
}
}
Reinicie o Claude Desktop.
Um único comando:
claude mcp add --transport http arquivo-pt https://decaf-squirrel-arquivo-pt-mcp.hf.space/mcp
Settings → MCP → Add server:
arquivo-pthttps://decaf-squirrel-arquivo-pt-mcp.hf.space/mcpSettings → Connectors → Add → MCP server URL:
https://decaf-squirrel-arquivo-pt-mcp.hf.space/mcp
Qualquer cliente que suporte o transporte Streamable HTTP do MCP pode usar o mesmo URL acima. Consulte a documentação do seu cliente para saber onde o colar.
A instância pública é adequada para uso casual, mas é uma máquina partilhada gratuita sem garantia de disponibilidade. Corra o servidor localmente se precisar de privacidade, cache própria, ou disponibilidade garantida.
Como servidor stdio local (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"arquivo-pt": {
"command": "uvx",
"args": ["arquivo-pt-mcp"]
}
}
}
O uvx (do uv) instala o pacote automaticamente na primeira execução — só precisa de ter o uv instalado.
Como servidor HTTP de longa duração:
pip install arquivo-pt-mcp # ou: uv add arquivo-pt-mcp
arquivo-pt-mcp --transport http --host 127.0.0.1 --port 8000
Depois aponte o seu cliente para http://127.0.0.1:8000/mcp. Para expor publicamente, coloque-o atrás de um proxy inverso com TLS (Caddy, nginx, Traefik) e passe --allowed-host <hostname>.
Nota: em modo HTTP as caches em memória são partilhadas entre todos os clientes ligados.
Uma vez configurado, pode pedir ao Claude coisas como:
https://arquivo.pt/textsearch — pesquisa em textohttps://arquivo.pt/imagesearch — pesquisa de imagenshttps://arquivo.pt/wayback/cdx — índice de capturas (CDX)https://arquivo.pt/wayback/{timestamp}/{url} — obtenção de snapshotshttps://arquivo.pt/wayback/noFrame/{timestamp}/{url} — snapshot limpo para extração de textohttps://arquivo.pt/screenshot?url=... — captura PNG renderizadahttps://arquivo.pt/noFrame/replay/{timestamp}/{url} — replay sem frame para screenshotDocumentação oficial: https://github.com/arquivo/pwa-technologies/wiki/Arquivo.pt-API
git clone https://github.com/thaenor/arquivo-pt-mcp.git
cd arquivo-pt-mcp
uv sync --extra dev
pytest -q
O projeto usa:
ruff check src tests
ruff format src tests
pytest --cov=arquivo_pt_mcp
Opcionalmente, pode executar os testes de integração contra a API real do Arquivo.pt:
RUN_INTEGRATION=1 pytest -m integration -v
Estes testes estão marcados com @pytest.mark.integration e são ignorados por
padrão. Apenas executam quando a variável de ambiente RUN_INTEGRATION=1 está
definida. No GitHub Actions podem ser disparados manualmente via workflow_dispatch.
Nota sobre o GitHub Actions: Os runners padrão do GitHub estão alojados nos
EUA. A conectividade TCP transatlântica para arquivo.pt (alojado em Portugal)
é por vezes pouco fiável — os testes podem falhar com httpx.ConnectError ou
httpx.ConnectTimeout independentemente da qualidade do código. Por isso, os
testes de integração foram removidos do agendamento noturno no CI. Podem ser
disparados manualmente via workflow_dispatch quando necessário. Para execuções
locais (a partir de qualquer localização na Europa) os testes passam de forma
consistente.
Este projeto foi desenvolvido para participar no Prémio Arquivo.pt, que incentiva a criação de ferramentas e aplicações que aproveitam o arquivo web português para fins educativos, científicos, culturais e técnicos.
arquivo-pt-mcp exposes six tools to the language model, letting it query Arquivo.pt as if it were a native data source:
| Tool | Description |
|---|---|
search |
Full-text search across the archive, with optional date range and site filters |
image_search |
Search across 1.8B+ archived images |
list_versions |
Every capture of a given URL, via the CDX server |
get_snapshot |
Resolve a URL + timestamp to a specific archived page |
extract_text |
Fetch an archived page and return its readable text (HTML stripped) |
get_screenshot |
Get the PNG render URL of an archived page (optionally embed the bytes inline) |
pip install arquivo-pt-mcp
Or with uv:
uv add arquivo-pt-mcp
For development (install from source):
git clone https://github.com/thaenor/arquivo-pt-mcp.git
cd arquivo-pt-mcp
pip install -e ".[dev]"
🚀 Easiest path — no install required
A public hosted instance runs on Hugging Face Spaces. Point any MCP client at:
https://decaf-squirrel-arquivo-pt-mcp.hf.space/mcpNo Python, no
pip install, no terminal. Just the URL. (See self-hosted setup below if you'd rather run it locally.)
The simplest setup for non-technical users.
arquivo-pthttps://decaf-squirrel-arquivo-pt-mcp.hf.space/mcpEdit your claude_desktop_config.json:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json{
"mcpServers": {
"arquivo-pt": {
"url": "https://decaf-squirrel-arquivo-pt-mcp.hf.space/mcp"
}
}
}
Restart Claude Desktop.
One command:
claude mcp add --transport http arquivo-pt https://decaf-squirrel-arquivo-pt-mcp.hf.space/mcp
Settings → MCP → Add server:
arquivo-pthttps://decaf-squirrel-arquivo-pt-mcp.hf.space/mcpSettings → Connectors → Add → MCP server URL:
https://decaf-squirrel-arquivo-pt-mcp.hf.space/mcp
Any client that speaks the MCP Streamable HTTP transport can use the same URL above. Refer to your client's docs for where to paste it.
The hosted instance is fine for casual use, but it's a free shared CPU box with no SLA. Run it yourself if you need privacy, your own caching, or guaranteed availability.
As a local stdio server (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"arquivo-pt": {
"command": "uvx",
"args": ["arquivo-pt-mcp"]
}
}
}
uvx (from uv) auto-installs the package on first run — nothing to install manually beyond uv itself.
As a long-lived HTTP server:
pip install arquivo-pt-mcp # or: uv add arquivo-pt-mcp
arquivo-pt-mcp --transport http --host 127.0.0.1 --port 8000
Then point your client at http://127.0.0.1:8000/mcp. To expose publicly, put it behind a TLS-terminating reverse proxy (Caddy, nginx, Traefik) and pass --allowed-host <hostname>.
Note: in HTTP mode the in-memory caches are shared across all connected clients.
Once connected, you can ask Claude things like:
https://arquivo.pt/textsearch — text searchhttps://arquivo.pt/imagesearch — image searchhttps://arquivo.pt/wayback/cdx — capture index (CDX)https://arquivo.pt/wayback/{timestamp}/{url} — snapshot retrievalhttps://arquivo.pt/wayback/noFrame/{timestamp}/{url} — clean snapshot for text extractionhttps://arquivo.pt/screenshot?url=... — PNG screenshot renderhttps://arquivo.pt/noFrame/replay/{timestamp}/{url} — frameless replay for screenshotOfficial docs: https://github.com/arquivo/pwa-technologies/wiki/Arquivo.pt-API
git clone https://github.com/thaenor/arquivo-pt-mcp.git
cd arquivo-pt-mcp
uv sync --extra dev
pytest -q
The project uses:
ruff check src tests
ruff format src tests
pytest --cov=arquivo_pt_mcp
Optionally, run integration tests against the live Arquivo.pt API:
RUN_INTEGRATION=1 pytest -m integration -v
These tests are marked with @pytest.mark.integration and skipped by default.
They only run when the RUN_INTEGRATION=1 environment variable is set. On
GitHub Actions they can be triggered manually via workflow_dispatch.
GitHub Actions note: Standard GitHub-hosted runners are US-based.
Transatlantic TCP connectivity to arquivo.pt (hosted in Portugal) is
sometimes unreliable — tests may fail with httpx.ConnectError or
httpx.ConnectTimeout regardless of code quality. For this reason, the
integration tests have been removed from the nightly CI schedule. They can still
be triggered manually via workflow_dispatch when needed. When run locally
from a European location the tests pass consistently.
This project was built for the Prémio Arquivo.pt, a Portuguese contest that encourages the creation of tools and applications leveraging the Portuguese Web Archive for educational, scientific, cultural, and technical purposes.
Run in your terminal:
claude mcp add arquivo-pt-mcp -- npx Security
Low riskAutomated heuristic from public metadata — not a security guarantee.