See GitHub release notes for details.
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.
QUIT/RETURN, inconsistent variable declarations across branches, and.mac/.int only) onascot formatascot::format in the library, the WIT format andcode-actions exports, LSP formatting and code actions (a quick fix performat tool.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
From the
InterSystems Community tap:
brew trust intersystems-community/tap # if Homebrew 5.1.15 or later
brew install intersystems-community/tap/ascot
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 moduleascot::sarif, ascot::lsp, ascot::mcp); declare implies network.network: ascot reaching the network itself, for a live IRIS instance over its REST APIRawAtelier, --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 nothingThe 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.
From
npmjs.com/package/@intersystems-community/ascot:
npm install @intersystems-community/ascot
A library; it does not provide an ascot executable.
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 toolascot 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 serverascot 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 serverascot 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.
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
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) |
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.--iris <release>: the snapshot of that IRIS release, the tag of itsiris-community image; --iris irishealth-community:<release>:HSLIB that ofHS and Ens classes (6 MB), the namespace after the tag%SYS when left out; latest serves as the tag there too.--iris http://user:password@host:port[/prefix] with --iris-namespace%SYS): a live connection to IRIS through the Atelier REST API.--iris path/to/declarations.ascot.decls: a declaration file, a released--iris none: no environment, so every class, routine or include outside the--iris more than once: the sources are asked in order, and the first that--iris latest --iris http://... reads the system classes from the snapshot, mask corrections--iris-namespace applies to thenone among others is a no-op. The iris settingascot 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.
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 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 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 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" }
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.
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.
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.