feat: ship MCP server in the npm package#36
Merged
Conversation
Adds a zwave-log-analyzer-mcp bin entry, builds dist/mcp-server.js as part of build:cli, includes it in the published files, and moves @modelcontextprotocol/sdk to dependencies. The Gemini-based analysis path is unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Merged
2 tasks
AlCalzone
force-pushed
the
alcalzone-mcp-server-first
branch
from
July 6, 2026 20:16
16f056a to
a773eac
Compare
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.
Summary
Ships the existing MCP server (
src/mcp-server.ts) in the published npm package so AI agents (e.g. GitHub Agentic Workflows with the Copilot CLI engine) can use it for tool-driven log analysis. Also adopts the reusable improvements from the tool-calling experiment in #8. The Gemini-based one-shot analysis path (CLI, library API, web UI) is unchanged.Changes
Packaging
zwave-log-analyzer-mcp→dist/mcp-server.jstsconfig.node.jsonnow compilessrc/mcp-server.tsas part ofbuild:clidist/mcp-server.jsanddist/lib/zwave-mcp-server-core.{js,d.ts}tofilesdist/lib/log-query-engine.{js,d.ts}tofiles— it is imported byindex.jsbut was missing from the published package@modelcontextprotocol/sdkfrom devDependencies to dependencies (bumped to^1.26.0to match the lockfile)Adopted from #8
ZWaveLogMCPServerCoreclass;src/mcp-server.tsis now a thin stdio wrappersearchLogEntries:queryis now optional — filter-only searches viaentryKinds,timeRangeorattributeFiltersare supported; calls without any filter return a descriptive errorgetNodeSummary/getNodeCommunicationnow pass through thetimeRangeargument, which was previously silently dropped by the serverimport.meta.urlmain-module guard, which broke execution through npx/bin symlinksThe browser/Gemini tool-calling parts of #8 (EventTarget transport, Gemini client rework) were intentionally not adopted.
Usage
Verification
npm run build:cliproducesdist/mcp-server.jswith shebang; lint passesinitialize,tools/list(8 tools),loadLogFile, filter-onlysearchLogEntries, and the no-filter error path all behave correctlynpm pack --dry-runincludes all required filesNo release is triggered by this PR.