Atlas / MCP servers / yogthos / Chiasmus

ChiasmusCAUTION

mcp/yogthos/chiasmus

Chiasmus is an MCP server that gives language models access to formal verification

Verdict
CAUTION
Grade
B
Trust score
89 /100
Exposed tools
65 61r · 4w · 0d
Transport
stdio
License
Apache-2.0
Stars
214
01

Overview

From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.

MCP server that gives LLMs access to formal verification via Z3 (SMT solver) and SWI-Prolog (via prolog-wasm-full, includes library(clpfd)), plus tree-sitter-based source code analysis. Translates natural language problems into formal logic using a template-based pipeline, verifies results with mathematical certainty, and analyzes call graphs for reachability, dead code, and impact analysis.

Example use cases

  • "Can our RBAC rules ever conflict?" → Z3 finds the exact role/action/resource triple where allow and deny both fire
  • "Find compatible package versions" → Z3 solves dependency constraints with incompatibility rules, returns a valid assignment or proves none exists
  • "Can user input reach the database?" → Prolog traces all paths through the call graph, flags taint flows to sensitive sinks
  • "Are our frontend and backend validations consistent?" → Z3 finds concrete inputs that pass one but fail the other (e.g. age=15 passes frontend min=13 but fails backend min=18)
  • "Does our workflow have dead-end or unreachable states?" → Prolog checks reachability from the initial state, identifies orphaned and terminal nodes
  • "What's the dead code in this module?" → tree-sitter parses source files, Prolog finds functions unreachable from any entry point
  • "What breaks if I change this function?" → call graph impact analysis shows all transitive callers
  • "Do a full code review of these files" → chiasmus_review returns a phased recipe of graph analyses + verification templates, and you execute it step-by-step

Setup

npm install -g chiasmus

Claude Code

claude mcp add chiasmus -- npx -y chiasmus

Or add to ~/.claude/settings.json:

{
"mcpServers": {
"chiasmus": {
"command": "npx",
"args": ["-y", "chiasmus"]
}
}
}

Crush

Add to crush.json:

{
"mcp": {
"chiasmus": {
"type": "stdio",
"command": "npx",
"args": ["-y
Read from source at commit 4479e3f8fc7aOBSERVED · 2026-10-06
02

Connect

Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.

claude-code
claude mcp add chiasmus --env ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} --env AZURE_OPENAI_API_KEY=${AZURE_OPENAI_API_KEY} --env DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY} --env OPENAI_API_KEY=${OPENAI_API_KEY} -- npx -y [email protected]
claude-desktop
{
  "mcpServers": {
    "chiasmus": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}",
        "AZURE_OPENAI_API_KEY": "${AZURE_OPENAI_API_KEY}",
        "DEEPSEEK_API_KEY": "${DEEPSEEK_API_KEY}",
        "OPENAI_API_KEY": "${OPENAI_API_KEY}"
      }
    }
  }
}
03

Exposed tools (65)

61 read · 4 write · 0 destructive.

ToolRiskDescription
access_rulesreadOR of conditions that grant access
action_typereadType name for actions
allow_rulesreadOR of all allow conditions — each is (and (= r X) (= a Y) (= res Z))
call_factsreadProlog facts of the form calls(Function, Operation) — which function calls which operation
chiasmus_formalizereadFind best template for problem → return skeleton + slot-filling instructions + tips. Guided workflow: 1. chiasmus_formalize → get template + slots + tips 2. Fill slots using your context 3. chiasmus_verify → verified result
chiasmus_learnwriteExtract reusable template from verified solution → add to skill library. Generalizes concrete spec into parameterized template. Stored as candidate → promoted after 3+ successful reuses. Needs API key. Flow: chiasmus_verify → chiasmus_learn → template appears in chiasmus_skills.
chiasmus_lintreadFast structural validation of formal spec without running solver. Auto-fixes: markdown fences, (check-sat)/(get-model), (set-logic). Checks: balanced parens, unfilled {{SLOT:}} markers, missing periods (Prolog). Returns cleaned spec + fixes applied + remaining errors.
chiasmus_mapreadPre-built codebase map — read before bulk file reads. Returns a compact outline derived from the tree-sitter call graph: per-file headlines with exports, signatures, token estimates, leading doc. Lets you answer
chiasmus_reviewwritePhased code-review recipe — which tools to run, in what order, what to flag. Pure plan, no side effects. Execute phases sequentially; each action carries
chiasmus_skillsreadSearch/list formalization templates. Returns skeletons, slots, normalization recipes, usage metadata. Find template before chiasmus_verify or chiasmus_formalize. query:
chiasmus_solvereadEnd-to-end: select template → fill slots → lint → verify → correction loop. Needs ANTHROPIC_API_KEY | DEEPSEEK_API_KEY | OPENAI_API_KEY. Without key → falls back to chiasmus_formalize. Returns: solver result + template used + correction history. NOTE: \
computationreadExpression computing the result from inputs
conditionreadTest condition
config_a_exprreadBoolean expression for config A
config_b_exprreadBoolean expression for config B
declarationsreadVariable declarations
deny_rulesreadOR of all deny conditions — each is (and (= r X) (= a Y) (= res Z))
dependenciesreadDependency edges
dependency_rulesreadConditional version requirements. Use (=>) for
domain_constraintsreadBoolean expression constraining valid input ranges (single expression)
edgesreadDirect edges as edge(from, to) facts
extra_slotreadExtra
factsreadGround facts about the domain
field_declarationsreadDeclare variables for each input field
flow_factsreadProlog facts of the form flows(From, To) — data flow from one function/variable to another
function_bodyreadSMT-LIB assertions defining the input→output relationship (the function
incompatibility_rulesreadPairs of versions that cannot coexist
inputreadtest input
input_declarationsreadDeclare input variables covering the input space
labelreadThe label/property name to propagate (used as both predicate name and prefix)
permissionsreadWhat each role can do
postconditionreadBoolean expression the result should satisfy (will be negated to find violations)
preconditionreadBoolean expression constraining valid inputs (wrapped as single expression)
principal_typereadType name for principals
range_a_constraintsreadFirst port range bounds
range_b_constraintsreadSecond port range bounds
range_constraintsreadConstrain each package to its available versions using (or (= pkg v1) (= pkg v2) ...)
range_declarationsreadPort range variables
required_pairsreadProlog facts of the form required_pair(OperationA, OperationB) — B must appear whenever A appears
resource_typereadType name for resources
result_declarationsreadDeclare output/result variables
result_typereadType of the result variable
role_assignmentsreadWhich users have which roles
role_hierarchyreadRole inheritance relationships
rule_areadFirst rule expression
rule_breadSecond rule expression
rule_set_a_conditionswriteConjunction of conditions for rule set A (e.g. frontend validation)
rule_set_b_conditionswriteConjunction of conditions for rule set B (e.g. backend validation)
rulesreadProlog rules that derive conclusions from facts
sanitizersreadProlog facts of the form sanitize(Node) — functions that clean/escape tainted data
seed_labelsreadProlog facts of the form label(Function) — functions with known classification
sinksreadProlog facts of the form sink(Node) — security-sensitive operations that must not receive tainted data
source_statereadThe source state to check
state_declarationsreadSMT-LIB declare-datatypes for all states in the machine
state_typereadType name for the state enumeration
subjectreadthe subject atom
taint_sourcesreadProlog facts of the form taint_source(Node, TaintType) — origins of untrusted data
target_principalreadThe principal to check
target_resourcereadThe resource to check
target_statereadThe target state to check reachability for
transitionsreadOR of valid transition pairs — each is (and (= from S1) (= to S2))
type_declarationsreadSMT-LIB declare-datatypes for principals, actions, resources
version_declarationsreadDeclare an Int variable for each package version
violation_conditionreadThe condition that would indicate a bug (result out of bounds, negative, overflow, etc.)
xreadtest
04

Trust audit

CAUTIONgrade B · trust 89/100 Install with care. The audit found things worth knowing before you trust its output.

LayerWhat it checksResult
L0Provenance & inventoryWARN
L1Static analysis of the codePASS
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
declared (1 observation(s))
Network
declared (4 observation(s))
Shell
none-observed
Dependencies
not all pinned
Secrets in source
none-found

Findings (8)

MEDIUMInventory / provenance · inv.binary · CWE-1104
grammars/tree-sitter-commonlisp.wasm
tree-sitter-commonlisp.wasm
Why it matters. a compiled or binary member cannot be reviewed from source
Fix. ship source, or explain the binary in the README
MEDIUMInventory / provenance · inv.binary · CWE-1104
grammars/tree-sitter-scheme.wasm
tree-sitter-scheme.wasm
Why it matters. a compiled or binary member cannot be reviewed from source
Fix. ship source, or explain the binary in the README
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
benchmark/chiasmus/p1-rbac.ts:1
import { createZ3Solver } from "../../src/solvers/z3-solver.js";
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
benchmark/chiasmus/p2-deps.ts:1
import { createZ3Solver } from "../../src/solvers/z3-solver.js";
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
benchmark/chiasmus/p3-taint.ts:1
import { createPrologSolver } from "../../src/solvers/prolog-solver.js";
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
benchmark/chiasmus/p4-workflow.ts:1
import { createPrologSolver } from "../../src/solvers/prolog-solver.js";
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
benchmark/chiasmus/p5-validation.ts:1
import { createZ3Solver } from "../../src/solvers/z3-solver.js";
LOWSupply chain · supply.unpinned · CWE-829, CWE-1357
package.json
@modelcontextprotocol/sdk, @yogthos/tree-sitter-clojure, better-sqlite3, graphology, graphology-communities-louvain, graphology-metrics, prolog-wasm-full, proper-lockfile
Why it matters. 24 dependency range(s) float
Fix. pin exact versions or ship a lockfile

Gates applied: no_behavioural_pass.

Audited 2026-10-06 · audit v0.4.1 · source sha 4479e3f8fc7afull audit observations/trust-audit/mcp-server/yogthos__chiasmus.json · Report an issue / request a re-scan
05

Audit history

Every audit this server has had. A grade with a past is a grade somebody is still checking.

DateSourceVerdictGradeScoreChange
2026-10-064479e3f8fc7aCAUTIONB89first audit
06

Questions

What is the Chiasmus MCP server?

Chiasmus is an MCP server that gives language models access to formal verification

What tools does Chiasmus expose?

65 in total: 61 read-only, 4 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.

Is Chiasmus safe to connect to an agent?

With care. The audit graded it B (89/100) and found 8 things worth knowing before you trust this server, listed below with the exact line each was found on.

What credentials does Chiasmus need?

It reads ANTHROPIC_API_KEY, AZURE_OPENAI_API_KEY, DEEPSEEK_API_KEY, OPENAI_API_KEY and OPENROUTER_API_KEY from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.

How does Chiasmus run?

It speaks stdio, so it runs as a local process your client starts. It is published on npm as chiasmus at 0.1.28.

How current is this page?

The grade is for one exact copy of the source (4479e3f8fc7a), read on 2026-10-06. The repository is watched and re-audited when it changes.

Advertisement