MCP server overview
what is Protolint?
Protolint is a pluggable linter and fixer for Protocol Buffer (.proto) files (proto2 + proto3). It enforces style and conventions (aligned with the official protobuf style guide), can automatically fix many violations, supports custom lint rules via plugins, and runs without invoking the protobuf compiler for fast checks.
how to use Protolint?
Install via Homebrew, download prebuilt binaries from GitHub Releases, use the official Docker image (yoheimuta/protolint), install via npm (postinstall downloads the binary), or use the pip wheel (protolint-bin). You can also build/install from source with Go. Common commands:
- protolint lint <file|dir>
- protolint lint -fix . # auto-fix fixable problems
- protolint lint -auto_disable=next . # insert disable comments to preserve compatibility
- protolint lint -plugin ./my_rule . # run custom plugin rules
- protolint --mcp # run MCP server to allow AI clients to interact It supports protoc plugin mode (protoc-gen-protolint), editor integrations (VSCode, JetBrains, Vim), pre-commit hooks, GitHub Actions, and CI integrations. Configure behavior with .protolint.yaml and disable/enable rules inline using comments like // protolint:disable <ruleID> (with :next/:this modifiers available).
key features
- Pluggable plugin architecture for custom rules
- Fast parsing-based linting (no protoc required)
- Rule set matching the official protobuf style guide
- Fixer that auto-fixes many issues (-fix)
- Auto-disable option to insert disable comments when fixes would break compatibility
- Inline rule disabling and configurable .protolint.yaml
- Multiple reporters/formats (plain, junit, json, sarif, sonar, unix, tsc) and CI-specific output templates
- Editor integrations, pre-commit and GitHub Action support
- Docker image and language wrappers (npm, pip) for easy integration
- MCP server support for AI tooling
use cases
- Enforce consistent proto style across a repository via CI and pre-commit hooks
- Automatically fix trivial style issues while preserving schema compatibility using auto-disable
- Provide live linting inside editors (VSCode, JetBrains, Vim)
- Integrate linting into existing protoc-based workflows via protoc-gen-protolint
- Extend rules for organization-specific conventions by writing plugins
FAQ
- Is Protolint free and open source?
Yes. It is MIT-licensed and hosted on GitHub.
- Which proto versions are supported?
Supports proto2 and proto3; default rules follow proto3 style but are configurable.
- Can Protolint automatically fix problems?
Yes. Use -fix to auto-fix issues that are marked fixable. Use -auto_disable to insert disable comments for issues where fixing would break compatibility.
- Do I need protoc to run Protolint?
No. Protolint parses .proto files directly and does not require the protobuf compiler, which makes it faster for lint-only workflows.
- How do I disable rules for specific code/lines?
Use inline comments: // protolint:disable <ruleID> and // protolint:enable <ruleID>. You can append :next or :this to apply only to the next or current line.
- How does Protolint integrate with CI and editors?
Use built-in reporters for CI formatting, the provided GitHub Action and pre-commit hooks, and editor plugins for live feedback. It also supports reporter templates for specific CI environments (GitHub Actions, Azure DevOps, GitLab).
- What are exit codes?
0 = success/no lint errors, 1 = lint errors found, 2 = parsing/internal/runtime error.