Ajisai

Official registry Other

Exact rational and algebraic computation, with machine-readable Word contracts, in Ajisai.

Install

Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).

NPM package ajisai-mcp-server
Claude Code
claude mcp add ajisai -- npx -y ajisai-mcp-server@0.9.0
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "ajisai": {
            "command": "npx",
            "args": [
                "-y",
                "ajisai-mcp-server@0.9.0"
            ]
        }
    }
}

Documentation

From the project's README on GitHub, refreshed weekly. Links open on GitHub.

Contents
  1. Ajisai
  2. What Ajisai can do
  3. Why Ajisai
  4. Status
  5. Documentation
  6. Build and run
  7. License

Build and Deploy status

Ajisai

Ajisai is a stack-based, vector-oriented dataflow language whose true user is AI. Numbers are never rounded, dividing by zero never stops a program, and truth is three-valued, as in SQL. There is nowhere to write a type; rigor lives in the machine-readable contracts the Words carry.

[ 1 2 3 ] [ 1 0 2 ] DIV    # [ 1/1 1/0 3/2 ]

What Ajisai can do

  • Exact arithmetic. Integers and decimals alike are exact rationals, and SQRT keeps its results as algebraic irrationals. There is no choosing between float, double and decimal. 0.1 0.2 ADD 0.3 EQ is TRUE, and a sum or a product is one value in whatever order its operands are taken, points over zero included, so reordering or regrouping a FOLD never changes its answer.
  • Division that never stops. Dividing by zero answers a point over zero, 1/0 or 0/0, which is a number. In a vector computation only the element divided by zero is affected.
  • Vector computation without loops. Arithmetic Words lift over vectors automatically, and SELECT branches element by element. Collections are processed with MAP, FILTER and FOLD.
  • Failure with a reason. An operation that cannot produce a value answers a NIL carrying its reason, and that NIL flows on downstream. Evaluation stops only when the operation or the shape of its input is itself wrong, or when a program exceeds the limits the host can support.
  • Checking before running. Every Word carries a contract stating what it takes and how many, whether it is pure, and what it returns when it cannot produce a value. User-defined Words are checked against these contracts before anything runs.
  • Use from AI. Through the MCP server, an AI can run Ajisai code and check its contracts.

Why Ajisai

I had given up partway on every programming language I tried, and I wanted to build the tool itself rather than something with it. Forth showed me that a language is allowed to be that small. I still wanted the rigor of types without writing them, so Ajisai carries that rigor in contracts on the Words instead of annotations on values.

AI made the design practical. With AI writing the code alongside me, a language needs no syntactic sugar for human convenience; it can hold nothing but strict machine-readable rules and plain dataflow.

The arithmetic is not new: it is Carlström's wheel of fractions over the integers. What Ajisai adds is that every contract says, before anything runs, whether the code can reach a point over zero (field=closed or field=leaving).

I began the work in June, in Japan's rainy season. Watching the rain, I pictured fractions poured into a vessel called a Vector: one substance inside, never rounded, and rich ripples on its surface. The hydrangea — ajisai in Japanese — takes its scientific name, Hydrangea, from the Greek for "water vessel".

Status

Release stageBeta Implementation version1.0.0-beta.3 Specification version1.0.0-beta.3 — what changed in each version is in spec/CHANGELOG.md SpecificationGenerated from the semantic sources in spec/ — see spec/README.md Compatibility promiseFrom 1.0.0. Until then a breaking change raises the specification version, and npm run check:spec-version refuses one that does not

Documentation

DocumentAudienceRendered at
SpecificationBuilders and portersSPECIFICATION.html
Reference (English)Ajisai usersdocs/en/index.html — from a program down to its elements and every built-in Word with its contract (generated from spec/words.json), with runnable samples
Reference (Japanese)Ajisai usersdocs/ja/index.html — the same content in Japanese
PhrasebookAjisai usersdocs/phrasebook/phrasebook.ajisai — User Words for phrases programs write again and again (a remainder, a disjunction, a sum or mean, text joined with a separator), each with a verified contract and examples. Run it once, or copy the definitions you need
ShowcaseAnyone weighing Ajisaidocs/showcase/showcase.ajisai — short programs beside what binary floating point would answer: decimals that add up, Fibonacci numbers from Binet's formula through exact square roots, division by zero inside a Vector, and contracts that say before running whether code can reach a point over zero. Every example is run by the test suite
PlaygroundRun it nowmasamoto1982.github.io/Ajisai — its Reference button opens the Reference in the UI language, English or Japanese

Build and run

TaskCommand
Install dependenciesnpm ci
Dev servernpm run dev
Build the WASM corenpm run build:wasm
Build for the browsernpm run build
Build the desktop app (Tauri)npm run tauri:build
Run the Rust test suitecargo test --all-targets (in rust/)
Prove the formal-verification harnessescargo kani (in rust/; setup and scope in docs/quality/FORMAL_VERIFICATION.md)

The MCP server for AI agents lives in tools/mcp-server/.

License

MIT — see LICENSE.

Frequently asked questions

What is Ajisai?

Exact rational and algebraic computation, with machine-readable Word contracts, in Ajisai.

How do I install Ajisai?

It runs on your machine. In Claude Code: claude mcp add ajisai -- npx -y ajisai-mcp-server@0.9.0. For other clients, paste the JSON configuration from this page into their MCP settings.

Does Ajisai need an API key?

Its registry entry lists no required key or secret. Some features may still need an account with the service it connects to.

Is Ajisai open source?

Yes. Its code is on GitHub under the MIT license.

Who maintains Ajisai?

It is published by masamoto1982. AI.tn lists it but does not maintain or endorse it.

From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.