@lunora/mcp 1.0.0-alpha.256 → 1.0.0-alpha.257
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/packem_shared/{connectStdio-Cm0YVCDW.mjs → connectStdio-CTD0HwH3.mjs} +1 -1
- package/dist/packem_shared/{createAuthedMcpFetchHandler-Dpykpe_3.mjs → createAuthedMcpFetchHandler-BVEO-ghq.mjs} +1 -1
- package/dist/packem_shared/{createLunoraMcpServer-JDjUApoq.mjs → createLunoraMcpServer-BFRSsplA.mjs} +1 -1
- package/dist/packem_shared/{createMcpFetchHandler-D0-ic-nj.mjs → createMcpFetchHandler-BplACIHY.mjs} +1 -1
- package/dist/worker/index.mjs +1 -1
- package/package.json +2 -2
package/dist/bin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{parseAgentsEnv as N}from"./packem_shared/AGENT_RUN_INPUT_SCHEMA-BBVvXopY.mjs";import l from"./packem_shared/connectStdio-
|
|
2
|
+
import{parseAgentsEnv as N}from"./packem_shared/AGENT_RUN_INPUT_SCHEMA-BBVvXopY.mjs";import l from"./packem_shared/connectStdio-CTD0HwH3.mjs";const E=new Set(["1","on","true","yes"]),o=r=>r!==void 0&&E.has(r.trim().toLowerCase());class s extends Error{code;constructor(e,a){super(e),this.name="BinError",this.code=a}}const O=async(r,e={})=>{const a=e.connect??l,i=e.writeError??(t=>{process.stderr.write(t)}),n=r.LUNORA_URL;if(n===void 0||n.length===0)throw i(`lunora-mcp: LUNORA_URL environment variable is required
|
|
3
3
|
`),new s("LUNORA_URL environment variable is required",1);const c=r.LUNORA_ADMIN_TOKEN;if(c===void 0||c.length===0)throw i(`lunora-mcp: LUNORA_ADMIN_TOKEN environment variable is required (every tool reads admin-gated routes)
|
|
4
4
|
`),new s("LUNORA_ADMIN_TOKEN environment variable is required",1);const A=Number(r.LUNORA_MCP_AGENT_TIMEOUT_MS),_=Number.isFinite(A)&&A>0?A:void 0;try{await a({agents:N(r.LUNORA_MCP_AGENTS),allowAgents:o(r.LUNORA_MCP_ALLOW_AGENTS),allowDataReads:o(r.LUNORA_MCP_ALLOW_DATA_READS),allowObservability:o(r.LUNORA_MCP_ALLOW_OBSERVABILITY),allowWrites:o(r.LUNORA_MCP_ALLOW_WRITES),token:c,url:n,..._===void 0?{}:{agentMaxWaitMs:_}})}catch(t){const L=t instanceof Error?t.message:String(t);throw i(`lunora-mcp: failed to start — ${L}
|
|
5
5
|
`),new s(`failed to start — ${L}`,1)}};try{await O(process.env)}catch(r){process.exit(r instanceof s?r.code:1)}
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AGENT_RUN_INPUT_SCHEMA as r,AGENT_STATUS_TOOL_NAME as t,agentToolDefinitions as c,callAgentTool as a,parseAgentsEnv as T}from"./packem_shared/AGENT_RUN_INPUT_SCHEMA-BBVvXopY.mjs";import{createAuthedMcpFetchHandler as S,mcpTokenScopes as _}from"./packem_shared/createAuthedMcpFetchHandler-
|
|
1
|
+
import{AGENT_RUN_INPUT_SCHEMA as r,AGENT_STATUS_TOOL_NAME as t,agentToolDefinitions as c,callAgentTool as a,parseAgentsEnv as T}from"./packem_shared/AGENT_RUN_INPUT_SCHEMA-BBVvXopY.mjs";import{createAuthedMcpFetchHandler as S,mcpTokenScopes as _}from"./packem_shared/createAuthedMcpFetchHandler-BVEO-ghq.mjs";import{createToolServer as l}from"./packem_shared/createToolServer-Bf_IxX3S.mjs";import{createMcpFetchHandler as O}from"./packem_shared/createMcpFetchHandler-BplACIHY.mjs";import{LOCAL_SERVER_NAME as N,NO_DEPLOYMENT_MESSAGE as f,connectLocalStdio as s,createLocalMcpServer as I,localTools as L}from"./packem_shared/LOCAL_SERVER_NAME-3ydSaBjA.mjs";import{createPaidMcpServer as x}from"./packem_shared/createPaidMcpServer-DQmcP8ls.mjs";import{createLunoraMcpServer as i}from"./packem_shared/createLunoraMcpServer-BFRSsplA.mjs";import{default as R}from"./packem_shared/connectStdio-CTD0HwH3.mjs";import{R as v,W as F,c as U,t as Y}from"./packem_shared/tools-BrvavFhl.mjs";import{DEFAULT_MAX_REQUEST_BYTES as h,serveStateless as u}from"./packem_shared/DEFAULT_MAX_REQUEST_BYTES-CbbpkHRK.mjs";import{OBSERVABILITY_TOOL_DEFINITIONS as G}from"./packem_shared/OBSERVABILITY_TOOL_DEFINITIONS-DrY5Gp38.mjs";export{r as AGENT_RUN_INPUT_SCHEMA,t as AGENT_STATUS_TOOL_NAME,h as DEFAULT_MAX_REQUEST_BYTES,N as LOCAL_SERVER_NAME,f as NO_DEPLOYMENT_MESSAGE,G as OBSERVABILITY_TOOL_DEFINITIONS,v as READ_ONLY_TOOL_DEFINITIONS,F as WRITE_TOOL_DEFINITIONS,c as agentToolDefinitions,a as callAgentTool,U as callTool,s as connectLocalStdio,R as connectStdio,S as createAuthedMcpFetchHandler,I as createLocalMcpServer,i as createLunoraMcpServer,O as createMcpFetchHandler,x as createPaidMcpServer,l as createToolServer,L as localTools,_ as mcpTokenScopes,T as parseAgentsEnv,u as serveStateless,Y as toolDefinitions};
|
package/dist/node/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LOCAL_SERVER_NAME as r,NO_DEPLOYMENT_MESSAGE as c,connectLocalStdio as t,createLocalMcpServer as a,localTools as E}from"../packem_shared/LOCAL_SERVER_NAME-3ydSaBjA.mjs";import{createLunoraMcpServer as l}from"../packem_shared/createLunoraMcpServer-
|
|
1
|
+
import{LOCAL_SERVER_NAME as r,NO_DEPLOYMENT_MESSAGE as c,connectLocalStdio as t,createLocalMcpServer as a,localTools as E}from"../packem_shared/LOCAL_SERVER_NAME-3ydSaBjA.mjs";import{createLunoraMcpServer as l}from"../packem_shared/createLunoraMcpServer-BFRSsplA.mjs";import{default as n}from"../packem_shared/connectStdio-CTD0HwH3.mjs";export{r as LOCAL_SERVER_NAME,c as NO_DEPLOYMENT_MESSAGE,t as connectLocalStdio,n as connectStdio,a as createLocalMcpServer,l as createLunoraMcpServer,E as localTools};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{StdioServerTransport as i}from"@modelcontextprotocol/sdk/server/stdio.js";import{readFileSync as a}from"node:fs";import{dirname as n,join as c}from"node:path";import{fileURLToPath as s}from"node:url";import{createLunoraMcpServer as m}from"./createLunoraMcpServer-
|
|
1
|
+
import{StdioServerTransport as i}from"@modelcontextprotocol/sdk/server/stdio.js";import{readFileSync as a}from"node:fs";import{dirname as n,join as c}from"node:path";import{fileURLToPath as s}from"node:url";import{createLunoraMcpServer as m}from"./createLunoraMcpServer-BFRSsplA.mjs";const p=()=>{let r=n(s(import.meta.url));for(let e=0;e<8;e+=1){try{const o=JSON.parse(a(c(r,"package.json"),"utf8"));if(o.name==="@lunora/mcp"&&typeof o.version=="string"&&o.version.length>0)return o.version}catch{}const t=n(r);if(t===r)break;r=t}},S=async r=>{const e=p(),t=m(e===void 0?r:{version:e,...r});return await t.connect(new i),t};export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LunoraError as y}from"@lunora/errors";import{isAgentToolName as S}from"./AGENT_RUN_INPUT_SCHEMA-BBVvXopY.mjs";import{readScreenedBody as g,serveStateless as w}from"./DEFAULT_MAX_REQUEST_BYTES-CbbpkHRK.mjs";import{resolveClient as d,createLunoraMcpServer as T}from"./createLunoraMcpServer-
|
|
1
|
+
import{LunoraError as y}from"@lunora/errors";import{isAgentToolName as S}from"./AGENT_RUN_INPUT_SCHEMA-BBVvXopY.mjs";import{readScreenedBody as g,serveStateless as w}from"./DEFAULT_MAX_REQUEST_BYTES-CbbpkHRK.mjs";import{resolveClient as d,createLunoraMcpServer as T}from"./createLunoraMcpServer-BFRSsplA.mjs";import{c as M}from"./tool-call-Bs-QeKp6.mjs";import{d as E,s as _,S as k}from"./tools-BrvavFhl.mjs";const A=t=>typeof t.scope!="string"?new Set:new Set(t.scope.split(" ").filter(c=>c!=="")),C=(t,c)=>{const o={...t};for(const{flag:s,scope:n}of k)o[s]=t[s]===!0&&c.has(n);return o},I=(t,c,o)=>{const s=new Set,n=c.agents??[];for(const l of t){const e=M(l);if(e===void 0)continue;(E.has(e)||S(e,n))&&s.add(o);const r=_(e,c);r!==void 0&&s.add(r)}return s},N=256,B=t=>{const{maxRequestBytes:c,stepUp:o}=t;if(o!==void 0&&(typeof o.scope!="string"||o.scope===""||typeof o.challenge!="function"))throw new y("MCP_STEP_UP_MISCONFIGURED","createAuthedMcpFetchHandler: `stepUp` needs a non-empty `scope` and a `challenge` function.");const s=typeof t.server=="function"?void 0:d(t.server),n=new Map,l=e=>{if(e.client!==void 0||e.url===void 0||e.token===void 0||e.token.length===0)return d(e);const r=JSON.stringify([e.url,e.token]),i=n.get(r);if(i!==void 0&&i.fetch===e.fetch)return n.delete(r),n.set(r,i),i.client;const f=d(e);return n.delete(r),n.set(r,{client:f,fetch:e.fetch}),n.size>N&&n.delete(n.keys().next().value),f};return t.protect(async(e,r)=>{const i=A(r),f=typeof t.server=="function"?await t.server(r):{...t.server,client:s};let a;if(o!==void 0){const p=await g(e,c);if("response"in p)return p.response;({parsedBody:a}=p);const m=Array.isArray(a)?a:[a],u=[...I(m,f,o.scope)].filter(v=>!i.has(v));if(u.length>0)throw o.challenge(u)}const h=C(typeof t.server=="function"?{...f,client:l(f)}:f,i);return await w(T(h),e,{maxRequestBytes:c,parsedBody:a})})};export{B as createAuthedMcpFetchHandler,A as mcpTokenScopes};
|
package/dist/packem_shared/{createLunoraMcpServer-JDjUApoq.mjs → createLunoraMcpServer-BFRSsplA.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LunoraClient as f}from"@lunora/client";import{LunoraError as m}from"@lunora/errors";import{Server as w}from"@modelcontextprotocol/sdk/server/index.js";import{ListToolsRequestSchema as d,CallToolRequestSchema as h}from"@modelcontextprotocol/sdk/types.js";import{agentToolDefinitions as A,isAgentToolName as M,callAgentTool as T}from"./AGENT_RUN_INPUT_SCHEMA-BBVvXopY.mjs";import{t as R,c as k}from"./tools-BrvavFhl.mjs";var N="1.0.0-alpha.
|
|
1
|
+
import{LunoraClient as f}from"@lunora/client";import{LunoraError as m}from"@lunora/errors";import{Server as w}from"@modelcontextprotocol/sdk/server/index.js";import{ListToolsRequestSchema as d,CallToolRequestSchema as h}from"@modelcontextprotocol/sdk/types.js";import{agentToolDefinitions as A,isAgentToolName as M,callAgentTool as T}from"./AGENT_RUN_INPUT_SCHEMA-BBVvXopY.mjs";import{t as R,c as k}from"./tools-BrvavFhl.mjs";var N="1.0.0-alpha.256";const E={version:N},L="lunora",y=e=>{if(e.client!==void 0)return e.client;if(e.url===void 0)throw new m("INTERNAL","createLunoraMcpServer requires either a `client` or a `url`");if(e.token===void 0||e.token.length===0)throw new m("UNAUTHENTICATED","createLunoraMcpServer requires a `token` (LUNORA_ADMIN_TOKEN) alongside `url`: every tool reaches admin-gated /_lunora/admin/* routes, so an unauthenticated server can only 403. Writes stay off unless `allowWrites` is set.");const r=new f({fetch:e.fetch,url:e.url});return r.setAuthToken(e.token),r},C=e=>{const r=y(e),n=e.allowWrites??!1,s=e.allowAgents??!1,t=e.agents??[],o=typeof e.token=="string"&&e.token.length>0,i=e.allowObservability===!0&&o,c=e.allowDataReads===!0&&o,a=new w({name:L,version:e.version??E.version},{capabilities:{tools:{}}});return a.setRequestHandler(d,()=>({tools:[...R(n,i,c),...A(t,s)]})),a.setRequestHandler(h,async v=>{const{arguments:g,name:l}=v.params,u=g??{};return M(l,t)?await T(r,l,u,{allowAgents:s,exposures:t,...e.agentMaxWaitMs===void 0?{}:{maxWaitMs:e.agentMaxWaitMs},...e.agentPollIntervalMs===void 0?{}:{pollIntervalMs:e.agentPollIntervalMs}}):await k(r,l,u,n,i,c)}),a};export{C as createLunoraMcpServer,y as resolveClient};
|
package/dist/packem_shared/{createMcpFetchHandler-D0-ic-nj.mjs → createMcpFetchHandler-BplACIHY.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{serveStateless as c}from"./DEFAULT_MAX_REQUEST_BYTES-CbbpkHRK.mjs";import{DEFAULT_MAX_REQUEST_BYTES as u}from"./DEFAULT_MAX_REQUEST_BYTES-CbbpkHRK.mjs";import{resolveClient as s,createLunoraMcpServer as a}from"./createLunoraMcpServer-
|
|
1
|
+
import{serveStateless as c}from"./DEFAULT_MAX_REQUEST_BYTES-CbbpkHRK.mjs";import{DEFAULT_MAX_REQUEST_BYTES as u}from"./DEFAULT_MAX_REQUEST_BYTES-CbbpkHRK.mjs";import{resolveClient as s,createLunoraMcpServer as a}from"./createLunoraMcpServer-BFRSsplA.mjs";const l=e=>{const r=s(e);return t=>c(a({...e,client:r}),t,{maxRequestBytes:e.maxRequestBytes})};export{u as DEFAULT_MAX_REQUEST_BYTES,l as createMcpFetchHandler,c as serveStateless};
|
package/dist/worker/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AGENT_RUN_INPUT_SCHEMA as r,AGENT_STATUS_TOOL_NAME as t,agentToolDefinitions as T,callAgentTool as a,parseAgentsEnv as _}from"../packem_shared/AGENT_RUN_INPUT_SCHEMA-BBVvXopY.mjs";import{createAuthedMcpFetchHandler as c,mcpTokenScopes as p}from"../packem_shared/createAuthedMcpFetchHandler-
|
|
1
|
+
import{AGENT_RUN_INPUT_SCHEMA as r,AGENT_STATUS_TOOL_NAME as t,agentToolDefinitions as T,callAgentTool as a,parseAgentsEnv as _}from"../packem_shared/AGENT_RUN_INPUT_SCHEMA-BBVvXopY.mjs";import{createAuthedMcpFetchHandler as c,mcpTokenScopes as p}from"../packem_shared/createAuthedMcpFetchHandler-BVEO-ghq.mjs";import{createToolServer as O}from"../packem_shared/createToolServer-Bf_IxX3S.mjs";import{createMcpFetchHandler as l}from"../packem_shared/createMcpFetchHandler-BplACIHY.mjs";import{createPaidMcpServer as A}from"../packem_shared/createPaidMcpServer-DQmcP8ls.mjs";import{R as n,W as f,c as m,t as x}from"../packem_shared/tools-BrvavFhl.mjs";import{DEFAULT_MAX_REQUEST_BYTES as D,serveStateless as L}from"../packem_shared/DEFAULT_MAX_REQUEST_BYTES-CbbpkHRK.mjs";import{OBSERVABILITY_TOOL_DEFINITIONS as M}from"../packem_shared/OBSERVABILITY_TOOL_DEFINITIONS-DrY5Gp38.mjs";export{r as AGENT_RUN_INPUT_SCHEMA,t as AGENT_STATUS_TOOL_NAME,D as DEFAULT_MAX_REQUEST_BYTES,M as OBSERVABILITY_TOOL_DEFINITIONS,n as READ_ONLY_TOOL_DEFINITIONS,f as WRITE_TOOL_DEFINITIONS,T as agentToolDefinitions,a as callAgentTool,m as callTool,c as createAuthedMcpFetchHandler,l as createMcpFetchHandler,A as createPaidMcpServer,O as createToolServer,p as mcpTokenScopes,_ as parseAgentsEnv,L as serveStateless,x as toolDefinitions};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/mcp",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.257",
|
|
4
4
|
"description": "Model Context Protocol server exposing a Lunora deployment to AI agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@cfworker/json-schema": "^4.1.1",
|
|
65
|
-
"@lunora/client": "1.0.0-alpha.
|
|
65
|
+
"@lunora/client": "1.0.0-alpha.244",
|
|
66
66
|
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
67
67
|
"@lunora/shard-engine": "1.0.0-alpha.154",
|
|
68
68
|
"@lunora/wire": "1.0.0-alpha.2",
|