A second HTTP listener in the books server, on 127.0.0.1 only, off until the app's admin request (RemoteStart) names the one public address. Every connection begins with the relay's PROXY v2 header, whose address is the caller's (never an HTTP header); the door speaks stateless plain-JSON MCP for one company per path, and is its own OAuth 2.1 server: metadata at every place products look, client ID metadata documents, dynamic registration and a typed client id and secret, PKCE S256, exact redirects, single-use short codes, rotated refresh tokens (a reused one ends its family), short access tokens, the issuer pinned. /authorize never approves: it parks the request and only the owner-only admin socket turns it into a code. An approval is one principals token (so A4's list and revoke see it) plus a record naming the product, which survives the product registering again. Read and draft by default; posting raised per approval. Every table is bounded and expires; secrets are kept as SHA-256 only. A stranger's unsigned request is a 401 with the metadata pointer and is counted, never written to the books' record. The access record gains an optional 'from' (the caller's address), kept as an IP when it is one (the TIN masking would turn it to dots). The tools a model reaches for first now carry the company's name and 'call books.start first' in their own descriptions (plan 3.4), local and remote. Dependencies: none new to the tree. reqwest (client documents, as ledger-host already uses it), subtle, getrandom and hyper-util (already pulled in by ledger-store and axum) are now declared by ledger-mcp; cargo deny and the notices check pass unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
73 lines
2.6 KiB
TOML
73 lines
2.6 KiB
TOML
[package]
|
|
name = "ledger-mcp"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
publish.workspace = true
|
|
description = "The books server's MCP tools for wanderbooks: the AI-first bookkeeping interface over ledger-store."
|
|
|
|
[lib]
|
|
path = "src/lib.rs"
|
|
|
|
[dependencies]
|
|
ledger-core = { path = "../ledger-core" }
|
|
ledger-store = { path = "../ledger-store" }
|
|
ledger-import = { path = "../ledger-import" }
|
|
ledger-config = { path = "../ledger-config" }
|
|
ledger-vault = { path = "../ledger-vault" }
|
|
# The CPA package, the 1099 worksheet, and the reports they share with
|
|
# the viewer.
|
|
ledger-package = { path = "../ledger-package" }
|
|
base64 = "0.22"
|
|
# The remote door's sign-in (local/remote/): a client's metadata document is
|
|
# fetched with it (cimd.rs), its secrets compared in constant time, its
|
|
# codes and tokens drawn from the system's randomness, and its connections
|
|
# served by hyper directly so a header-read timeout can be set. All were in
|
|
# the tree already (ledger-host, ledger-store, axum).
|
|
reqwest = "0.13"
|
|
subtle = "2"
|
|
getrandom = { version = "0.2", features = ["std"] }
|
|
hyper-util = { version = "0.1", features = ["server-auto", "service", "tokio", "http1", "http2"] }
|
|
# A download's Repr-Digest (local.rs).
|
|
sha2 = "0.10"
|
|
rust_decimal = "1"
|
|
rmcp = { version = "3", features = ["server", "schemars", "transport-streamable-http-server"] }
|
|
axum = "0.8"
|
|
http-body-util = "0.1"
|
|
tower = "0.5"
|
|
schemars = "1"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
chrono = "0.4"
|
|
thiserror = "2"
|
|
tokio = { version = "1", features = ["rt-multi-thread", "macros", "io-util", "sync", "net", "signal", "time"] }
|
|
tokio-util = { version = "0.7", features = ["rt", "io", "io-util"] }
|
|
# A call that panics is recorded before the panic goes on (access.rs).
|
|
futures-util = "0.3"
|
|
toml = "1"
|
|
# The vault's TINs, decoded for the filing scan (tin_files.rs), are wiped
|
|
# from memory when dropped, as the vault's own are.
|
|
zeroize = "1"
|
|
tempfile = { version = "3", optional = true }
|
|
|
|
# The socket's peer credentials (SO_PEERCRED, getpeereid) for local.rs's
|
|
# same-user check: std has no call for them.
|
|
[target.'cfg(unix)'.dependencies]
|
|
libc = "0.2"
|
|
|
|
[features]
|
|
# The door in-process, for fuzz/ (local.rs fuzz_door). Off in every build
|
|
# but the fuzz workspace's.
|
|
fuzzing = ["dep:tempfile"]
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dev-dependencies]
|
|
# The unit tests drive the tools as a client would (the integration tests,
|
|
# through a real books server, are ledger-cli's: plan D-44).
|
|
tokio = { version = "1", features = ["time", "macros", "rt-multi-thread"] }
|
|
rmcp = { version = "3", features = ["client", "transport-streamable-http-client-reqwest"] }
|
|
tempfile = "3"
|