Skip to content

Add StackQL embedded MCP library, Agent Framework connector, driftwat…#1

Merged
jeffreyaven merged 1 commit into
mainfrom
feature/library-core
Jun 13, 2026
Merged

Add StackQL embedded MCP library, Agent Framework connector, driftwat…#1
jeffreyaven merged 1 commit into
mainfrom
feature/library-core

Conversation

@jeffreyaven

Copy link
Copy Markdown
Member

…ch sample, and CI

Library core (StackQL.Mcp):

  • StackqlMcp.CreateBuilder() fluent builder with WithMode/WithAuth/WithBinary/ WithBundlePath/WithApproot/WithCommand/StartAsync, idiomatic async + IAsyncDisposable
  • StackqlMode enum (ReadOnly default; Safe/DeleteSafe/FullAccess explicit opt-in)
  • Canonical cwd-independent launch args (mcp --mcp.server.type=stdio --approot --mcp.config {...}); audit disabled, read_only default
  • Two acquisition modes: sidecar (download .mcpb, verify sha256 against embedded pins, extract to the shared ~/.stackql/mcp-server-bin/// cache) and vendored (embed the bundle for single-file self-contained publish)
  • STACKQL_MCP_BIN / STACKQL_MCP_BUNDLE overrides; zip-slip guarded extraction; StackqlServer.ResolveCommandAsync for harnesses that own the process
  • Built on the official C# MCP SDK (ModelContextProtocol.Core 1.4.0); no other third-party deps

Agent Framework connector (StackQL.Mcp.AgentFramework, separate package):

  • AsAgentToolsAsync() returns the StackQL tools as Microsoft.Extensions.AI AITool instances (McpClientTool : AIFunction : AITool), ready for an AIAgent's tools array. Core lib stays free of any Agent Framework dependency.

Sample (samples/driftwatch): Worker Service that embeds the read_only server, runs a SQL drift suite on a schedule, and posts a Teams Adaptive Card with the SQL behind each finding. Runs against the github null_auth fixture credential-free; set up for single-file vendored publish.

Tests: 16 unit tests (launch-arg shape, mode wire values, pin parse, cache path, platform key) plus the family conformance check (initialize -> tools/list -> pull github -> list_services), skippable when no binary is present and verified green locally against the real v0.10.500 bundle.

CI: GitHub Actions on PR + merge to main - dotnet format gate, 3-OS build/test matrix (downloads the platform bundle to activate conformance), pack validation; separate tag-driven manual NuGet publish workflow. Deterministic builds, Source Link, embedded PDBs.

…ch sample, and CI

Library core (StackQL.Mcp):
- StackqlMcp.CreateBuilder() fluent builder with WithMode/WithAuth/WithBinary/
  WithBundlePath/WithApproot/WithCommand/StartAsync, idiomatic async + IAsyncDisposable
- StackqlMode enum (ReadOnly default; Safe/DeleteSafe/FullAccess explicit opt-in)
- Canonical cwd-independent launch args (mcp --mcp.server.type=stdio --approot
  <abs> --mcp.config {...}); audit disabled, read_only default
- Two acquisition modes: sidecar (download .mcpb, verify sha256 against embedded
  pins, extract to the shared ~/.stackql/mcp-server-bin/<ver>/<key>/ cache) and
  vendored (embed the bundle for single-file self-contained publish)
- STACKQL_MCP_BIN / STACKQL_MCP_BUNDLE overrides; zip-slip guarded extraction;
  StackqlServer.ResolveCommandAsync for harnesses that own the process
- Built on the official C# MCP SDK (ModelContextProtocol.Core 1.4.0); no other
  third-party deps

Agent Framework connector (StackQL.Mcp.AgentFramework, separate package):
- AsAgentToolsAsync() returns the StackQL tools as Microsoft.Extensions.AI
  AITool instances (McpClientTool : AIFunction : AITool), ready for an AIAgent's
  tools array. Core lib stays free of any Agent Framework dependency.

Sample (samples/driftwatch): Worker Service that embeds the read_only server,
runs a SQL drift suite on a schedule, and posts a Teams Adaptive Card with the
SQL behind each finding. Runs against the github null_auth fixture credential-free;
set up for single-file vendored publish.

Tests: 16 unit tests (launch-arg shape, mode wire values, pin parse, cache path,
platform key) plus the family conformance check (initialize -> tools/list ->
pull github -> list_services), skippable when no binary is present and verified
green locally against the real v0.10.500 bundle.

CI: GitHub Actions on PR + merge to main - dotnet format gate, 3-OS build/test
matrix (downloads the platform bundle to activate conformance), pack validation;
separate tag-driven manual NuGet publish workflow. Deterministic builds,
Source Link, embedded PDBs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jeffreyaven jeffreyaven merged commit 1923c11 into main Jun 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant