mcp-watchtower package exposes a TypeScript API so you can run the same static and semantic analysis that power the CLI directly inside your own Node.js or TypeScript application. This is useful when you want to integrate analysis into a custom CI script, a registry that loads multiple MCP servers, or any tooling that already holds tool definitions in memory.
Installation
- npm
- pnpm
- yarn
mcp-watchtower requires Node.js 18 or later. The package ships ES modules only, so set "type": "module" in your package.json or use a .mjs extension.Public exports
The package surface is intentionally small. Everything you need is available from the top-level import.Quick example
The following end-to-end example runs both analyzers against the same toolset.SemanticAnalyzer is asynchronous because it embeds tool and parameter context at runtime and queries the shipped semantic index. The CLI runs the same class in the default full scan and in --semantic mode.Next steps
StaticAnalyzer class reference
Constructor options, the
analyze() method signature, and the full StaticReport shape.SemanticAnalyzer class reference
Constructor options, matching behavior, and the full
SemanticReport shape.Types reference
Full documentation for every exported interface and type, including all finding codes.