{"_id":"@bytesell/slurp-mcp","name":"@bytesell/slurp-mcp","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@bytesell/slurp-mcp","version":"0.1.0","description":"Model Context Protocol server for Slurp: validate, render, inspect and look up .slurp templates in-process, so a coding agent can close its own correction loop.","license":"MIT","author":"ByteSell LLC","repository":{"type":"git","url":"git+https://github.com/bytesell/slurp.git","directory":"mcp"},"bugs":{"url":"https://github.com/bytesell/slurp/issues"},"homepage":"https://github.com/bytesell/slurp#readme","publishConfig":{"access":"public"},"keywords":["slurp","mcp","model-context-protocol","templating","agent"],"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","bin":{"slurp-mcp":"./dist/bin.js"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"dependencies":{"@modelcontextprotocol/sdk":"^1.30.0","zod":"^4.4.3","@bytesell/slurp-compiler-wasm":"0.1.0"},"devDependencies":{"@types/node":"^22.0.0","tsup":"^8.5.1","typescript":"^5.9.3","vite":"^8.2.0","vitest":"^4.1.10"},"engines":{"node":">=20"},"scripts":{"build":"tsup && node scripts/generate-llms-full.mjs","test":"vitest run","typecheck":"tsc --noEmit -p tsconfig.json","start":"node dist/bin.js","build:llms":"node scripts/generate-llms-full.mjs","check:llms":"node scripts/generate-llms-full.mjs --check"},"_nodeVersion":"26.0.0","_id":"@bytesell/slurp-mcp@0.1.0","dist":{"integrity":"sha512-oK1L6+aLeTM07jbEwuRHGSl3qwWO0p085PXjFzQlNaVBLaIaNLyTl5Vsu2aVz3g07KhP52g4N+pTVrV74GoGWA==","shasum":"8a57d0fda2bdff155a494afec0fcce54acc48d44","tarball":"https://registry.npmjs.org/@bytesell/slurp-mcp/-/slurp-mcp-0.1.0.tgz","fileCount":12,"unpackedSize":740535,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDiORmx49co9swx4RQvNFBVjUzOQ/E3b++GML+IcFYDLAiAlHUgw9WoFGPpiojJB8kS405HJW3SIqqCrk6z7D2rHkg=="}]},"_npmUser":{"name":"ldstr","email":"dip96950@gmail.com"},"directories":{},"maintainers":[{"name":"ldstr","email":"dip96950@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/slurp-mcp_0.1.0_1785936927960_0.6585659280083196"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-05T13:35:27.699Z","0.1.0":"2026-08-05T13:35:28.135Z","modified":"2026-08-05T13:35:28.669Z"},"maintainers":[{"name":"ldstr","email":"dip96950@gmail.com"}],"description":"Model Context Protocol server for Slurp: validate, render, inspect and look up .slurp templates in-process, so a coding agent can close its own correction loop.","homepage":"https://github.com/bytesell/slurp#readme","keywords":["slurp","mcp","model-context-protocol","templating","agent"],"repository":{"type":"git","url":"git+https://github.com/bytesell/slurp.git","directory":"mcp"},"author":"ByteSell LLC","bugs":{"url":"https://github.com/bytesell/slurp/issues"},"license":"MIT","readme":"# @bytesell/slurp-mcp\n\nA [Model Context Protocol](https://modelcontextprotocol.io) server for\n[Slurp](https://github.com/bytesell/slurp), so a coding agent can validate,\nrender and reason about `.slurp` templates instead of guessing at them.\n\nIt runs the real compiler in-process through `@bytesell/slurp-compiler-wasm`: no\nsubprocess, no `slurp` binary on your PATH, and no second implementation of any\nrule in TypeScript. A diagnostic this server reports is a diagnostic the\ncompiler produced, with the same code, message, line and column.\n\n## Install\n\n```bash\nnpm install -g @bytesell/slurp-mcp\n```\n\nOr skip the install and let the client fetch it, which is what the\nconfigurations below do.\n\n## Register it\n\nClaude Code:\n\n```bash\nclaude mcp add slurp -- npx -y @bytesell/slurp-mcp\n```\n\nAdd `-s user` to get it in every project rather than just this one.\n\nAny other client, or a shared `.mcp.json` at your repository root:\n\n```json\n{\n  \"mcpServers\": {\n    \"slurp\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@bytesell/slurp-mcp\"]\n    }\n  }\n}\n```\n\nThe server speaks JSON-RPC over stdio. To point at a clone instead, run\n`pnpm install && pnpm build` in `mcp/` and use\n`{\"command\": \"node\", \"args\": [\"/abs/path/to/slurp/mcp/dist/bin.js\"]}`.\n\nCheck the connection with `claude mcp list`. The server writes one line to\nstderr on startup (`@bytesell/slurp-mcp 0.1.0 listening on stdio`) and nothing at all to\nstdout except protocol frames, because on stdio stdout IS the protocol.\n\n## Tools\n\n| Tool | Question it answers |\n|---|---|\n| `slurp_validate` | Is this correct? |\n| `slurp_render` | What does it produce? |\n| `slurp_lint` | Is it silently wrong? |\n| `slurp_schema` | What is editable here? |\n| `slurp_reference` | How do I write this? |\n\n### `slurp_validate`\n\nCompile-check a template and get back structured diagnostics: code, message,\nfile, line, column, severity.\n\nThis reports what `slurp build` enforces, which is more than parsing. The\ncompile-time security walk is included, so an unfiltered `${ }` in a `<script>`\nbody, a `| js` slot in JavaScript statement position, `env.SLURP_SECRET_*`\naccess, `request.*` outside middleware and `{redirect}` outside middleware are\nall reported here rather than at build time.\n\n```jsonc\n// in\n{ \"source\": \"<script>var x = ${ name };</script>\", \"file\": \"hero.slurp\" }\n\n// out\n{\n  \"ok\": false,\n  \"errors\": 1,\n  \"warnings\": 0,\n  \"diagnostics\": [{\n    \"code\": \"UnsafeScriptInterpolation\",\n    \"message\": \"an expression in a <script> body must end with the `| js` filter ...\",\n    \"file\": \"hero.slurp\",\n    \"line\": 1,\n    \"column\": 20,\n    \"severity\": \"error\"\n  }]\n}\n```\n\nPass `files` instead of `source` to check several templates in one call. Pass\n`is_middleware: true` only for a file that really will be compiled as\nmiddleware, because the rules differ.\n\nThe security walk stops at its first violation, so at most one security\ndiagnostic appears per call. Nothing here resolves imports across files either,\nso a missing component or layout is not reported.\n\n### `slurp_render`\n\nRender against a JSON context, and get the HTML plus every diagnostic.\n\nRendering uses development mode, where two advisories are recorded that\nproduction drops silently: CSS-structural characters stripped from a `style`\nvalue slot, and an un-annotated interpolation in a JavaScript-evaluated\nattribute. `{debug expr}` also renders only here. The budget warnings (loop\ntruncation at 1000 items, the output-byte budget, the render-depth budget) are\nreported in both modes, but `slurp build` prints warnings only under\n`--verbose`.\n\nRendering is deterministic and side-effect free. No network request is made and\nno file is read; `{fetch}` picks a branch by reading its name out of the context\nyou passed.\n\n### `slurp_lint`\n\nThe one tool here that is not a view onto compiler diagnostics. Every rule\ndescribes a construct that both `slurp validate` and `slurp build` accept with\nzero output, and that then renders the empty string or the wrong string.\n\n| Rule | Catches |\n|---|---|\n| `component-prop-literal-interpolation` | A quoted component prop carrying interpolation syntax. It is a literal string, unlike an element attribute. |\n| `filter-arg-not-literal` | A filter argument that is not a literal, so the filter falls back to its default. |\n| `call-always-null` | A function call. There are no callable functions; every call is null. |\n| `let-binding-not-readable` | A `{$let}` name read back as a template value. |\n| `array-length-property` | `.length` on what is probably an array. |\n| `component-prop-unquoted-number` | `prop=123`, which lexes as an attribute NAME. |\n| `unterminated-attribute-interpolation` | A nested `\"` inside `${ }` that ends its attribute early. |\n\nEach finding carries a concrete fix, not just a complaint.\n\n### `slurp_schema`\n\nWhat a template declares in frontmatter: its `section { }` or `block { }` schema\nwith every setting, kind, default and nested block, plus its `props`, its\nimports and its middleware name.\n\nA `null` schema is not an error. Most templates declare none.\n\n### `slurp_reference`\n\nThe language reference, queryable by topic: `overview`, `tags`, `expressions`,\n`filters`, `components`, `scripts`, `frontmatter`, `schema`, `errors`,\n`gotchas`, `limits`.\n\nPass an error code or a filter name as `query` with no topic to jump straight to\nit, which is what you want when holding a diagnostic:\n\n```jsonc\n{ \"query\": \"UnsafeScriptInterpolation\" }\n```\n\n## Resources\n\nFor pulling context in without a tool round-trip:\n\n| URI | Contents |\n|---|---|\n| `slurp://reference/language` | The complete reference, every topic. |\n| `slurp://reference/errors` | Every error code, which ones the compiler emits, and a worked fix for each. |\n| `slurp://reference/gotchas` | The silent failures, with the fix and with whether a tool catches it. |\n\n## How the reference stays correct\n\n`test/tools.test.ts` re-derives the documented claims from the compiler in the\nsame run that asserts them, so a compiler change that invalidates the\ndocumentation turns the suite red rather than leaving a plausible sentence in\nplace. It compiles every \"right\" example in the error reference and requires it\nto validate clean, compiles every \"wrong\" example that claims an error and\nrequires that error, and re-checks the truthiness table, operator semantics,\nloop variables, filter list and `| js` versus `| json` behaviour against real\nrenders.\n\n## Development\n\n```bash\npnpm install\npnpm build       # tsup -> dist/, then regenerates llms-full.txt\npnpm typecheck\npnpm test        # unit tests plus a real stdio round trip against dist/\n```\n\nThe smoke test runs the built server as a child process over a real pipe, so\n`pnpm build` is a prerequisite. Unit tests over the handlers prove the logic and\nprove nothing about the server, and `dist/` is what a host executes.\n\n## License\n\nMIT, ByteSell LLC.\n","readmeFilename":"","_rev":"1-21a11059417db28a7f84f14f5085b93d"}