Add mz-sql-lsp Claude Code plugin - #32
Open
sjwiesman wants to merge 1 commit into
Open
Conversation
Makes this repo a Claude Code plugin marketplace alongside the portable
skills, and publishes the mz-deploy language server as its first plugin.
Plugins cover capabilities the Agent Skills standard cannot express;
registering a language server is one.
The plugin declares the `mz-deploy lsp` server for `.sql` files and bundles
an mz-sql-navigation skill so agents reach for go-to-definition, hover, and
workspace symbols instead of grepping an mz-deploy project.
`project_dir` is a required userConfig setting naming the directory that
holds project.toml. A userConfig `default` does not satisfy
`${user_config.KEY}` substitution, so an unset value fails the server load
outright rather than falling back — there is no zero-configuration path.
Two alternatives were tested and rejected: an unset `${ENV_VAR}` collapses
workspaceFolder to an invalid path and reports a misleading ENOENT against
the binary, and a wrapper script passing `-d` cannot help because mz-deploy
adopts the LSP rootUri as its project root and ignores the flag.
Verified end to end against a real mz-deploy project in both layouts,
project.toml at the root and nested in a subdirectory, with go-to-definition
resolving to the expected file and line. The marketplace is named
`materialize` because `agent-skills` is reserved for Anthropic.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sjwiesman
marked this pull request as ready for review
July 29, 2026 17:46
bosconi
approved these changes
Jul 31, 2026
bosconi
left a comment
Member
There was a problem hiding this comment.
Very cool. A couple of small edits.
|
|
||
| Registers the `mz-deploy` language server for `.sql` files so Claude Code's LSP tool can | ||
| resolve go-to-definition, hover, and document/workspace symbols across an | ||
| [mz-deploy](https://materialize.com/docs/) project. |
Member
There was a problem hiding this comment.
Suggested change
| [mz-deploy](https://materialize.com/docs/) project. | |
| [mz-deploy](https://materialize.com/docs/manage/mz-deploy/) project. |
|
|
||
| Learned by testing; they are easy to get wrong because the docs don't state them. | ||
|
|
||
| - A `userConfig` `default` does **not** satisfy `${user_config.KEY}` substitution. If the user never sets the value, the LSP server fails to load entirely. There is no zero-configuration fallback — treat any `${user_config.*}` reference in an LSP config as a required setting and document it as such. |
Member
There was a problem hiding this comment.
Suggested change
| - A `userConfig` `default` does **not** satisfy `${user_config.KEY}` substitution. If the user never sets the value, the LSP server fails to load entirely. There is no zero-configuration fallback — treat any `${user_config.*}` reference in an LSP config as a required setting and document it as such. | |
| - A `userConfig` `default` does **not** satisfy `${user_config.KEY}` substitution. If the user never sets the value, the LSP server fails to load. There is no zero-configuration fallback — treat any `${user_config.*}` reference in an LSP config as a required setting and document it as such. |
"fails to load entirely." makes me think there is such a thing as loading partially, which presumably is not the case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes this repo a Claude Code plugin marketplace alongside the portable skills, and publishes the
mz-deploylanguage server as its first plugin. Plugins cover capabilities the Agent Skills standard can't express — registering a language server is one.The plugin declares the
mz-deploy lspserver for.sqlfiles and bundles anmz-sql-navigationskill, so agents reach for go-to-definition, hover, and workspace symbols instead of grepping an mz-deploy project.What's here
.claude-plugin/marketplace.jsonmaterialize, listsmz-sql-lspplugins/mz-sql-lsp/.claude-plugin/plugin.jsonuserConfigplugins/mz-sql-lsp/skills/mz-sql-navigation/SKILL.mdplugins/mz-sql-lsp/README.md.github/workflows/validate-plugins.ymlclaude plugin validate --strictmatrixPlus a Plugins section in
README.md, and conventions and LSP constraints inAGENTS.md.Configuration is required, by necessity
project_dir— the directory holdingproject.toml, relative to the repository root — is a requireduserConfigsetting that Claude Code prompts for on enable.There is no zero-configuration path, which is worth stating plainly: a
userConfigdefaultdoes not satisfy${user_config.KEY}substitution. If the value is never set, the LSP server fails to load entirely:Two alternatives were tested and rejected:
${ENV_VAR}inworkspaceFoldercollapses to an invalid path. The server then dies withENOENT ... posix_spawn 'mz-deploy'— which names the binary but is really a bad working directory, a misleading error to hand users.project.tomland passing-ddoesn't work. The script resolved-d .../mzcorrectly and navigation still returned nothing:mz-deployadopts the LSProotUrias its project root and ignores the flag.A static
${CLAUDE_PROJECT_DIR}works but silently returns "No definition found" for projects nested in a subdirectory, confirmed by a control run.Verification
claude plugin validate --strictpasses on both manifests. End to end against a real mz-deploy project via--plugin-dir, both layouts resolved a cross-file reference to the expected file and line:project_dirproject.tomlat project root.base/base_catalog_extractor__mz_clusters.sql:1mzmz/models/.../base_catalog_extractor__mz_clusters.sql:1Bundled skill loads; zero LSP errors in the debug log.
Notes for review
materializebecauseagent-skillsis reserved for Anthropic.metadata.pluginRootshorthand fails validation, so plugin sources use the explicit./plugins/{name}form.ENABLE_LSP_TOOLis not required — the LSP tool is on by default.default: "."is kept on the assumption it prefills the enable-time prompt. That was not verified (the prompt is interactive); if it doesn't prefill, it's dead weight and should be removed.Out of scope: the
mz-deployCLI skill, and migrating consumers off local marketplace definitions.🤖 Generated with Claude Code