cotx-engine
v0.1.0
Published
Cognitive context engine — compiles codebases into persistent, queryable semantic maps
Readme
cotx-engine
cotx-engine compiles source code into a persistent semantic map under .cotx/ and exposes that map through CLI commands and an MCP server.
What It Does
- Parses multi-language repositories with Tree-sitter
- Compiles semantic layers for modules, concepts, contracts, and flows
- Persists human-readable YAML and JSON indexes under
.cotx/ - Supports search, context lookup, impact analysis, map summaries, enrichment writes, snapshots, diffs, and incremental refresh
- Exposes the same capabilities to AI agents over MCP stdio
Install
npm install
npm run buildRun the CLI from the repo root:
node dist/index.js compile
node dist/index.js status
node dist/index.js serve
node dist/index.js serve --http --port 3000After publishing:
npm install -g cotx-engine
cotx compileCore Commands
cotx compile
cotx status
cotx query <keyword>
cotx context <node-id>
cotx impact <node-id>
cotx map --scope overview
cotx write <node-id> enriched.responsibility "Human-quality summary"
cotx snapshot --tag baseline
cotx diff --snapshot baseline
cotx update <changed-file>
cotx serveMCP
Start the stdio MCP server:
cotx serveStart the standalone HTTP MCP server:
cotx serve --http --host 127.0.0.1 --port 3000HTTP endpoints:
- Streamable HTTP:
http://127.0.0.1:3000/mcp - Legacy SSE:
http://127.0.0.1:3000/sse - Legacy message POST:
http://127.0.0.1:3000/messages?sessionId=...
Available tools:
cotx_compilecotx_querycotx_contextcotx_impactcotx_mapcotx_writecotx_batch_writecotx_enrichcotx_lintcotx_diff
Verification
Project verification:
npm run verifyReal-project acceptance only:
npm run test:acceptancePackage boundary check:
npm run pack:check