-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCargo.toml
More file actions
118 lines (96 loc) · 3.59 KB
/
Copy pathCargo.toml
File metadata and controls
118 lines (96 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
[package]
name = "arithma"
version = "0.3.0"
edition = "2024"
rust-version = "1.94"
authors = ["Fabricio Archanjo <fabricio@archanjo.com>"]
description = "The Ultimate LLM Calculator Engine — 87 precision math tools via MCP. Pure Rust, zero C deps, arbitrary-precision arithmetic, finance, electronics, networking."
license = "Apache-2.0"
repository = "https://github.com/farchanjo/arithma"
homepage = "https://github.com/farchanjo/arithma"
documentation = "https://github.com/farchanjo/arithma#readme"
readme = "README.md"
keywords = ["mcp", "calculator", "math", "stdio", "anthropic"]
categories = ["command-line-utilities", "mathematics", "science"]
# Strict lint profile applied by default to every `cargo build`, `cargo test`,
# and `cargo clippy` invocation. Treats warnings — including the full pedantic
# and nursery sets — as errors so drift cannot slip in silently.
[lints.rust]
warnings = "deny"
[lints.clippy]
all = { level = "deny", priority = -1 }
pedantic = { level = "deny", priority = -1 }
nursery = { level = "deny", priority = -1 }
[lib]
name = "math_calc"
path = "src/lib.rs"
[[bin]]
name = "arithma"
path = "src/main.rs"
[dependencies]
# MCP SDK (stdio transport)
rmcp = { version = "1.5", features = ["server", "transport-io"] }
# Async runtime
# `net` is needed for `tokio::io::unix::AsyncFd`, which backs the
# non-blocking stdio transport. We don't actually serve TCP; the feature is
# the only way to get `AsyncFd` exported from tokio 1.x.
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "io-std", "io-util", "sync", "signal", "net", "time"] }
# Serialization / JSON
serde = { version = "1", features = ["derive"] }
serde_json = "1"
schemars = "0.8"
# Error handling
anyhow = "1"
thiserror = "2"
# Arbitrary-precision arithmetic (DECIMAL128 semantics, HALF_UP rounding)
bigdecimal = { version = "0.4", features = ["serde"] }
num-bigint = "0.4"
num-traits = "0.2"
num-integer = "0.1"
# Arbitrary-precision transcendentals with correct rounding (128-bit precision)
astro-float = "0.9"
# Pure-Rust libm port for f64 special functions not in std (erf, gamma, …).
# Used where BigDecimal precision would be overkill (statistics, physics).
libm = "0.2"
# DateTime with IANA timezone support (embedded timezone database)
jiff = { version = "0.2", features = ["serde"] }
# Portable SIMD (auto-dispatches SSE2/AVX2/AVX-512/NEON)
wide = "0.7"
# Cryptographic hashes (pure-Rust RustCrypto suite)
md-5 = "0.10"
sha1 = "0.10"
sha2 = "0.10"
# Encoding utilities (all pure Rust, no C deps)
base64 = "0.22"
urlencoding = "2"
crc32fast = "1"
hex = "0.4"
# Logging to stderr (stdio transport requires stdout clean)
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
# Lazy statics for lookup tables (Rust 1.80+ has OnceLock/LazyLock in std)
# Low-level system calls for the non-blocking stdio transport (Unix only).
# Already a transitive dep of tokio, made explicit here because we call
# `fcntl`/`read`/`write` directly in `transport::async_stdio`.
[target.'cfg(unix)'.dependencies]
libc = "0.2"
[dev-dependencies]
approx = "0.5"
pretty_assertions = "1"
# Release profile: aggressive optimization, CPU-native by default via .cargo/config.toml
[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
panic = "abort"
strip = true
debug = false
# Portable release: override with `cargo build --profile release-portable`
# Build with RUSTFLAGS="-C target-cpu=x86-64-v3" for broad compatibility while keeping AVX2.
[profile.release-portable]
inherits = "release"
# Dev profile: tuned for fast incremental builds
[profile.dev]
opt-level = 0
debug = true
incremental = true