{"_id":"@corsenai/corsen-context","_rev":"4-64aaddbb5e283fee18de9f992d883d6e","name":"@corsenai/corsen-context","dist-tags":{"latest":"2.0.1"},"versions":{"1.2.0":{"name":"@corsenai/corsen-context","version":"1.2.0","keywords":["mcp","llms-txt","ai","context","model-context-protocol","sitemap","wordpress","nextjs","corsen","security","redis","logging","json-rpc"],"author":{"name":"Corsen AI","email":"contact@corsen.ai"},"license":"MIT","_id":"@corsenai/corsen-context@1.2.0","maintainers":[{"name":"corsenai","email":"mordehai.attia@corsen.ai"}],"homepage":"https://github.com/CorsenAI/corsen-context","bugs":{"url":"https://github.com/CorsenAI/corsen-context/issues"},"dist":{"shasum":"6ea7f71335efb071959f72435dccf5074de30f65","tarball":"https://registry.npmjs.org/@corsenai/corsen-context/-/corsen-context-1.2.0.tgz","fileCount":7,"integrity":"sha512-sP2rDmM9hfJMA9d5ENAo2UhFH9Z4QKSBFKT3L7wwFojQsZBHmMYYoY/YPXM7v/EhdZ1tOqOWaXeUyldtnm6KjA==","signatures":[{"sig":"MEUCICpdqDa7wzOL6+k6YwLxgkR0rRn+zegQdJ4hL4nEo0tzAiEAmAmoTc+8vYKH/+8LhBgH1p2X0JVOkeu/bfm/m00upyQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":184205},"main":"./dist/index.js","_from":"file:corsenai-corsen-context-1.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"lint":"eslint src/","test":"vitest run","build":"tsup src/index.ts --format cjs,esm --dts --clean","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"corsenai","email":"mordehai.attia@corsen.ai"},"_resolved":"C:\\Users\\RTX6000\\AppData\\Local\\Temp\\claude\\C--Users-RTX6000-projects-corsen-context\\d6c21ee7-40cc-449c-8035-09b87447b4ef\\scratchpad\\tgz\\corsenai-corsen-context-1.2.0.tgz","_integrity":"sha512-sP2rDmM9hfJMA9d5ENAo2UhFH9Z4QKSBFKT3L7wwFojQsZBHmMYYoY/YPXM7v/EhdZ1tOqOWaXeUyldtnm6KjA==","repository":{"url":"git+https://github.com/CorsenAI/corsen-context.git","type":"git","directory":"packages/core"},"_npmVersion":"11.18.0","description":"Universal AI Context Layer — MCP Server + Enhanced llms.txt for any website","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"zod":"^3.24.0","pino":"^10.3.1","cheerio":"^1.0.0","turndown":"^7.2.0","fast-xml-parser":"^4.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^2.1.0","typescript":"^5.7.0","@types/node":"^22.0.0","@types/turndown":"^5.0.5"},"peerDependencies":{"undici":">=6.0.0"},"peerDependenciesMeta":{"undici":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/corsen-context_1.2.0_1783991403919_0.057315155470750945","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@corsenai/corsen-context","version":"1.3.0","keywords":["mcp","llms-txt","ai","context","model-context-protocol","sitemap","wordpress","nextjs","corsen","security","redis","logging","json-rpc"],"author":{"name":"Corsen AI","email":"contact@corsen.ai"},"license":"MIT","_id":"@corsenai/corsen-context@1.3.0","maintainers":[{"name":"corsenai","email":"mordehai.attia@corsen.ai"}],"homepage":"https://github.com/CorsenAI/corsen-context","bugs":{"url":"https://github.com/CorsenAI/corsen-context/issues"},"dist":{"shasum":"047de747d349bc96107394057ed832e5247807b9","tarball":"https://registry.npmjs.org/@corsenai/corsen-context/-/corsen-context-1.3.0.tgz","fileCount":7,"integrity":"sha512-txxfjxnT1fOqAS+l4FVfI4cJLBgXpJTjJj1fmjqwgF3Nw/QmGukrNfj/gaORxbLQREolMbbjz8zotXFau4NJXg==","signatures":[{"sig":"MEUCIQCabhCvuJbfBdWaDKJ02r/d7utOjftFfGo9WCrBZWtEYwIgfBRAlJBd0DOZSX4vOanJWq2r1WdwETQ7i5jHV3UWAWk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":197281},"main":"./dist/index.js","_from":"file:corsenai-corsen-context-1.3.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"lint":"eslint src/","test":"vitest run","build":"tsup src/index.ts --format cjs,esm --dts --clean","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"corsenai","email":"mordehai.attia@corsen.ai"},"_resolved":"/tmp/2d227ed9080743f0d3197faa66dfca55/corsenai-corsen-context-1.3.0.tgz","_integrity":"sha512-txxfjxnT1fOqAS+l4FVfI4cJLBgXpJTjJj1fmjqwgF3Nw/QmGukrNfj/gaORxbLQREolMbbjz8zotXFau4NJXg==","repository":{"url":"git+https://github.com/CorsenAI/corsen-context.git","type":"git","directory":"packages/core"},"_npmVersion":"11.17.0","description":"Universal AI Context Layer — MCP Server + Enhanced llms.txt for any website","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","dependencies":{"zod":"^3.24.0","pino":"^10.3.1","cheerio":"^1.0.0","turndown":"^7.2.0","fast-xml-parser":"^4.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^2.1.0","typescript":"^5.7.0","@types/node":"^22.0.0","@types/turndown":"^5.0.5"},"peerDependencies":{"undici":">=6.0.0"},"peerDependenciesMeta":{"undici":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/corsen-context_1.3.0_1788093402706_0.4636048574132787","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@corsenai/corsen-context","version":"2.0.0","keywords":["mcp","llms-txt","ai","context","model-context-protocol","sitemap","wordpress","nextjs","corsen","security","redis","logging","json-rpc"],"author":{"name":"Corsen AI","email":"contact@corsen.ai"},"license":"MIT","_id":"@corsenai/corsen-context@2.0.0","maintainers":[{"name":"corsenai","email":"mordehai.attia@corsen.ai"}],"homepage":"https://github.com/CorsenAI/corsen-context","bugs":{"url":"https://github.com/CorsenAI/corsen-context/issues"},"dist":{"shasum":"bf316c92f077dcc7815dcecefd066f1193b9e161","tarball":"https://registry.npmjs.org/@corsenai/corsen-context/-/corsen-context-2.0.0.tgz","fileCount":7,"integrity":"sha512-11kAjbAuOanaqsgcjDjLzm0CI4XKt+2Am6ejQhlUWrbG1ViVYOyDPeVfDKuANaNVykDSrVuGG7LAeSP9hooGcg==","signatures":[{"sig":"MEUCIQDHZk2GtEIozJaUT4RPKiAanG56rYobgZMPVIGcK1zZkAIgLiwIRIt+2bPOZjRATBYacxJyK2xOsNlzOJq0J58se0A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":235334},"main":"./dist/index.js","_from":"file:corsenai-corsen-context-2.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"lint":"eslint src/","test":"vitest run","build":"tsup src/index.ts --format cjs,esm --dts --clean","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"corsenai","email":"mordehai.attia@corsen.ai"},"_resolved":"C:\\Users\\RTX6000\\projects\\wordpressplugins\\corsen-context\\packages\\core\\corsenai-corsen-context-2.0.0.tgz","_integrity":"sha512-11kAjbAuOanaqsgcjDjLzm0CI4XKt+2Am6ejQhlUWrbG1ViVYOyDPeVfDKuANaNVykDSrVuGG7LAeSP9hooGcg==","repository":{"url":"git+https://github.com/CorsenAI/corsen-context.git","type":"git","directory":"packages/core"},"_npmVersion":"11.18.0","description":"Owner-controlled public content tools for MCP, WebMCP, llms.txt, and sitemaps","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"zod":"^3.24.0","pino":"^10.3.1","cheerio":"^1.0.0","turndown":"^7.2.0","fast-xml-parser":"^5.7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vite":"^8.2.2","undici":"^7.29.0","vitest":"^4.1.11","typescript":"^5.9.3","@types/node":"^22.0.0","@upstash/redis":"^1.38.3","@types/turndown":"^5.0.5"},"peerDependencies":{"undici":">=6.0.0"},"peerDependenciesMeta":{"undici":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/corsen-context_2.0.0_1788120434135_0.9570129133844947","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@corsenai/corsen-context","version":"2.0.1","description":"Owner-controlled public content tools for MCP, WebMCP, llms.txt, and sitemaps","author":"Corsen AI <contact@corsen.ai>","license":"MIT","homepage":"https://github.com/CorsenAI/corsen-context","repository":{"type":"git","url":"https://github.com/CorsenAI/corsen-context.git","directory":"packages/core"},"keywords":["mcp","llms-txt","ai","context","model-context-protocol","sitemap","wordpress","nextjs","corsen","security","redis","logging","json-rpc"],"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"dependencies":{"cheerio":"^1.0.0","fast-xml-parser":"^5.7.0","pino":"^10.3.1","turndown":"^7.2.0","zod":"^3.24.0"},"peerDependencies":{"undici":">=6.0.0"},"peerDependenciesMeta":{"undici":{"optional":true}},"devDependencies":{"@upstash/redis":"^1.38.3","@types/node":"^22.0.0","@types/turndown":"^5.0.5","tsup":"^8.5.1","typescript":"^5.9.3","undici":"^7.29.0","vite":"^8.2.2","vitest":"^4.1.11"},"publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/CorsenAI/corsen-context/issues"},"sideEffects":false,"engines":{"node":">=22.12.0"},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts --clean","test":"vitest run","test:watch":"vitest","lint":"eslint src/","typecheck":"tsc --noEmit","clean":"rm -rf dist"},"_nodeVersion":"24.19.0","_id":"@corsenai/corsen-context@2.0.1","dist":{"integrity":"sha512-Qei3XXdaFzx4QmGKNC3U412dJUBv/kAP5QMhpTnlhfQKybQQ+YEEVyNgzY61AIPoYNX65cMjCELqcXpSVICIXQ==","shasum":"b3878d41b3e28676c8ce33b791e2f126c561022e","tarball":"https://registry.npmjs.org/@corsenai/corsen-context/-/corsen-context-2.0.1.tgz","fileCount":7,"unpackedSize":235525,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@corsenai%2fcorsen-context@2.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDkKBBpLtfFRW0mts9gyG5VBXa6UoGWz3rrTRB6kr0yyQIgNaton0Y2R8hOCWhDHXogQZvyG9OgE74OiCdvUiEfDKU="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8ed6c9a1-8a53-42af-a366-9c5aad011187"}},"directories":{},"maintainers":[{"name":"corsenai","email":"mordehai.attia@corsen.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/corsen-context_2.0.1_1788360544851_0.16888898722408063"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-14T01:10:03.746Z","modified":"2026-09-02T14:49:05.291Z","1.2.0":"2026-07-14T01:10:04.068Z","1.3.0":"2026-08-30T12:36:42.841Z","2.0.0":"2026-08-30T20:07:14.289Z","2.0.1":"2026-09-02T14:49:04.985Z"},"bugs":{"url":"https://github.com/CorsenAI/corsen-context/issues"},"author":"Corsen AI <contact@corsen.ai>","license":"MIT","homepage":"https://github.com/CorsenAI/corsen-context","keywords":["mcp","llms-txt","ai","context","model-context-protocol","sitemap","wordpress","nextjs","corsen","security","redis","logging","json-rpc"],"repository":{"type":"git","url":"https://github.com/CorsenAI/corsen-context.git","directory":"packages/core"},"description":"Owner-controlled public content tools for MCP, WebMCP, llms.txt, and sitemaps","maintainers":[{"name":"corsenai","email":"mordehai.attia@corsen.ai"}],"readme":"# @corsenai/corsen-context\n\nThe core engine of **[Corsen Context](https://github.com/CorsenAI/corsen-context)** — owner-controlled public content through MCP, WebMCP, and bounded `llms.txt` output.\n\n```bash\nnpm install @corsenai/corsen-context\n```\n\n```typescript\nimport {\n  CorsenContext,\n  createInMemoryProvider,\n  generateWebMCPScript,\n  toWebMCPTools,\n} from '@corsenai/corsen-context';\n\nconst cc = new CorsenContext(\n  { siteUrl: 'https://example.com' },\n  createInMemoryProvider([\n    {\n      url: 'https://example.com/',\n      title: 'Home',\n      description: 'Welcome',\n      markdown: '# Home',\n      metadata: {},\n      type: 'page',\n    },\n  ]),\n);\n\nconst server = cc.createMCPServer();\nconst result = await server.handleRequest(requestBody, clientIp);\n\n// Serve this string as GET /webmcp.js on the same origin as POST /v1/mcp.\nconst webmcpScript = generateWebMCPScript(toWebMCPTools(server.getToolDefinitions()), {\n  mcpEndpoint: '/v1/mcp',\n});\n```\n\nLoad `/webmcp.js` from the site's pages with\n`<script src=\"/webmcp.js\" defer></script>`. The bridge registers the four\ntools through `document.modelContext` and forwards calls to the same-origin MCP\nendpoint. It intentionally sends no API key or visitor credentials: use a\npublic, read-only, rate-limited endpoint for WebMCP, or omit the browser bridge\nwhen MCP requires server-side authentication.\n\nThis package provides the framework-agnostic core: the MCP JSON-RPC 2.0 server,\nWebMCP bridge generation, `llms.txt` generators, HTML-to-Markdown converter,\nSSRF-safe fetching, rate limiting, caching, and the content-access policy. A\nworking site integration must also implement a `ContentProvider` backed only\nby the public content it intends to expose.\n\nThe resolved configuration enforces these owner controls and bounds:\n\n```typescript\nconst cc = new CorsenContext(\n  {\n    siteUrl: 'https://example.com',\n    mcp: { enabled: true },\n    content: { maxPages: 500 }, // 1–5000\n    static: {\n      generateLlmsTxt: true,\n      includeFullContent: false,\n      maxOutputBytes: 5_242_880, // 64 KiB–10 MiB\n    },\n  },\n  provider,\n);\n```\n\nWith `mcp.enabled: false`, direct MCP dispatch is rejected before the provider\nis invoked; adapters also use this value to return `404` from their MCP and\nWebMCP routes. With `static.generateLlmsTxt: false`, both `CorsenContext`\ngeneration methods refuse generation. Full-content generation additionally\nrequires\n`static.includeFullContent: true`, which is off by default. Both static outputs\nare capped at `maxOutputBytes` without splitting a UTF-8 code point and append\na truncation notice when the complete output would exceed the limit.\nFull-content iteration returns as soon as the next block would exceed the budget.\n\nStatic headings, labels, descriptions, dates, and Markdown destinations are\nnormalized and escaped. The provider's page-body `markdown` is passed through\nunchanged and remains untrusted site-authored content; this package does not\nclaim to neutralize it.\n\n- **Full docs:** https://github.com/CorsenAI/corsen-context#readme\n- **Security model:** [SECURITY.md](https://github.com/CorsenAI/corsen-context/blob/main/SECURITY.md)\n- **License:** MIT\n","readmeFilename":""}