MCPcopy Index your code
hub / github.com/Automattic/harper

github.com/Automattic/harper @v2.6.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.6.0 ↗ · + Follow
10,198 symbols 28,937 edges 766 files 843 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img src="https://github.com/Automattic/harper/raw/v2.6.0/logo.svg" width="400px" />
<h1>Harper</h1>

Harper Binaries Website Checks Crates.io NPM Version Downloads Obsidian Plugin Downloads

Harper is an English grammar checker designed to be just right. I created it after years of dealing with the shortcomings of the competition.

Grammarly was too expensive and too overbearing. Its suggestions lacked context, and were often just plain wrong. Not to mention: it's a privacy nightmare. Everything you write with Grammarly is sent to their servers. Their privacy policy claims they don't sell the data, but that doesn't mean they don't use it to train large language models and god knows what else. Not only that, but the round-trip-time of the network request makes revising your work all the more tedious.

LanguageTool is great, if you have gigabytes of RAM to spare and are willing to download the ~16GB n-gram dataset. Besides the memory requirements, I found LanguageTool too slow: it would take several seconds to lint even a moderate-size document.

That's why I created Harper: it is the grammar checker that fits my needs. Not only does it take milliseconds to lint a document, take less than 1/50th of LanguageTool's memory footprint, but it is also completely private.

Harper is even small enough to load via WebAssembly.

Language Support

Harper currently only supports English, but the core is extensible to support other languages, so we welcome contributions that allow for other language support.

Performance Issues

We consider long lint times bugs. If you encounter any significant performance issues, please create an issue on the topic.

If you find a fix to any performance issue, we would appreciate the contribution. Just please make sure to read our contribution guidelines first.

Links

Huge Thanks

This project would not be possible without the hard work from those who contribute.

Harper's logo was designed by Lukas Werner.

Extension points exported contracts — how you extend this code

SingleTokenPattern (Interface)
A simpler version of the [`Pattern`] trait that only matches a single token. [9 implementers]
harper-core/src/patterns/mod.rs
Chunker (Interface)
An implementer of this trait is capable of identifying the noun phrases in a provided sentence. [See here](https://en.wi [4 …
harper-pos-utils/src/chunker/mod.rs
Linter (Interface)
(no doc) [4 implementers]
packages/harper.js/src/Linter.ts
OsBroker (Interface)
Provides platform-specific state needed by the highlighter without coupling rendering to an OS. The highlighter needs b [2 …
harper-desktop/src-tauri/src/os_broker.rs
InputTrait (Interface)
(no doc) [4 implementers]
harper-cli/src/input.rs
TaskResult (Interface)
Exhaustive taxonomy of execution outcomes; the `sealed` modifier ensures compiler‐enforced totality. */
harper-comments/tests/language_support_sources/basic_kotlin.kt
DedupedWordSetExt (Interface)
(no doc) [1 implementers]
harper-thesaurus/src/thesaurus.rs
Diagnostic (Interface)
(no doc)
packages/obsidian-plugin/src/lint.ts

Core symbols most depended-on inside this repo

assert_suggestion_result
called by 3199
harper-core/src/linting/mod.rs
assert_lint_count
called by 883
harper-core/src/linting/mod.rs
assert_no_lints
called by 725
harper-core/src/linting/mod.rs
iter
called by 566
harper-core/src/spell/word_map.rs
lint_group
called by 414
harper-core/src/linting/phrase_set_corrections/mod.rs
t_ws
called by 377
harper-core/src/expr/sequence_expr.rs
clone
called by 343
harper-core/src/span.rs
len
called by 274
harper-core/src/spell/word_map.rs

Shape

Function 6,822
Method 2,620
Class 595
Enum 86
Interface 75

Languages

Rust90%
TypeScript9%
Kotlin1%
Java1%
Python1%
C++1%

Modules by API surface

harper-core/src/linting/phrase_set_corrections/tests.rs409 symbols
harper-core/src/dict_word_metadata.rs224 symbols
harper-core/src/linting/noun_verb_confusion/mod.rs159 symbols
harper-core/src/linting/progressive_needs_be.rs102 symbols
harper-core/src/linting/there_is_agreement.rs101 symbols
harper-core/src/document.rs101 symbols
harper-core/src/linting/spell_check.rs100 symbols
harper-core/src/linting/plural_decades/four_digits.rs97 symbols
harper-desktop/src-tauri/src/mac_broker.rs91 symbols
harper-core/src/linting/plural_decades/two_digits.rs81 symbols
harper-core/src/linting/phrasal_verb_as_compound_noun.rs73 symbols
packages/chrome-plugin/src/background/index.ts72 symbols

Datastores touched

(mysql)Database · 1 repos
harperDatabase · 1 repos

For agents

$ claude mcp add harper \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact