{"_id":"@blakelypritchard/cse-toolkit","_rev":"2-90074d46476ee57056692ce9dfef464b","name":"@blakelypritchard/cse-toolkit","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@blakelypritchard/cse-toolkit","version":"0.1.0","keywords":["mcp","model-context-protocol","ibm","sales","knowledge-base","cse","rag","rfp","semantic-search","bob"],"license":"MIT","_id":"@blakelypritchard/cse-toolkit@0.1.0","maintainers":[{"name":"blakelypritchard","email":"blakely.pritchard@ibm.com"}],"homepage":"https://github.com/blakelypritchard/cse-toolkit#readme","bugs":{"url":"https://github.com/blakelypritchard/cse-toolkit/issues"},"bin":{"cse-toolkit":"build/cli.js","cse-toolkit-mcp":"build/index.js"},"dist":{"shasum":"6c039687cb9ba1aa2f0585114c25f0775f633aad","tarball":"https://registry.npmjs.org/@blakelypritchard/cse-toolkit/-/cse-toolkit-0.1.0.tgz","fileCount":15,"integrity":"sha512-nieUBc0LqkmWcxYiDrSAoPIRFHm+v4vVHoSUBP+WYQKreLVMaZY6VsLC932Hi9PB/ggoRQ5fPx7vWjh5AQOCnw==","signatures":[{"sig":"MEUCIQCaQb9Dwrf3H0uzUp+n77tJfcxyyWqPIA6Ex7T9tFDcvQIgErO/CSi7SkpO4cJb+Hrzia9f/AhLMbtMKQQzdWFmvVM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":122635},"main":"./build/index.js","type":"module","engines":{"node":">=18"},"scripts":{"dev":"tsc --watch","build":"tsc && chmod 755 build/index.js build/cli.js"},"_npmUser":{"name":"blakelypritchard","email":"blakely.pritchard@ibm.com"},"repository":{"url":"git+https://github.com/blakelypritchard/cse-toolkit.git","type":"git"},"_npmVersion":"11.16.0","description":"MCP server for IBM Customer Solutions Engineers — local semantic KB search, grounded RFP response generation, and branded document rendering. No cloud calls at query or index time.","directories":{},"_nodeVersion":"26.3.0","allowScripts":{"better-sqlite3@13.0.3":true},"dependencies":{"zod":"^4.4.3","xlsx":"^0.18.5","jszip":"^3.10.1","marked":"^18.0.10","mammoth":"^1.12.1","pdf-parse":"^2.4.5","sqlite-vec":"^0.1.9","better-sqlite3":"^13.0.3","fast-xml-parser":"^5.11.0","@xenova/transformers":"^2.17.2","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^26.2.0","@types/marked":"^5.0.2","@types/pdf-parse":"^1.1.5","@types/better-sqlite3":"^9.6.0"},"_npmOperationalInternal":{"tmp":"tmp/cse-toolkit_0.1.0_1788287958136_0.27478253259181407","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@blakelypritchard/cse-toolkit","version":"0.1.1","description":"MCP server for IBM Customer Solutions Engineers — local semantic KB search, grounded RFP response generation, and branded document rendering. No cloud calls at query or index time.","type":"module","bin":{"cse-toolkit-mcp":"build/index.js","cse-toolkit":"build/cli.js"},"main":"./build/index.js","scripts":{"build":"tsc && chmod 755 build/index.js build/cli.js","dev":"tsc --watch"},"engines":{"node":">=18"},"keywords":["mcp","model-context-protocol","ibm","sales","knowledge-base","cse","rag","rfp","semantic-search","bob"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/blakelypritchard/cse-toolkit.git"},"homepage":"https://github.com/blakelypritchard/cse-toolkit#readme","dependencies":{"@modelcontextprotocol/sdk":"^1.30.0","@xenova/transformers":"^2.17.2","better-sqlite3":"^13.0.3","fast-xml-parser":"^5.11.0","jszip":"^3.10.1","mammoth":"^1.12.1","marked":"^18.0.10","pdf-parse":"^2.4.5","sqlite-vec":"^0.1.9","xlsx":"^0.18.5","zod":"^4.4.3"},"devDependencies":{"@types/better-sqlite3":"^9.6.0","@types/marked":"^5.0.2","@types/node":"^26.2.0","@types/pdf-parse":"^1.1.5","typescript":"^7.0.2"},"allowScripts":{"better-sqlite3@13.0.3":true},"_id":"@blakelypritchard/cse-toolkit@0.1.1","bugs":{"url":"https://github.com/blakelypritchard/cse-toolkit/issues"},"_nodeVersion":"26.3.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-DwolN3ZL2vuL/1YV1AlNWbiB6t3D7NMVzz6nkeVEOE9r5F3JhKpcmrgOv5xVQSoVvkuZkm9Xuz15G+Bp3wqHMQ==","shasum":"5bf86d5c3d0f9f52389c0486175aeb805c0f9ab5","tarball":"https://registry.npmjs.org/@blakelypritchard/cse-toolkit/-/cse-toolkit-0.1.1.tgz","fileCount":15,"unpackedSize":123029,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBJfP2npH9Blbum5/+ECqeu1Fw1/OBpD3yUCY8Ro4fJuAiEA9Qj86fFH2tsF5rFhRKcDrOZvUr5FgPY3Ug7K7ySc/s8="}]},"_npmUser":{"name":"blakelypritchard","email":"blakely.pritchard@ibm.com"},"directories":{},"maintainers":[{"name":"blakelypritchard","email":"blakely.pritchard@ibm.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cse-toolkit_0.1.1_1788288072195_0.5854749036083382"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-01T18:39:17.969Z","modified":"2026-09-01T18:41:12.529Z","0.1.0":"2026-09-01T18:39:18.310Z","0.1.1":"2026-09-01T18:41:12.357Z"},"bugs":{"url":"https://github.com/blakelypritchard/cse-toolkit/issues"},"license":"MIT","homepage":"https://github.com/blakelypritchard/cse-toolkit#readme","keywords":["mcp","model-context-protocol","ibm","sales","knowledge-base","cse","rag","rfp","semantic-search","bob"],"repository":{"type":"git","url":"git+https://github.com/blakelypritchard/cse-toolkit.git"},"description":"MCP server for IBM Customer Solutions Engineers — local semantic KB search, grounded RFP response generation, and branded document rendering. No cloud calls at query or index time.","maintainers":[{"name":"blakelypritchard","email":"blakely.pritchard@ibm.com"}],"readme":"# CSE Toolkit — MCP Server\n\nA local MCP (Model Context Protocol) server for Customer Solutions Engineers. Indexes your\nproduct knowledge base, provides semantic search, and generates grounded sales content and RFP\nresponses — all without sending your data to any cloud service at query or index time.\n\n> **Privacy note:** No documents, queries, or search results leave your machine at query or index\n> time. The embedding model (Xenova/bge-small-en-v1.5, ~33 MB) is downloaded from Hugging Face\n> once on first install and cached locally; subsequent runs use only the local cache.\n\n---\n\n## Requirements\n\n- **Node.js ≥ 18**\n- A knowledge base folder containing product documents (`.pdf`, `.docx`, `.txt`, `.xlsx`, `.pptx`)\n\n---\n\n## Multi-Product Knowledge Bases\n\nCSE Toolkit supports a single KB root folder covering multiple products. Place each product's\ndocuments in a named subfolder of your KB path:\n\n```\nkbPath/\n  Maximo/           ← product = \"Maximo\"\n    overview.pdf\n    architecture.docx\n  Instana/          ← product = \"Instana\"\n    instana-guide.pdf\n  uncategorized.txt ← product = null (no subfolder)\n```\n\n- **Files in a named subfolder** are tagged with that subfolder's name as their `product`.\n- **Files placed directly at the KB root** (no subfolder) are indexed as uncategorized\n  (`product: null`) and are included in unfiltered searches but excluded from product-scoped queries.\n- Files nested multiple levels deep (e.g. `kbPath/Maximo/manuals/foo.pdf`) belong to the\n  top-level subfolder product (\"Maximo\") — only the first path segment below `kbPath` counts.\n- Product matching is **case-insensitive and trimmed** (e.g. \"maximo\" matches \"Maximo\").\n\n### Migration note for existing installs\n\nThe `product` column was added in this release. After upgrading, run `update_knowledge_base` once\nto populate the new column on all already-indexed files. Product tags are derived from the\nimmediate subfolder structure at index time — re-indexing is the only way to backfill them on\nfiles indexed before this release.\n\n---\n\n## Install\n\n```bash\nnpm install -g @blakelypritchard/cse-toolkit\n# or run without installing:\nnpx @blakelypritchard/cse-toolkit init\n```\n\n---\n\n## Setup: `cse-toolkit init`\n\nRun the interactive setup wizard once before connecting Bob:\n\n```bash\nnpx @blakelypritchard/cse-toolkit init\n```\n\nThe wizard prompts for:\n\n| Field | Required | Description |\n|---|---|---|\n| **KB folder path** | ✅ | Absolute path to the folder containing your product documents |\n| **Product line name** | ✅ | e.g. `IBM Maximo Application Suite` |\n| **Company name** | optional | Appears in document headers and footers |\n| **Logo path** | optional | PNG or SVG file — embedded in rendered HTML output |\n| **Accent color** | optional | CSS color value, e.g. `#0043CE` |\n| **Confidentiality footer** | optional | Text for the bottom of rendered documents |\n\nConfiguration is written to `~/.cse-toolkit/config.json`. Running `init` again updates the config\nwhile preserving existing values as defaults.\n\nDuring `init`, the embedding model is downloaded and cached locally (~33 MB, one-time). No network\ncalls are made at query or index time after this initial download.\n\n---\n\n## Connecting to Bob\n\nAfter running `cse-toolkit init`, add the following to your **global** Bob config at\n`~/.bob/settings/mcp.json` (or a workspace `.bob/mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"cse-toolkit\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@blakelypritchard/cse-toolkit\"],\n      \"timeout\": 1800000\n    }\n  }\n}\n```\n\nBob will spawn the server as a local child process over stdio. `npx` downloads and caches the\npackage automatically — no manual build step required. The server starts immediately on save\n(hot-reload).\n\n---\n\n## The 7 Tools\n\n### `update_knowledge_base`\n\nIncrementally re-indexes the KB folder configured during `init`. Only new or changed files are\nre-embedded; unchanged files are skipped. Files deleted from the folder are removed from the index.\n\n```json\n{ \"forceReindex\": false }\n```\n\nReturns a summary of files added, updated, removed, skipped, and failed.\n\n> **Migration note:** After upgrading to multi-product support, run `update_knowledge_base` once to\n> populate the new `product` column on all already-indexed files.\n\n---\n\n### `list_products`\n\nLists all documents currently in the index, grouped by source file. Returns file path, type\n(`pdf`, `docx`, `txt`, `xlsx`, `pptx`), product name, chunk count, last-indexed timestamp,\nindexing status, and a low-text flag for suspected scanned/image PDFs.\n\nResponse includes a top-level `distinctProducts: string[]` field listing all unique product names.\nPass the optional `product` filter to restrict results to a specific product subfolder.\n\n```json\n{ \"product\": \"Maximo\" }\n```\n\n---\n\n### `get_index_status`\n\nReturns the overall state of the index: last-indexed timestamp, total file count, total chunk\ncount, and a list of files flagged as low-text (likely scanned PDFs with poor text extraction).\nAlso includes a `perProduct[]` breakdown with `{ product, fileCount, chunkCount, lastIndexedAt }`\nper product (named products sorted alphabetically; uncategorized files shown as `product: null`).\n\n```json\n{}\n```\n\n---\n\n### `search_knowledge_base`\n\nSemantic similarity search over the indexed KB. Returns matched text chunks with citation metadata\n(source file, source type, location, excerpt). Returns an explicit `noRelevantContent` result when\nno KB content matches the query — Bob should not fabricate KB-grounded claims in that case.\n\nPass the optional `product` filter to restrict search to a specific product subfolder.\n\n```json\n{\n  \"query\": \"predictive maintenance AI capabilities\",\n  \"topK\": 5,\n  \"product\": \"Maximo\"\n}\n```\n\n---\n\n### `generate_content`\n\nGenerates a structured document or report outline grounded in KB evidence. Each section is\npopulated with retrieved evidence excerpts and a suggested outline that Bob can expand into full\nprose. No `status` fields are included — this is for general documents and reports, not RFP\nresponses.\n\n> **`product` is now required.** This prevents evidence from unrelated products leaking into a\n> single-product deliverable. Use `list_products` or `get_index_status` to see available products.\n> Returns a clear error if the product has no indexed files (including a list of available products).\n\n```json\n{\n  \"type\": \"document\",\n  \"topic\": \"IBM Maximo Application Suite overview\",\n  \"product\": \"Maximo\",\n  \"topKPerSection\": 3\n}\n```\n\nReturns `{ doc_type, topic, product, anyEvidence, sections[] }` where each section has `title`,\n`outline`, `evidence[]`, and `hasEvidence`.\n\n---\n\n### `generate_rfp_response`\n\nTakes a batch of RFP questions (with optional `reqId`s) and retrieves KB evidence for each. Returns\nstructured outlines that Bob uses to draft compliant, evidence-backed responses. No `status` fields\nare assigned — Bob adds COMPLIANT / PARTIAL / NON-COMPLIANT judgements before calling\n`render_document`.\n\n> **`product` is now required** (applies to the entire question batch). Returns a clear short-circuit\n> error if the product has no indexed files, rather than repeating the same error on every question.\n\n```json\n{\n  \"product\": \"Maximo\",\n  \"questions\": [\n    { \"question\": \"Does the solution support role-based access control?\", \"reqId\": \"R-001\" },\n    { \"question\": \"What deployment models are available?\", \"reqId\": \"R-002\" }\n  ],\n  \"topKPerQuestion\": 3\n}\n```\n\nReturns `{ product, anyEvidence, sections[] }`. Sections without KB matches include `noKbContent: true` and\n`noKbContentMessage` to flag gaps for manual research.\n\n---\n\n### `render_document`\n\nRenders a structured document to branded HTML or Markdown. Accepts two document types:\n\n| `doc_type` | Description |\n|---|---|\n| `rfp_response` | Includes a Compliance Summary matrix, status badges (COMPLIANT / PARTIAL / NON-COMPLIANT / NEEDS-REVIEW), and req_id labels |\n| `document` / `report` | General document layout — no compliance matrix or status fields |\n\nBoth types include a deduplicated citations list and a confidentiality footer.\n\n```json\n{\n  \"doc_type\": \"rfp_response\",\n  \"title\": \"MAS RFP Response — City of Springfield\",\n  \"submitted_to\": \"City of Springfield\",\n  \"outputFormat\": \"html\",\n  \"sections\": [\n    {\n      \"req_id\": \"R-001\",\n      \"title\": \"Role-based access control\",\n      \"status\": \"COMPLIANT\",\n      \"response_markdown\": \"MAS supports fine-grained RBAC with SSO integration...\",\n      \"evidence\": [...]\n    }\n  ]\n}\n```\n\n---\n\n## Typical Workflow\n\n```\n1. cse-toolkit init               — configure KB path, product line, branding\n2. update_knowledge_base          — index the KB (incremental; re-run after adding files)\n3. list_products / get_index_status — confirm files are indexed\n4. search_knowledge_base          — ad-hoc semantic search\n5. generate_rfp_response          — batch-process RFP questions → evidence-backed outlines\n6. render_document                — render final branded HTML or Markdown\n```\n\nFor general documents (not RFPs):\n\n```\n5. generate_content               — generate document/report outline\n6. render_document                — render with doc_type \"document\" or \"report\"\n```\n\n---\n\n## Privacy and Data Handling\n\n- **No cloud calls at query or index time.** All embeddings and similarity search run locally\n  using `sqlite-vec` and the cached `bge-small-en-v1.5` model.\n- **One-time model download.** The ~33 MB embedding model is fetched from Hugging Face on the\n  first run of `cse-toolkit init` and cached at `~/.cache/Xenova/` (or the platform default).\n  After that, no outbound network requests are made by the MCP server.\n- **Config stored locally.** `~/.cse-toolkit/config.json` holds your KB path and branding config.\n  The index database (`~/.cse-toolkit/cse_kb.db` by default) stores only chunk text and embeddings\n  — no document files are copied.\n\n---\n\n## Known Limitations (v1)\n\n- **Windows / Linux sqlite-vec:** Native binary compilation for sqlite-vec on platforms other than\n  macOS arm64 has not been validated in v1. If you see a native module error on first run, check\n  that your Node.js version matches the pre-built binary slot or build from source.\n- **PDF export not available.** `render_document` outputs HTML or Markdown only. PDF export\n  (via Puppeteer or similar) is deferred to a future release.\n- **Scanned PDFs:** Image-only PDFs produce few or no text chunks. The `lowTextFlag` in\n  `list_products` and `get_index_status` identifies these files. Use a pre-processed text version\n  where possible.\n\n---\n\n## Development\n\n```bash\ncd cse-toolkit\nnpm install\nnpm run build       # tsc + chmod 755 build/index.js build/cli.js\nnpm run dev         # tsc --watch\n```\n\nVerification scripts (workspace root):\n\n| Script | Covers |\n|---|---|\n| `node smoke-test.cjs` | Native module load (sqlite-vec, better-sqlite3) |\n| `node index-verify.mjs` | Chunking, embedding, DB round-trip |\n| `node tool-verify.mjs` | list_products, search_knowledge_base, update_knowledge_base, get_index_status |\n| `node generate-content-verify.mjs` | generate_content tool |\n| `node generate-rfp-response-verify.mjs` | generate_rfp_response tool |\n| `node render-document-verify.mjs` | render_document (HTML + Markdown, both doc types) |\n| `node end-to-end-verify.mjs` | Full pipeline — all 7 tools in sequence, deletion + re-index |\n","readmeFilename":"README.md"}