Add sqlx mcp and native integrations for dsh, pi, Codex and Claude Code - #22
Merged
Merged
Conversation
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.
What
Adds one tool surface and four thin harness adapters so agents call SQLX as a tool instead of shelling out to the CLI.
sqlx mcp— a Model Context Protocol server over stdio (crates/cli/src/mcp.rs):sqlx_datasource_list,sqlx_datasource_show,sqlx_datasource_test,sqlx_sql_execute,sqlx_sql_view,sqlx_prefetch.readOnlyHint/destructiveHintannotations carry the Skill's authorization contract into the tool layer; write-capable tools state the requirement in their descriptions.execution::rungainedrun_to(writer, …)so results can be captured instead of written to stdout, which the MCP protocol owns.Adapters (
integrations/):claude/— plugin plus marketplace manifest;.mcp.jsonlaunchessqlx mcpthrough the plugin'sbin/sqlx-mcplauncher.codex/— plugin plus marketplace manifest; same launcher, with anenv_varsallowlist so the plugin can seeSQLX_BIN/SQLX_DATA_DIR.dsh/— npm bundle (dsh.bundle.patch→cordis.patch.yml) registering five native tools throughdefineTool.pi/— npm package with aregisterToolextension.README.mdrecords install commands, the credential rule and the verification results.Verification
All four ran the same task headlessly (list datasources, execute a read-only SELECT, reply with the exact value):
9007199254740993900719925474099390071992547409939007199254740993Local checks:
cargo fmt --check,cargo clippy --workspace --all-targets --locked -D warnings,cargo test -p ottermind-sqlx --locked, and a scripted MCP session against a real PostgreSQL datasource.Behaviour worth noting from the verification:
sqlx_sql_executeuntil approvals are granted (MCP tool call requires approval, but approval policy is never) — the intended gating.--allowedTools "mcp__plugin_sqlx_sqlx__*".--username-env/--password-envread the process environment, which a GUI-launched harness usually cannot see.pnpm pack); alink:install breaks module resolution for host-provided packages, so@deepseek-ai/dsh-toolsis declared as a peer dependency the same way other third-party bundles declare it.Risks and limits
sqlx mcp. While this branch is unreleased the verification pointedSQLX_BINat the local build andSQLX_MANIFESTat the published v0.1.6 manifest, because a v0.1.8 manifest does not exist yet.SQLX_BINor the firstsqlxonPATH; documentingnpx -y @ottermind/sqlx@latestor shipping per-platform binaries in the pluginbin/is follow-up work.--reffor HTTPS/SSH git sources and needs a real remote to prove.integrations/piandintegrations/dshare npm packages but are not published yet.