Implement the MCP tool catalog for pdftract with all 10 tools wired to the extraction surface via the MCP protocol. The tool registry provides typed argument schemas (JSON Schema via schemars), structured error mapping (Rust errors → JSON-RPC error codes), and per-invocation observability logging. - Tool registry with Tool trait and 10 tool implementations - JSON Schema input schemas for all tools (draft-07 compliant) - Error code mapping: -32000 NOT_YET_IMPLEMENTED, -32001 PDF_ENCRYPTED, -32002 IO_ERROR, -32003 PATH_INVALID - Observability logging: structured stderr log line per tools/call - Integration tests: 10/11 pass (1 ignored for encrypted fixture) - Registry unit tests: 23/23 pass Tools implemented: - extract, extract_text, extract_markdown (stubs pending Phase 6) - search (stub pending Phase 6) - get_metadata, hash (fully implemented, fast paths) - get_table, get_form_fields, get_attachments, classify (stubs return NOT_YET_IMPLEMENTED per spec) Acceptance criteria: 8/8 PASS (2 WARN for Phase 6 stubs) Refs: pdftract-1rami Co-Authored-By: Claude Code <noreply@anthropic.com>
57 lines
1.5 KiB
TOML
57 lines
1.5 KiB
TOML
[package]
|
|
name = "pdftract-cli"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
publish = true
|
|
|
|
[[bin]]
|
|
name = "pdftract"
|
|
path = "src/main.rs"
|
|
test = true
|
|
|
|
[[bin]]
|
|
name = "generate_lzw_fixtures"
|
|
path = "../../tests/fixtures/generate_lzw_fixtures_main.rs"
|
|
|
|
[lib]
|
|
name = "pdftract_cli"
|
|
path = "src/lib.rs"
|
|
|
|
default-run = "pdftract"
|
|
|
|
[dependencies]
|
|
anyhow = { workspace = true }
|
|
async-stream = "0.3"
|
|
axum = { version = "0.7", features = ["json"] }
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
clap = { version = "4.5", features = ["derive"] }
|
|
hyper = { version = "1.0", features = ["full"] }
|
|
hyper-util = { version = "0.1", features = ["full"] }
|
|
http-body-util = "0.1"
|
|
lzw = { workspace = true }
|
|
pdftract-core = { path = "../pdftract-core" }
|
|
regex = "1.10"
|
|
secrecy = { workspace = true }
|
|
serde = { workspace = true, features = ["derive"] }
|
|
sha2 = "0.10"
|
|
serde_json = "1.0"
|
|
schemars = { version = "0.8", features = ["derive"] }
|
|
tempfile = "3"
|
|
tera = "1"
|
|
tokio = { version = "1", features = ["full"] }
|
|
tokio-stream = "0.1"
|
|
tower = { version = "0.5", features = ["full"] }
|
|
tower-http = { version = "0.5", features = ["cors", "trace", "limit", "compression-full"] }
|
|
tracing = { workspace = true }
|
|
walkdir = "2"
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
libc = "0.2"
|
|
|
|
[dev-dependencies]
|
|
jsonschema = "0.18"
|
|
reqwest = { version = "0.12", features = ["blocking", "json", "rustls-tls"], default-features = false }
|
|
schemars = { version = "0.8", features = ["derive"] }
|