1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【textlint】Deno×MCPで設定を一元化、どこからでも校正

1
Last updated at Posted at 2026-04-15

textlintにMCPサーバーが内蔵されました。AIから直接校正を呼び出せます。Deno経由で起動すれば、Node.jsのインストールも node_modules も不要。設定ファイルを1箇所に集約し、どのディレクトリからでも同じ校正環境を利用できます。

Denoを使うメリット

  • Denoだけで動作。Node.jsもnpmも不要
  • プロジェクトごとのnode_modulesが不要
  • 設定を1箇所に集約し、全プロジェクトで共有

必要なもの

  • Deno(インストール済み前提)
  • 設定ファイル2つ:deno.json.textlintrc
  • MCP対応エディタ(Claude Code、Cursor等)

設定ファイル

任意のディレクトリ(例:/path/to/textlint/)に以下の2ファイルを配置します。この設定を1箇所に置くことで、どのプロジェクトからでも同じ校正環境を利用できます。

deno.json

{
  "imports": {
    "textlint": "npm:textlint@^15.0.0",
    "textlint-rule-preset-ja-technical-writing": "npm:textlint-rule-preset-ja-technical-writing@^12.0.0",
    "@textlint/textlint-plugin-markdown": "npm:@textlint/textlint-plugin-markdown@^15.0.0"
  },
  "nodeModulesDir": "auto"
}

.textlintrc

{
  "plugins": ["@textlint/markdown"],
  "rules": {
    "preset-ja-technical-writing": true
  }
}

最小構成として preset-ja-technical-writing を有効化しています。必要に応じてルールを追加してください。

MCPサーバー設定

Claude Code

~/.claude/settings.json に追加します。

{
  "mcpServers": {
    "textlint": {
      "command": "deno",
      "args": [
        "run", "-A",
        "--config", "/path/to/textlint/deno.json",
        "npm:textlint", "--mcp",
        "-c", "/path/to/textlint/.textlintrc"
      ]
    }
  }
}

/path/to/textlint/ は実際のパスに置き換えてください。一度設定すれば、どのディレクトリでClaude Codeを起動してもtextlintが使えます。

Cursor / VS Code(参考)

.cursor/mcp.json または VS Codeの設定で同様に設定できます。

{
  "mcpServers": {
    "textlint": {
      "command": "deno",
      "args": [
        "run", "-A",
        "--config", "/path/to/textlint/deno.json",
        "npm:textlint", "--mcp",
        "-c", "/path/to/textlint/.textlintrc"
      ]
    }
  }
}

できること

MCPサーバー経由で、ファイルやテキストの校正・自動修正ができます。AIエディタで指示するだけで校正が完結します。

使用例

ファイルを校正

ユーザー: この記事を textlint でチェックして
AI: (lintFile を呼び出し)

結果:
1:19  error  一つの文で"、"を4つ以上使用しています  ja-technical-writing/max-ten
1:28  error  ら抜き言葉を使用しています。           ja-technical-writing/no-dropping-the-ra

テキストを直接校正

ユーザー: 「これは、問題のある、文章です、読点が、多すぎます。食べれる。」を校正して
AI: (lintText を呼び出し)

結果:
- 一つの文で"、"を4つ以上使用しています
- ら抜き言葉を使用しています

自動修正

ユーザー: この記事の textlint エラーを修正した内容を見せて
AI: (getLintFixedFileContent を呼び出し)

修正後の内容を表示

CLI実行(参考)

MCPサーバーを使わず、CLIで実行もできます。

deno run -A --config /path/to/textlint/deno.json npm:textlint -c /path/to/textlint/.textlintrc {file}

aliasを設定すると便利です。

alias textlint='deno run -A --config /path/to/textlint/deno.json npm:textlint -c /path/to/textlint/.textlintrc'

まとめ

  • Deno経由で起動すればNode.jsも node_modules も不要
  • 設定ファイルを1箇所に集約し、どのディレクトリからでも同じ校正環境
  • AIエディタから直接校正を呼び出し、会話内で完結
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?