Home Applications ascot

ascot

by KC Lu
Community Project
This project is maintained by its author and is not officially supported by InterSystems. For technical support, please contact the project developer.
4
1 reviews
0
Awards
146
Views
0
IPM installs
0
Add to bundle
Details
Releases (4)
Reviews (1)
Issues
Articles (1)
A static analyzer, type checker, and code intelligence engine for InterSystems ObjectScript. Use it as a CLI tool, from AI agents via MCP or LSP protocols (including Claude Code plugins), or via the InterSystems Language Server (WIP).

What's new in this version

See GitHub release notes for details.

Ascot

crates.io
npm
Claude Code plugins

Ties together knowledge from across your ObjectScript code base.

A type checker and code intelligence engine for InterSystems ObjectScript.
Use it as a CLI tool, from AI agents via
MCP or LSP protocols
(including Claude Code plugins), or via the
InterSystems Language Server.

Features

  • Diagnostics: flow-sensitive type checking — undefined-variable reads,
    assigned-but-never-read locals, argument count/mode mismatches, missing
    QUIT/RETURN, inconsistent variable declarations across branches, and
    more.
  • Document/Workspace Symbols: navigate classes and class members within a
    file or across the workspace.
  • Go to Definition/Find References: for classes, class members, and
    same-routine labels/gotos.
  • Hover: type and signature info, or macro expansion (.mac/.int only) on
    hover.
  • Inlay Hints: inferred types, argument names, and parameter default
    values shown inline.
  • Formatting: procedure blocks and method bodies brought to the configured
    style, keyword spelling and brace placement, from every host: ascot format
    on the CLI, ascot::format in the library, the WIT format and
    code-actions exports, LSP formatting and code actions (a quick fix per
    diagnostic the formatter would rewrite), and the MCP format tool.

Installation

GitHub release

Prebuilt ascot binaries for Linux, macOS and Windows are attached to each
GitHub release.

On macOS, Gatekeeper refuses to run the unsigned binary once a browser download
has quarantined it. Homebrew avoids this; otherwise
download it with curl:

curl -L https://github.com/intersystems-community/ascot/releases/latest/download/ascot-cli-universal-apple-darwin.tar.gz | tar xz

or clear the flag on a browser download:

xattr -d com.apple.quarantine path/to/ascot

Homebrew (macOS and Linux)

From the
InterSystems Community tap:

brew trust intersystems-community/tap # if Homebrew 5.1.15 or later
brew install intersystems-community/tap/ascot

Rust (crates.io)

From crates.io/crates/ascot:

cargo install ascot

On Windows, building also needs the Visual Studio C++ build tools, which newer
rustup installers offer to set up; a build failing on link.exe or
kernel32.lib is missing them, see rustup’s
MSVC prerequisites.

As a library, ascot’s default features build everything the CLI has. A host that
needs only the checker turns them off and adds what it uses:

cargo add ascot --no-default-features --features network
  • analyze, declare, format, lsp, mcp: one subcommand of the CLI each, as a module
    where there is one (ascot::sarif, ascot::lsp, ascot::mcp); declare implies network.
  • network: ascot reaching the network itself, for a live IRIS instance over its REST API
    (RawAtelier, --iris http://...) and for a release’s pre-built declarations
    (--iris latest).
  • bundled-declarations: the default release’s pre-built declarations in the binary,
    ascot::BUNDLED_DECLARATIONS, for a host that resolves IRIS’s own classes with nothing
    downloaded; about 4 MB.

The CLI can be built from the same list: cargo install ascot --no-default-features --features analyze is an ascot with the analyze subcommand alone and no network code.

With no flag, the checker reads a workspace, a declaration file, a release whose file is already
in ~/.ascot, and a live instance the host connects to itself by implementing the Atelier trait
over its own transport, as the VS Code extension’s server does. Such a host can also carry a
release’s declaration asset itself, BUNDLED_DECLARATIONS with its feature or one it fetched, read
it once with Declarations::from_bytes and ask it before its instance with Chain, so the system
classes answer from the corrected declarations, the instance only for its own, and nothing is
downloaded.

TypeScript/JavaScript (npm)

From
npmjs.com/package/@intersystems-community/ascot:

npm install @intersystems-community/ascot

A library; it does not provide an ascot executable.

Usage

ascot help

Lists the commands, and ascot help <COMMAND> (or
ascot <COMMAND> --help) shows one’s options; the IRIS, style and diagnostics
ones are the settings described under Advanced Usage.

The code at the end of a message links to its page in the
diagnostics reference, one
per release: severity, message, when it fires, what IRIS does with such code,
and an example; on a terminal, analyze prints the code as that link. ascot diagnostics DIR
writes the pages.

ascot as a CLI tool

ascot analyze [--root DIR] ...

Loads every .cls/.mac/.int/.inc file under each PATH into one
workspace and prints diagnostics for all of them. With --root, the workspace
is every file under DIR instead, so cross-file references resolve, and the
PATHs choose whose diagnostics are printed; one outside DIR is skipped with
a warning. Exits non-zero if any error or warning was found, or if a PATH
doesn’t exist. A routine IRIS generated, Generated in its header as a class’s
compiled .int has, is loaded for navigation only: nothing is reported on it.

--format lsp prints the diagnostics of each file as JSON instead of text, in
the shape the MCP check tool returns them, and --format sarif one SARIF
2.1.0 document for code scanning. The summary stays on stderr and the exit code
is the same.

ascot format --style  [--indent N] [--check] ...

Rewrites every .cls/.mac/.int file under each PATH to the style:
command keywords take the form and case the command rules give them, and a
block’s braces, its first command and an Else, ElseIf or Catch after it go
on a line of their own or not as open_brace and close_brace say, and each
line sits at the depth indent gives it. Lines are added or joined only in
procedure blocks and method bodies, since no Label+offset reaches a line
inside them; a routine with such an offset keeps every line count, and the rest
stays as written but for its indentation, a line’s leading whitespace alone. A
line the formatter adds is indented like its block, one tab (or --indent N
spaces, or the indent rule’s unit) deeper for a body’s first command.
--check writes nothing and exits non-zero listing the files that would change.

ascot as an MCP server

ascot mcp

Starts the MCP server (stdio), exposing workspace analysis as tools an AI agent
calls on demand: create_workspace takes the settings, insert
each document’s text (or, with a shared file system, its
file:// uri); format returns a document’s text brought to the
style, as ascot format writes it, with the edits that get there. Any
MCP client that can launch a stdio server works: the command is ascot (or its
full path) and the single argument is mcp.

Claude Code:

claude mcp add ascot -- ascot mcp

OpenAI Codex CLI:

codex mcp add ascot -- ascot mcp

Cursor (.cursor/mcp.json), Claude Desktop (claude_desktop_config.json) and
Gemini CLI (~/.gemini/settings.json) share one shape:

{
  "mcpServers": {
    "ascot": { "command": "ascot", "args": ["mcp"] }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "ascot": { "type": "stdio", "command": "ascot", "args": ["mcp"] }
  }
}

The tools and their parameters are documented on
docs.rs.
To try them by hand, the MCP Inspector
lists them and calls them from a browser:

npx @modelcontextprotocol/inspector ascot mcp

ascot as an LSP server

ascot lsp

Starts the LSP server (stdio). Its flags are the settings as
defaults: the client overrides them with initializationOptions and changes
them with workspace/didChangeConfiguration. A new iris re-checks the open
documents without re-reading them; a setting that can’t be applied is reported
with window/showMessage and left as it was. With a
shared file system, the workspace roots are loaded from
disk at startup.

Claude Code plugins

This repository is a Claude Code plugin marketplace with two plugins, both
expecting ascot on PATH: ascot-mcp registers the MCP server above, and
ascot-lsp runs the LSP server and feeds its diagnostics back into the
conversation after every edit.

claude plugin marketplace add intersystems-community/ascot
claude plugin install ascot-mcp@ascot-plugins
claude plugin install ascot-lsp@ascot-plugins

Advanced Usage

Settings

Which IRIS to ask, the style to check and the diagnostics to report are the same
three settings everywhere; the ascot-lsp plugin asks for them when enabled.
How inlay hints are spelled is a fourth, for the servers and the binding;
analyze shows none.

IRIS Style Diagnostics Inlay hints
CLI, LSP --iris, --iris-namespace --style FILE -d VERB:TARGETS
MCP (create_workspace), LSP (initializationOptions and workspace/didChangeConfiguration) iris, iris_namespace style diagnostics inlay_hints
TS/JS (createWorkspace) env style diagnostics setInlayHints(options)

Documents on IRIS

Classes, routines and include files outside the workspace are resolved against
IRIS; iris says which:

  • --iris latest (default): the newest declaration-only snapshot of IRIS this
    ascot knows, downloaded once (4 MB) from this ascot’s own
    release into
    ~/.ascot.
  • --iris <release>: the snapshot of that IRIS release, the tag of its
    iris-community image; --iris irishealth-community:<release>:HSLIB that of
    IRIS for Health’s HS and Ens classes (6 MB), the namespace after the tag
    and %SYS when left out; latest serves as the tag there too.
  • --iris http://user:password@host:port[/prefix] with --iris-namespace
    (default %SYS): a live connection to IRIS through the Atelier REST API.
  • --iris path/to/declarations.ascot.decls: a declaration file, a released
    one or one you built yourself. No REST
    requests, and no instance needed.
  • --iris none: no environment, so every class, routine or include outside the
    workspace is an error.
  • --iris more than once: the sources are asked in order, and the first that
    holds a class, routine or include answers for it. --iris latest --iris http://... reads the system classes from the snapshot, mask corrections
    included, and your own from the instance; --iris-namespace applies to the
    instances in the list, and none among others is a no-op. The iris setting
    of the servers takes a list the same way.

Supported IRIS Releases

ascot prioritizes the latest InterSystems IRIS release, which CI tests against,
and tries to support every release back to the earliest YYYY.1 within the
last two and a half years (2025.1 as of this writing): a failure there is a bug
report we take.

Build Your Own Declaration Files

ascot declare saves what a live connection would be asked for, so CI and
machines without the instance can check against it:

ascot declare --iris http://user:password@localhost:8080/iris --iris-namespace USER path/to/declaration.ascot.decls

Without the file argument it writes ~/.ascot/<host>-<port>[-<prefix>]-<namespace>.ascot.decls.

Style

style is a JSON object (for --style, a file holding it) saying how code
should be written; only what’s set is checked, as a warning. For example, with

{ "command": { "form": "long", "case": "pascal" }, "allowQuitForReturn": false }
$ ascot analyze --style https://github.com/intersystems-community/ascot/blob/main/style.json R.mac
warning: R.mac:3:2-3 - Command keyword `s` should be written `Set` [S2839]
warning: R.mac:4:2-8 - Use `Return` to leave a method or procedure; `Quit` is for loops and `Try` blocks [S4151]

indent sets the one level of indentation code is written with,
{ "indent": { "unit": " " } } for four spaces or "\t" for a tab: a
method body’s or a label’s commands sit one level in, each { } block adds
one, and a brace on a line of its own sits at its block’s depth. Lines of
embedded SQL, HTML or Python, comments and a command’s continuation lines are
left as written.

Every rule is described in https://github.com/intersystems-community/ascot/blob/main/STYLE.md. https://github.com/intersystems-community/ascot/blob/main/style.json is
the recommended style, commands long and lowercase, functions and system
variables long and uppercase; copy it into a folder as .ascot/https://github.com/intersystems-community/ascot/blob/main/style.json and
edit it from there. It ships with the npm package (lib/https://github.com/intersystems-community/ascot/blob/main/style.json), with each
release, and with each release’s
diagnostics reference.

Diagnostics Filter

diagnostics is VERB:TARGETS values, as a list or separated by spaces (-d,
long form --diagnostics, is also repeatable), choosing which codes are
reported and at what severity. VERB is off, on (the code’s own severity) or
a severity (error, warning, information, hint); TARGETS is a
comma-separated list of codes, severities (every code currently reported at
one), or all. Values apply in order, a later one overriding an earlier one:

ascot analyze -d off:A5579,A4043 src/            # drop two codes
ascot analyze -d off:hint,information src/       # errors and warnings only
ascot analyze -d off:all -d on:A7095,A6851 src/  # report only two
ascot analyze -d hint:A4471 src/                 # report one as a hint

The exit code follows what is reported, so a dropped or downgraded warning no
longer fails a build.

A comment line of its own reading // @ascot: VERB:TARGETS … (or ; or #;
in place of //, or /* @ascot: … */), in the same syntax and nothing else in
the comment, applies to the statement that follows it, over the lines that
statement covers; blank lines and other comment lines between are skipped, and
several such lines add up. Its values come after the -d ones, so
// @ascot: off:A5579 above a call drops that one report, and
// @ascot: on:A4471 reports that code there even when the workspace turned it
off. A comment beside code is not a directive.

Inlay Hints

inlay_hints says how a hint is spelled; nothing is reported. typeAnnotation
chooses how the type hinted after a Set target whose value’s type isn’t plain
from the code is written: as, the default, spells it as a declaration does,
Set tId As %Integer = ..%Id(); colon spells it Set tId: %Integer = ..%Id().
Hover text and printed declarations keep As.

{ "typeAnnotation": "colon" }

Shared file system

Neither server assumes it shares a file system with its client; --shared-fs
says it does. mcp‘s insert then reads a file:// uri given without src
from disk, a single file or a whole directory of .cls/.mac/.int/.inc
files, and inserting a directory again re-reads it and drops the files no longer
there. lsp then loads the workspace roots from disk at startup, so cross-file
references resolve before their files are opened, and its style may be a
file’s path.

Contributing

Please open an issue
before starting a pull request. See https://github.com/intersystems-community/ascot/blob/main/CONTRIBUTING.md for the
development workflow, https://github.com/intersystems-community/ascot/blob/main/GOVERNANCE.md for how the project is
run, and https://github.com/intersystems-community/ascot/blob/main/SECURITY.md for reporting vulnerabilities.

License

This software is provided AS-IS, with no implied warranties, support, or
conditions of any kind.

Licensed under either of Apache License, Version 2.0 or
MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.

Last checked by moderator
24 Oct, 2026, Works
Checked on IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2026.1 (Build 234U) Fri Mar 27 2026 14:07:14 EDT
Made with
Version
0.7.018 Nov, 2026
Categories
Developer EnvironmentMCP
Works with
InterSystems IRIS
First published
20 Oct, 2026
Last edited
18 Nov, 2026