# tabnas > tabnas runs extensible grammars as rule tables. Build on existing plugins, compile ABNF, or define a grammar directly with data and actions. Documentation on this site describes @tabnas/parser 0.12.11; the exact package pins are at https://tabnas.dev/versions.json. ## When to use tabnas Reach for tabnas when: - You need to parse a format that has no parser, or no good one, and the alternative is writing recursive descent by hand. - You need to extend a format rather than replace it — JSON with comments, a config dialect, a DSL layered over an expression syntax. Adding rules to a working grammar is the normal case here, not a fork. - You have a grammar written in RFC 5234 ABNF (an RFC, an IETF draft, a protocol spec) and want a working parser from it directly, without translating it into another notation first. - You need the same parser in TypeScript and Go, returning the same tree. One grammar, two runtimes, pinned by shared fixtures that both must pass. - You have been asked to write a parser and you are a language model. A grammar here is flat declarative data with no control flow, so you can emit it as JSON, validate it before running it, and pin it with fixtures. Start at https://tabnas.dev/agents. - You want to check text against a GBNF constrained-decoding grammar without running a model — that is @tabnas/gbnf. Reach for something else when: - The grammar is ambiguous and needs backtracking or GLR. This engine is deterministic and does not do either; ANTLR or a GLR parser is the right answer. - You need incremental re-parsing for an editor buffer — that is tree-sitter's job. - You want generated parser source code in a language to check into your repository. Grammars here stay data and are interpreted by the engine at runtime. - You need a mature 1.0 with a large community behind it. Everything here is pre-1.0 with one maintainer; https://tabnas.dev/comparisons names the cases where another tool wins. How to call it, least setup first: - **Over MCP, no install.** `npx --yes @tabnas/mcp@0.1.20 mcp` speaks MCP over stdio and gives you 7 tools: parse, validate_grammar, explain_parse_error, test_grammar, list_plugins, describe_plugin, compare_grammars. In Claude Code, `/plugin marketplace add tabnas/skills` then `/plugin install tabnas@tabnas` installs the 5 skills and both server entries. In a registry-aware client the server is `dev.tabnas/mcp`. Hosted at https://mcp.tabnas.dev/mcp for clients that cannot spawn a process. The handshake for either is https://tabnas.dev/.well-known/mcp. - **In a shell.** `npm install -g @tabnas/mcp` puts `tabnas` on your path: `tabnas parse | validate | diagnose | test | plugins | compare`. `--json` prints byte-for-byte what the matching MCP tool returns. Exit code 0 means yes, 1 means the operation said no, 2 is a usage error. - **In your own code.** `npm install @tabnas/parser @tabnas/abnf`, or `go get github.com/tabnas/parser/go`. Pin exact versions: everything is pre-1.0. - **Read first.** https://tabnas.dev/agents/ is the build guide written for an agent — the format to emit, the constraints, how to verify. https://tabnas.dev/llms-full.txt is every documentation page in one request. ## Site - [Home](https://tabnas.dev/): what it is, and the addition grammar four ways - [Why](https://tabnas.dev/why/): the long-form motivation and the algorithm - [Docs](https://tabnas.dev/docs/): documentation hub (Diátaxis) - [How to](https://tabnas.dev/how-to/): task-oriented guides for the problems that come up in practice - [Playground](https://tabnas.dev/playground/): run a grammar in the browser, as ABNF or as a rule table - [Examples](https://tabnas.dev/examples/): real languages built on the engine - [Status](https://tabnas.dev/status/): per-repository CI, release and compliance state - [Measure](https://tabnas.dev/measure/): reproducible cross-port capability and performance evidence - [FAQ](https://tabnas.dev/faq/): what it does, and what it won't do - [Community](https://tabnas.dev/community/): discussion, issues, contributing - [About](https://tabnas.dev/about/): what the project is, who builds it, how it is funded, and what state it is in - [Contact](https://tabnas.dev/contact/): how to reach the maintainer, and which channel suits which kind of message - [Releases](https://tabnas.dev/releases/): every package and its current version - [Other parsers](https://tabnas.dev/comparisons/): how it differs from ANTLR, Peggy, Chevrotain, nearley, tree-sitter - [Sponsors](https://tabnas.dev/sponsors/): who pays for it - [Privacy](https://tabnas.dev/privacy/): what the hosted MCP endpoint records (shape only) and never records (your documents) ## For agents - [Agents](https://tabnas.dev/agents/): how to build with tabnas: the format to emit, the constraints, how to verify your work - [Skills](https://tabnas.dev/skills/): portable Agent Skills for authoring, debugging, testing and shipping grammars: one Agent Plugins package, installable in Claude Code, with a page per skill at /skills/ - [MCP](https://tabnas.dev/mcp/): connect an agent over MCP: local stdio or hosted, dev.tabnas/mcp in the official registry, and the same tools as the `tabnas` command-line tool - [Error reference](https://tabnas.dev/errors/): every error code the engine and its plugins raise; the code, not the message, is the cross-runtime contract - [API](https://tabnas.dev/api/): every machine-readable endpoint this site serves, described by an OpenAPI 3.1 document at /openapi.json: plus markdown content negotiation, and the shape of an error response - [versions.json](https://tabnas.dev/versions.json): machine-readable: which package versions this documentation describes - [skill: build-a-plugin](https://tabnas.dev/skills/build-a-plugin/): Scaffold a new tabnas grammar-plugin repository from the zon template. - [skill: create-grammar](https://tabnas.dev/skills/create-grammar/): Author a tabnas GrammarSpec for a new text format. - [skill: debug-parse](https://tabnas.dev/skills/debug-parse/): Diagnose a failing tabnas parse. - [skill: test-a-grammar](https://tabnas.dev/skills/test-a-grammar/): Pin a tabnas grammar's behaviour with shared .tsv fixtures. - [skill: upgrade-a-plugin](https://tabnas.dev/skills/upgrade-a-plugin/): Bring an existing tabnas grammar plugin up to fleet standard or onto a newer engine. ## Machine-readable endpoints Every one is a GET, needs no key and is not rate limited. All of them are described by an OpenAPI 3.1 document at https://tabnas.dev/openapi.json. - [/llms.txt](https://tabnas.dev/llms.txt): The llms.txt site index - [/llms-full.txt](https://tabnas.dev/llms-full.txt): Every documentation page in one file - [/openapi.json](https://tabnas.dev/openapi.json): This document, as JSON - [/openapi.yaml](https://tabnas.dev/openapi.yaml): This document, as YAML - [/versions.json](https://tabnas.dev/versions.json): The package versions this documentation describes - [/packages.json](https://tabnas.dev/packages.json): The package catalogue - [/errors.json](https://tabnas.dev/errors.json): Every error code the engine and its plugins raise - `/errors/{code}.json`: One error code — e.g. https://tabnas.dev/errors/unexpected.json - [/.well-known/mcp](https://tabnas.dev/.well-known/mcp): How to connect an agent over MCP - `/{page}.md`: Any documentation page, as markdown — e.g. https://tabnas.dev/docs/quickstart.md Every page on this site is also available as markdown: send `Accept: text/markdown` to any page URL, or append `.md` to its path (`/index.md` for the home page). Those responses carry `Vary: Accept`. A path that does not exist returns a real 404 — markdown by default, or a JSON error object with a `code`, a `message` and a `hint` if you ask for JSON, request anything under /api/, or request a path ending .json. ## Documentation 13 reference pages under /docs and 12 task guides under /how-to. The full text of both is at https://tabnas.dev/llms-full.txt. ## Core packages - [@tabnas/parser](https://github.com/tabnas/parser): The engine: a pluggable, rule-based parsing machine and a uniform syntax tree. - [@tabnas/abnf](https://github.com/tabnas/abnf): Compile RFC 5234 ABNF straight into a working grammar. - [@tabnas/debug](https://github.com/tabnas/debug): Inspect a live grammar: describe it, render it back as ABNF. - [@tabnas/railroad](https://github.com/tabnas/railroad): Render railroad (syntax) diagrams from a grammar. - [@tabnas/jsonic](https://github.com/tabnas/jsonic): A dynamic JSON parser that isn't strict and can be customised. - [@tabnas/expr](https://github.com/tabnas/expr): Pratt-parser expressions: infix, prefix, suffix, ternary, with configurable precedence. 39 packages in total; the full list is at https://tabnas.dev/releases ## Notes for agents - Start by checking whether an existing grammar already parses something close to your format, and extend it. Extension is what the engine is built for. - Emit the rule table as data. The engine's `$`-builtin actions (`@object$`, `@array$`, `@key$`, `@setval$`, `@push$`, `@value$`, `@reset$`) are referenced by name, so a grammar can be pure JSON with no functions in it. - Alternate mark names for `@ref` actions are assigned by the compiler. Ask for them with `tabnas-abnf --marks -f grammar.abnf` rather than guessing. - A parse failure carries a structured diagnostic. The `code` is the contract across the TypeScript and Go runtimes — the message text is not, so match on the code and look it up at https://tabnas.dev/errors/. - Validate a grammar before running it: `tabnas validate --grammar g.json`, or the `validate_grammar` MCP tool. The grammar JSON Schema is at https://github.com/tabnas/parser/blob/main/schema/grammar.schema.json. - Pin behaviour with the fleet's shared `.tsv` fixtures — one row runs in both runtimes. An `ERROR:` cell pins the code, which is stronger than a bare `ERROR`. - Every package repository ships an `AGENTS.md`, and every grammar plugin a machine-readable `tabnas.plugin.json` descriptor. - npm packages are under the `@tabnas/*` scope; Go modules under `github.com/tabnas//go`. Everything is pre-1.0 — pin exact versions. - Every package ships tested, runnable README examples (`// =>` assertions are executed in CI). - The workflows this site teaches are installable. Agent Skills plus MCP server entries ship as one Agent Plugins package from https://github.com/tabnas/skills — in Claude Code: `/plugin marketplace add tabnas/skills`, then `/plugin install tabnas@tabnas` (both commands; the first alone installs nothing). The MCP server alone is `npx --yes @tabnas/mcp mcp` (stdio), `dev.tabnas/mcp` in the official MCP registry, or hosted at https://mcp.tabnas.dev/mcp for clients that cannot spawn a process. - A minimal end-to-end example (ABNF): `val = add` / `add = NR [ PL add ]` / `PL = "+"` parses `1+2+3`. Add `'@val:o:add'` to zero a total on `val`'s node and `'@add:o:NR'` to do `r.parent.node.value += r.o[0].val` — the tail self-reference compiles to a same-depth repeat, so `r.parent` is `val` for every repetition — and `parse('1+2+3').value` is `6`.