Local-first PDF paper translation agent with:
- direct CLI translation
- MCP tool server (
stdio+http) - agent-to-agent parameter contract (
preflight_validate,build_pipeline_invocation,run_local_translate_agent)
- Python
3.10+ - A local OpenAI-compatible LLM endpoint (default:
http://127.0.0.1:5000/v1)
Windows (PowerShell):
.\scripts\bootstrap.ps1Linux / WSL:
bash ./scripts/bootstrap.shThis creates .venv and installs dependencies from requirements.txt.
PowerShell:
.\scripts\smoke_check.ps1PowerShell (CI-compatible, no local vLLM):
.\scripts\smoke_check.ps1 -SkipLlmCheckLinux / WSL:
bash ./scripts/smoke_check.shLinux / WSL (CI-compatible, no local vLLM):
bash ./scripts/smoke_check.sh http://127.0.0.1:5000/v1 trueCommand Prompt:
scripts\smoke_check.batCommand Prompt (CI-compatible):
scripts\smoke_check.bat http://127.0.0.1:5000/v1 truePut your PDF in papers_repo/, for example:
papers_repo/sample.pdf
PowerShell:
.\scripts\run_translate_agent.ps1 -PdfPath ".\papers_repo\sample.pdf" -SkipCompileCommand Prompt (.bat, no execution-policy change needed):
scripts\run_translate_agent.bat papers_repo\sample.pdf artifacts\agent_sample http://127.0.0.1:5000/v1 auto trueOutput artifacts are written under artifacts/....
Start MCP HTTP server:
python .\paper_translate_agent.py --mode mcp-http --mcp-host 127.0.0.1 --mcp-port 8787Call one-shot tool (run_local_translate_agent) via script:
.\scripts\mcp_run_translate_agent.ps1 -PdfPath "papers_repo/sample.pdf" -SkipCompileOr via .bat:
scripts\mcp_run_translate_agent.bat papers_repo\sample.pdf artifacts\mcp_sample http://127.0.0.1:8787 http://127.0.0.1:5000/v1Invoke-RestMethod -Uri "http://127.0.0.1:5000/v1/models" -Method GET
python -m app.debug_tools.diagnose --profile quick --base-url "http://127.0.0.1:5000/v1"tools/list exposes machine-readable fields:
descriptionparameter_contractexamplesmissing_info_protocol
Core MCP helpers:
preflight_validate: checks missing/invalid params before executionbuild_pipeline_invocation: returns deterministic preflight->run->artifacts workflow bundlerun_local_translate_agent: one-shot local execution entrypoint (enforces local base URL by default)
python -m unittest discover -s tests -vCI-compatible diagnose command:
python -m app.debug_tools.diagnose --profile quick --skip-llm-check- Contribution guide:
CONTRIBUTING.md - PR template:
.github/pull_request_template.md - GitHub Actions workflow:
.github/workflows/ci.yml
CI matrix:
ubuntu-latestwith Python3.10,3.11windows-latestwith Python3.10
CI runs:
python -m pip install -r requirements.txtpython -m unittest discover -s tests -vpython -m app.debug_tools.diagnose --profile quick --skip-llm-check
Why --skip-llm-check in CI:
- CI should be reproducible and must not depend on a private/local endpoint like
http://127.0.0.1:5000/v1.
app/: pipeline, MCP registry/server, debug toolsscripts/: bootstrap and run scripts (.ps1,.sh,.bat)config/agent.defaults.yaml: default params and missing-info modepapers_repo/: place input PDFsartifacts/: generated outputsdocs/USAGE_AND_ACCESS.md: detailed usage and calling guide