Skip to main content
Glama
deterministic-logic

deterministic-logic

by SamSoupSauce

Deterministic Logic Evaluation MCP Toolkit (deterministic-logic-mcp)

A Model Context Protocol (MCP) server providing high-performance, deterministic logic evaluation tools for AI assistants and automated systems.

Features & Logic Engines

  1. Propositional Logic & AST Evaluator: Parse and evaluate boolean expressions with full variable mapping. Supports &&, ||, !, ^ (XOR), => (IMPLIES), <=> (IFF), and custom operator notation.

  2. Truth Table Generator: Compute complete $2^N$ truth tables, check tautologies, contradictions, and satisfiability.

  3. DPLL SAT Solver: Convert formulas to Conjunctive Normal Form (CNF) and find satisfying variable assignments or prove UNSAT.

  4. JSON Logic Rule Engine: Deterministic evaluation of structured rules (boolean, arithmetic, comparison, array filters/maps, conditional branching) against JSON datasets.

  5. Decision Table Engine: Grid-based rule evaluation with support for wildcards, first_match, all_matches, and strict_single_match (determinism verification).

  6. State Machine Analyzer & Verifier: Check Finite State Machines (FSMs) for determinism, deadlocks, unreachable states, and state reachability path extraction.


Related MCP server: Logic-Thinking MCP Server

πŸ› οΈ MCP Tools Reference

Tool Name

Description

Key Arguments

evaluate_boolean

Evaluates a boolean logic expression with variable values

expression, env

generate_truth_table

Generates full truth table & computes Tautology / Contradiction

expression, maxVariables

solve_sat

DPLL SAT solver returning satisfying variable assignment or UNSAT

expression

evaluate_json_logic

Evaluates JSON logic rules against context JSON data

rule, data

evaluate_decision_table

Evaluates matrix decision table rules with determinism checks

rows, inputs, mode

analyze_state_machine

Checks FSM for determinism, deadlocks, and unreachable states

initialState, transitions, terminalStates

verify_state_reachability

Finds shortest execution path to target state in FSM

initialState, transitions, targetState

simulate_state_machine

Simulates an input sequence through an FSM step-by-step

initialState, transitions, inputSequence


πŸš€ Quickstart & Setup

Building Locally

npm install
npm run build
npm test

Configuring in MCP Clients (e.g. Claude Desktop, Cursor, AGY)

Add the following to your mcpServers configuration file (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "deterministic-logic": {
      "command": "node",
      "args": ["/home/mrovkill/Projects/deterministic-logic/dist/index.js"]
    }
  }
}

Or run directly via npx / tsx:

{
  "mcpServers": {
    "deterministic-logic": {
      "command": "npx",
      "args": ["tsx", "/home/mrovkill/Projects/deterministic-logic/src/index.ts"]
    }
  }
}

πŸ’‘ Example Tool Usage

1. Truth Table Generation

Input: expression = "A => (B => A)"
Output: isTautology = true, isSatisfiable = true, truthTable rows showing all evaluated combinations.

2. DPLL SAT Solving

Input: expression = "(A || B) && (!A || B) && (!B)"
Output: satisfiable = false (UNSAT).

3. JSON Logic Rule Execution

Input:

{
  "rule": {
    "and": [
      { ">": [{ "var": "user.age" }, 18] },
      { "in": [{ "var": "user.role" }, ["admin", "editor"]] }
    ]
  },
  "data": { "user": { "age": 25, "role": "admin" } }
}

Output: result = true.


πŸ“„ License

MIT

Available Tools

8 tools
analyze_state_machineA

Formally analyzes a Finite State Machine (FSM) for determinism, unreachable states, and deadlock states.

Inputs: transitions (required), initialState (required), states, terminalStates.

evaluate_booleanA

Evaluates a boolean logic expression given a variable assignment map. Operators: &&, ||, !, ^ (XOR), => (IMPLIES), <=> (IFF).

Inputs: env (required), expression (required).

evaluate_decision_tableB

Evaluates a matrix of decision rules against input context. Checks table for completeness and determinism.

Inputs: rows (required), inputs (required), mode.

evaluate_json_logicA

Evaluates deterministic JSON Logic rules against a context dataset. Supports boolean, comparisons, math, conditionals, and array rules.

Inputs: rule (required), data.

generate_truth_tableA

Generates a complete truth table for a boolean logic expression and analyzes whether it is a Tautology, Contradiction, or Satisfiable.

Inputs: expression (required), maxVariables.

simulate_state_machineC

Simulates a sequence of inputs step-by-step through a state machine deterministically.

Inputs: transitions (required), initialState (required), inputSequence (required).

solve_satA

DPLL SAT solver for boolean satisfiability. Converts expression to Conjunctive Normal Form (CNF) and finds satisfying assignments or proves UNSAT.

Inputs: expression (required).

verify_state_reachabilityA

Checks whether a target state can be reached from the initial state in a state machine, returning the shortest path execution sequence.

Inputs: targetState (required), transitions (required), initialState (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool targets a distinct aspect of logic and state machine analysis: boolean logic evaluation, truth table generation, SAT solving, JSON logic evaluation, decision table analysis, FSM analysis, reachability, and simulation. No significant overlap.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern (evaluate_boolean, generate_truth_table, solve_sat, etc.), with clear verbs and specific nouns. The naming is predictable and easy to understand.

    Tool Count5/5

    Eight tools is well-scoped for the domain, covering boolean logic, SAT, JSON logic, decision tables, and state machines without being too few or too many. Each tool serves a clear purpose.

    Completeness4/5

    The tool surface covers core operations for boolean logic (evaluate, truth table, SAT) and state machines (analysis, reachability, simulation). Minor gaps exist (e.g., no JSON logic validation, no state machine minimization) but do not hinder primary workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables first-order logic reasoning including theorem proving, model finding, counterexample detection, and category theory diagram verification using pure TypeScript with no external dependencies.
      13
      4
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables formal logical reasoning, mathematical problem-solving, and proof construction across 11 logic systems including propositional, predicate, modal, fuzzy, and probabilistic logic. Integrates external solvers (Z3, ProbLog, Clingo) for advanced reasoning, with support for proof storage, argument scoring, and cross-system translation.
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides deterministic tools for symbolic math, equation solving, relation verification, reasoning structure audits, and validated CAD primitives, returning evidence artifacts for every result.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides deterministic decision and constraint evaluation for AI agents. Supports ruleset validation, fact evaluation, and constraint checking via MCP tools.
      Apache 2.0