{"name":"io.github.The-40-Thieves/codecalc","slug":"the-40-thieves-codecalc","title":"codecalc","description":"Code & logic calculator for AI agents: 31 languages, symbolic math, SMT/logic solving, Big-O.","url":"https://mcp.market/server/the-40-thieves-codecalc","rating":null,"grade":"B","score":83,"certified":false,"status":"active","category":"other","tags":[],"presence":{"score":21,"stars":3,"forks":1,"downloads_week":null,"last_push_at":"2026-09-24T07:25:38.000Z","license":"Apache-2.0"},"uptime":null,"claimed":false,"transport":"pypi","callable_via_gateway":false,"default_price_micros":0,"repository":"https://github.com/The-40-Thieves/codecalc","website":null,"version":"0.13.0","remotes":[],"packages":[{"registryType":"pypi","registryBaseUrl":"https://pypi.org","identifier":"codecalc","version":"0.13.0","runtimeHint":"uvx","transport":{"type":"stdio"}}],"tools":[{"name":"_completion_languages","description":"Every registry key plus every alias, e.g. \"py\" alongside \"python3\".","write_action":false,"price_micros":0,"input_schema":null},{"name":"_tool","description":"Wrap `mcp.tool`, stamping the group taxonomy on registration.","write_action":false,"price_micros":0,"input_schema":null},{"name":"algebraic_equiv","description":"Are two expressions algebraically identical? 'is (a*b)/c the same as a*(b/c)?' answered exactly. Use symbolic(op=\"simplify\"), not this, to see one expression's own simplified/factored/expanded forms rather than compare two; use verify_translation to compare running PROGRAMS, not expressions. Caveat: symbolic identity says nothing about float rounding, integer truncation or modular overflow.","write_action":false,"price_micros":0,"input_schema":null},{"name":"analyze_complexity","description":"Estimate the asymptotic (Big-O) time complexity of a code snippet via structural analysis.","write_action":false,"price_micros":0,"input_schema":null},{"name":"benchmark","description":"Empirically measure time complexity by running code at increasing input sizes.","write_action":false,"price_micros":0,"input_schema":null},{"name":"bits","description":"Programmer-mode integer facts and operations, selected by `mode` — replaces the four former standalone tools bit_analysis, bitop, int_widths and base_repr, retired in 0.12.0 (CHANGELOG.md). Every mode returns exactly its former tool's own result, plus `mode` (additive).","write_action":false,"price_micros":0,"input_schema":null},{"name":"branch_reachability","description":"Which if/elif/else arms and while/for loops of this python3 function can ever run, which are dead code, and what inputs reach each — decided with z3, without running the program.","write_action":false,"price_micros":0,"input_schema":null},{"name":"calc_exact","description":"Use calc_exact, not evaluate_expression, for a literal arithmetic expression with no symbols in it. EXACT arithmetic: 0.1 + 0.2 == 0.3 is True here (False in plain Python).","write_action":false,"price_micros":0,"input_schema":null},{"name":"calc_stats","description":"Mean, median, sample stdev, and coefficient of variation (CV) for a sample of numbers. Pairs with percentiles for distribution shape (p50/p90/p95/p99) on the same sample, and with benchmark or verify_optimization, which are common sources of the timing samples this tool summarizes. CV > 0.2 flags run-to-run noise that swamps the effect. Returns n/mean/median/stdev/cv plus a cv_note.","write_action":false,"price_micros":0,"input_schema":null},{"name":"collision_probability","description":"Birthday-bound hash collision probability: 1 - exp(-n^2 / (2*2^b)).","write_action":false,"price_micros":0,"input_schema":null},{"name":"compare_edge_cases","description":"Run the same logic in N languages on edge-case inputs and flag divergence.","write_action":true,"price_micros":0,"input_schema":null},{"name":"compare_execution","description":"Run the same code in multiple languages side by side.","write_action":true,"price_micros":0,"input_schema":null},{"name":"compare_threshold","description":"Exact threshold check with a verdict and the shortfall when it fails. Use calc_exact, not this, when you want the computed VALUE rather than a threshold comparison.","write_action":false,"price_micros":0,"input_schema":null},{"name":"convert_units","description":"Convert a value between units (dimensional analysis via sympy).","write_action":false,"price_micros":0,"input_schema":null},{"name":"data_sizes","description":"Byte counts for a plain integer, both binary and decimal — the gap between them is where '291 MB' and '277 MiB' silently disagree by 5%. For units other than bytes, use convert_units. For a duration, not a byte count, use human_duration. Returns `bytes` plus `binary` and `decimal` dicts of unit -> value.","write_action":false,"price_micros":0,"input_schema":null},{"name":"deco","description":"","write_action":false,"price_micros":0,"input_schema":null},{"name":"epoch_time","description":"Epoch seconds/millis/micros/nanos to ISO 8601 UTC (implausible readings suppressed).","write_action":false,"price_micros":0,"input_schema":null},{"name":"evaluate_expression","description":"Use evaluate_expression, not calc_exact, for something other than plain arithmetic on literal values. Symbolically evaluate to a value or closed form via sympify: 'sqrt(144) + 2**10'. Not simplification — for simplified/factored/expanded forms, use symbolic(op=\"simplify\").","write_action":false,"price_micros":0,"input_schema":null},{"name":"execute_code","description":"","write_action":true,"price_micros":0,"input_schema":null},{"name":"execute_code_stream","description":"Execute code and STREAM progress + partial output as it runs. Use this, not execute_code/run_submit/session_run, for the same run when you want output while it runs, up to a 300s cap.","write_action":true,"price_micros":0,"input_schema":null},{"name":"extract_function","description":"Extract a named function (with its imports + referenced helpers) into a standalone program and run it in the sandbox.","write_action":false,"price_micros":0,"input_schema":null},{"name":"float_repr","description":"What binary64 actually stores for X: exact value, raw bits, ULP, both neighbours, and whether the literal is representable. `float_repr(0.1)` shows 0.1000000000000000055511151231257827...; `float_repr(0.25)` says EXACT. Above 2^53 warns consecutive integers are indistinguishable.","write_action":false,"price_micros":0,"input_schema":null},{"name":"human_duration","description":"Convert a SPAN of elapsed seconds into a humanised duration (e.g. '2d 3h 4m 5s') plus per-day and per-30d rates. For an epoch timestamp to a calendar date, use epoch_time instead. For byte counts, not seconds, use data_sizes. Returns `human`, `per_day`, `per_30d`, and the echoed `seconds`.","write_action":false,"price_micros":0,"input_schema":null},{"name":"install_package","description":"Install a package for a language (uv pip / npm / gem / go get / cargo add...).","write_action":false,"price_micros":0,"input_schema":null},{"name":"list_execution_providers","description":"List execution providers (execution BACKENDS — local subprocess, gVisor-strict, remote) and their machine-readable capabilities.","write_action":false,"price_micros":0,"input_schema":null},{"name":"list_languages","description":"List every language codecalc can execute, with extension, compile flag, and what this machine resolved. `status` is `installed` (its command was found on the sandbox PATH) or `supported` (nothing for it here); `status_basis` is `resolved`, meaning nothing was executed to check. Run `codecalc doctor --deep` to promote a runtime to `available` by actually running it.","write_action":false,"price_micros":0,"input_schema":null},{"name":"list_units","description":"List every supported unit alias — all aliases and spellings — for convert_units.","write_action":false,"price_micros":0,"input_schema":null},{"name":"matrix","description":"Structured matrix operations: det, inverse, eigenvalues, transpose, rank, trace.","write_action":false,"price_micros":0,"input_schema":null},{"name":"percent_change","description":"Exact percent change from FROM_VALUE to TO_VALUE. Use percentage, not this, for PART / TOTAL rather than a before/after change.","write_action":false,"price_micros":0,"input_schema":null},{"name":"percentage","description":"Exact share and percentage of PART / TOTAL. Use calc_exact for a single arithmetic expression, or compare_threshold to check the result against a threshold rather than just compute it.","write_action":false,"price_micros":0,"input_schema":null},{"name":"percentiles","description":"p50/p90/p95/p99 (the 50th/90th/95th/99th percentile cutoffs) by nearest-rank AND linear interpolation. Pairs with calc_stats, which gives mean/median/stdev/CV on the same sample instead of these distribution points.","write_action":false,"price_micros":0,"input_schema":null},{"name":"physical_constants","description":"Look up a physical constant (speed_of_light, planck, avogadro, gravity, electron_mass, gas_constant, ...) or list all 22 with values.","write_action":false,"price_micros":0,"input_schema":null},{"name":"radix_convert","description":"Convert a value between ANY bases 2..36, fractions included; bases that cannot represent the fraction (e.g. 0.1 in base 2) are flagged non-terminating. `radix_convert('zz', 36, 7)` is one call.","write_action":false,"price_micros":0,"input_schema":null},{"name":"run_cancel","description":"Cancel a background run started with run_submit.","write_action":true,"price_micros":0,"input_schema":null},{"name":"run_inspect","description":"Poll a background run started with run_submit.","write_action":true,"price_micros":0,"input_schema":null},{"name":"run_submit","description":"Submit code for BACKGROUND execution; returns a run_id immediately. Use this, not execute_code/execute_code_stream/session_run, when you do not want to hold the call open — poll run_inspect(run_id), and run_cancel(run_id) to stop it early.","write_action":true,"price_micros":0,"input_schema":null},{"name":"runtimes_status","description":"Check every language runtime for available updates (NON-MUTATING).","write_action":false,"price_micros":0,"input_schema":null},{"name":"session_artifacts","description":"List files created by executed code in a session (excluding runner internals like main.py/run.out).","write_action":false,"price_micros":0,"input_schema":null},{"name":"session_delete_file","description":"Delete one file (or symlink entry — never the directory or symlink's target) from a session workspace. This is the recovery path when a session is refused for being over CODECALC_MAX_ARTIFACT_COUNT: neither session_write_file (creates/overwrites, never removes) nor session_run/ execute_code (refused by the same cap) can shrink the count, so this is the only in-session way to get back under it shor","write_action":true,"price_micros":0,"input_schema":null},{"name":"session_files","description":"List workspace files, optionally using a bounded cursor page. Use session_artifacts, not this, for only the files executed code produced; use session_read_file for one file's contents.","write_action":false,"price_micros":0,"input_schema":null},{"name":"session_list","description":"List active sessions and their languages/state.","write_action":false,"price_micros":0,"input_schema":null},{"name":"session_read_file","description":"Read a file from a session workspace.","write_action":false,"price_micros":0,"input_schema":null},{"name":"session_run","description":"Run a multi-file program already written into a session workspace (via session_write_file). Use this, not execute_code/execute_code_stream/run_submit, when `entry_file` may import other files already in that workspace (helper.py, data/...).","write_action":true,"price_micros":0,"input_schema":null},{"name":"session_snapshot","description":"Archive or restore a session's workspace files. `action`:","write_action":false,"price_micros":0,"input_schema":null},{"name":"session_start","description":"Start a persistent session. python3/node get a stateful REPL worker (variables/imports persist across execute_code calls); other languages get a persistent workspace directory. Returns session_id.","write_action":false,"price_micros":0,"input_schema":null},{"name":"session_stop","description":"Stop a session: kill its REPL worker (if any) and delete its workspace. Also deletes every session_snapshot saved for it, unless keep_snapshots=True.","write_action":false,"price_micros":0,"input_schema":null},{"name":"session_write_file","description":"Write a file into a session workspace (relative path, no escapes). Use this to seed input data for executed code.","write_action":true,"price_micros":0,"input_schema":null},{"name":"start","description":"Create a session: fresh workspace dir; REPL worker for supported langs.","write_action":true,"price_micros":0,"input_schema":null},{"name":"symbolic","description":"Symbolic algebra, selected by `op` — replaces the four former standalone tools solve_expression, solve_linear, simplify_expression and limit_expression, retired in 0.12.0 (CHANGELOG.md). Every op returns exactly its former tool's own result, plus `op` (additive).","write_action":false,"price_micros":0,"input_schema":null},{"name":"trace_execution","description":"","write_action":false,"price_micros":0,"input_schema":null},{"name":"truth_table","description":"Build the truth table for a boolean expression over and/or/not/xor/ implies/iff (plus true/false constants and variables): 'a and b or not c', 'p xor q', 'a implies b'. Use z3_check, not this, for satisfiability over inequalities or non-boolean variables; use evaluate_expression for symbolic (non-boolean) math.","write_action":false,"price_micros":0,"input_schema":null},{"name":"update_runtimes","description":"Update language runtimes. SAFE BY DEFAULT: with apply=False this is a dry run — it returns the update commands that WOULD run without changing anything. Pass apply=True to actually execute them (mise up, rustup update, swiftly update, apt-get upgrade of language packages, npm -g update, uv tool upgrade).","write_action":true,"price_micros":0,"input_schema":null},{"name":"verify_optimization","description":"PROVE an optimisation: same outputs, measurably AND SIGNIFICANTLY faster.","write_action":false,"price_micros":0,"input_schema":null},{"name":"verify_translation","description":"PROVE that a port is equivalent: run both programs, compare their output.","write_action":false,"price_micros":0,"input_schema":null},{"name":"z3_check","description":"Use z3_check, not symbolic(op=\"solve\"), for satisfiability over inequalities, boolean combinations, or several variables at once: sat/ unsat/unknown plus a model. Example: '(declare-const x Int)(assert (> x 5))(check-sat)'.","write_action":false,"price_micros":0,"input_schema":null}],"scan":{"score":83,"grade":"B","scanned_at":"2026-10-02T06:13:28.332Z","report":{"scannerVersion":"0.1.10","scannedAt":"2026-10-02T06:13:28.403Z","components":{"code":{"score":20,"max":25,"notes":["53 source files scanned"]},"reliability":{"score":-1,"max":20,"notes":["no gateway calls yet and no remote to probe"]},"poisoning":{"score":-1,"max":15,"notes":["tools not inspected (local package is not executed); not counted"]},"auth":{"score":12,"max":15,"notes":["local package, no credentials required"]},"maintenance":{"score":15,"max":15,"notes":["last push 8 days ago"]},"identity":{"score":7,"max":10,"notes":["registry namespace matches repository owner"]}},"findings":[{"id":"exec.eval","severity":"medium","component":"code","title":"eval / new Function used","evidence":"x/codecalc/branch_reachability.py: …indexing, not the model's own `.eval(..., model_completion=True)` — this pack…"}],"inputs":{"packages":[{"registryType":"pypi","identifier":"codecalc","version":"0.13.0","found":true,"license":"Apache-2.0","dependencyCount":8,"publishedAt":"2026-09-21T23:38:23.800627Z","repositoryUrl":"https://github.com/The-40-Thieves/codecalc"}],"repo":{"found":true,"owner":"The-40-Thieves","repo":"codecalc","archived":false,"pushedAt":"2026-09-24T07:25:38Z","stars":3,"forks":1,"openIssues":0,"ownerType":"Organization","ownerAvatarUrl":"https://avatars.githubusercontent.com/u/278549586?v=4","ownerCreatedAt":"2026-04-23T00:50:02Z","license":"Apache-2.0"},"icon":{"url":null,"source":"none"},"presence":{"stars":3,"forks":1,"downloadsWeek":null,"license":"Apache-2.0","lastPushAt":"2026-09-24T07:25:38.000Z","score":21}}}},"grade_history":[],"reviews":[]}