@tempo-ai/mcp 0.0.157-staging.1 → 0.0.157

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.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as e}from"node:module";e(import.meta.url);import{run as r}from"./chunk-ORWZHZDG.js";import"./chunk-F6FX3DG7.js";import"./chunk-NCFWHGWN.js";r(process.argv).then(e=>{process.exitCode=e},e=>{console.error(e instanceof Error?e.stack||e.message:e),process.exitCode=1});
2
+ import{createRequire as e}from"node:module";e(import.meta.url);import{run as r}from"./chunk-M22S2I46.js";import"./chunk-F6FX3DG7.js";import"./chunk-NCFWHGWN.js";r(process.argv).then(e=>{process.exitCode=e},e=>{console.error(e instanceof Error?e.stack||e.message:e),process.exitCode=1});
@@ -1 +1 @@
1
- import{createRequire as t}from"node:module";t(import.meta.url);import{ensureCliAuth as o,parseServeArgs as e}from"./chunk-F6FX3DG7.js";import"./chunk-NCFWHGWN.js";import{Client as r}from"@modelcontextprotocol/sdk/client/index.js";import{InMemoryTransport as n}from"@modelcontextprotocol/sdk/inMemory.js";async function connectAggregate(t){const{createTempoAggregate:o}=await(import("./serve-WUCN4DIX.js")),e=await o(t,{stageDocuments:!1}),[s,a]=n.createLinkedPair(),c=new r({name:"tempo-mcp-cli",version:"0"});return await e.aggregate.connect(a),await c.connect(s),{client:c,dispose:async()=>{await c.close(),await e.dispose()}}}function extractFlag(t,o){const e=t.filter(t=>t!==o);return{present:e.length!==t.length,rest:e}}async function runTools(t){const{present:r,rest:n}=extractFlag(t,"--schemas"),s=e(n);if("error"in s)return console.error(s.error),1;await o();const{client:a,dispose:c}=await connectAggregate(s);try{const{tools:t}=await a.listTools(),o=t.map(t=>r?{name:t.name,description:t.description,inputSchema:t.inputSchema}:{name:t.name,description:t.description});return console.log(JSON.stringify({tools:o},null,2)),0}finally{await c()}}async function runCall(t){const[r,...n]=t;if(!r||r.startsWith("--"))return console.error('Usage: tempo-mcp call <tool> --json \'{"orgId": "...", ...}\'\nDiscover tools and their schemas with `tempo-mcp tools --schemas`.'),1;let s=null;const a=[];for(let t=0;t<n.length;t++)"--json"===n[t]?s=n[++t]??null:a.push(n[t]);let c={};if(null!=s){"-"===s&&(s=await readStdin());try{const t=JSON.parse(s);if(null===t||"object"!=typeof t||Array.isArray(t))return console.error("--json must be a JSON object of tool arguments"),1;c=t}catch(t){return console.error(`--json is not valid JSON: ${t instanceof Error?t.message:String(t)}`),1}}const i=e(a);if("error"in i)return console.error(i.error),1;await o();const{client:l,dispose:m}=await connectAggregate(i);try{const t=await l.callTool({name:r,arguments:c}),o=Array.isArray(t.content)?t.content:[];for(const t of o)"text"===t.type?console.log(t.text):console.log(JSON.stringify(t));return t.isError?1:0}finally{await m()}}function readStdin(){return new Promise((t,o)=>{const e=[];process.stdin.on("data",t=>e.push(Buffer.from(t))),process.stdin.on("end",()=>t(Buffer.concat(e).toString("utf8"))),process.stdin.on("error",o)})}export{runCall,runTools};
1
+ import{createRequire as t}from"node:module";t(import.meta.url);import{ensureCliAuth as o,parseServeArgs as e}from"./chunk-F6FX3DG7.js";import"./chunk-NCFWHGWN.js";import{Client as r}from"@modelcontextprotocol/sdk/client/index.js";import{InMemoryTransport as n}from"@modelcontextprotocol/sdk/inMemory.js";async function connectAggregate(t){const{createTempoAggregate:o}=await(import("./serve-QKEMBDNI.js")),e=await o(t,{stageDocuments:!1}),[s,a]=n.createLinkedPair(),c=new r({name:"tempo-mcp-cli",version:"0"});return await e.aggregate.connect(a),await c.connect(s),{client:c,dispose:async()=>{await c.close(),await e.dispose()}}}function extractFlag(t,o){const e=t.filter(t=>t!==o);return{present:e.length!==t.length,rest:e}}async function runTools(t){const{present:r,rest:n}=extractFlag(t,"--schemas"),s=e(n);if("error"in s)return console.error(s.error),1;await o();const{client:a,dispose:c}=await connectAggregate(s);try{const{tools:t}=await a.listTools(),o=t.map(t=>r?{name:t.name,description:t.description,inputSchema:t.inputSchema}:{name:t.name,description:t.description});return console.log(JSON.stringify({tools:o},null,2)),0}finally{await c()}}async function runCall(t){const[r,...n]=t;if(!r||r.startsWith("--"))return console.error('Usage: tempo-mcp call <tool> --json \'{"orgId": "...", ...}\'\nDiscover tools and their schemas with `tempo-mcp tools --schemas`.'),1;let s=null;const a=[];for(let t=0;t<n.length;t++)"--json"===n[t]?s=n[++t]??null:a.push(n[t]);let c={};if(null!=s){"-"===s&&(s=await readStdin());try{const t=JSON.parse(s);if(null===t||"object"!=typeof t||Array.isArray(t))return console.error("--json must be a JSON object of tool arguments"),1;c=t}catch(t){return console.error(`--json is not valid JSON: ${t instanceof Error?t.message:String(t)}`),1}}const i=e(a);if("error"in i)return console.error(i.error),1;await o();const{client:l,dispose:m}=await connectAggregate(i);try{const t=await l.callTool({name:r,arguments:c}),o=Array.isArray(t.content)?t.content:[];for(const t of o)"text"===t.type?console.log(t.text):console.log(JSON.stringify(t));return t.isError?1:0}finally{await m()}}function readStdin(){return new Promise((t,o)=>{const e=[];process.stdin.on("data",t=>e.push(Buffer.from(t))),process.stdin.on("end",()=>t(Buffer.concat(e).toString("utf8"))),process.stdin.on("error",o)})}export{runCall,runTools};
@@ -1 +1 @@
1
- import{createRequire as e}from"node:module";e(import.meta.url);import{NotSignedInError as o,clearAuth as n,ensureCliAuth as t,envAccessToken as r,parseServeArgs as s,readAuth as a,runLogin as i}from"./chunk-F6FX3DG7.js";var l='tempo-mcp <subcommand>\n\nTempo\'s MCP server — issues, docs, comments, agents, scripts, Slack,\nLinear, and (inside a Tempo repo) canvas tools, served as ONE stdio MCP\nserver.\n\nGet started (no account needed first):\n claude mcp add tempo -- npx -y @tempo-ai/mcp\n Then use any Tempo tool from Claude Code — the first one that needs\n Tempo opens the browser to sign in or create an account. Other hosts\n (Codex / Cursor) take the same command:\n { "tempo": { "command": "npx", "args": ["-y", "@tempo-ai/mcp"] } }\n\nScoping: the AI passes an explicit orgId (and projectId where\nproject-scoped) on every tool call, discovered via the built-in\ntempo_list_orgs / tempo_list_projects tools. Nothing org-related is\nconfigured on the connection.\n\nServer:\n (default) | serve Serve the aggregate MCP server over stdio\n --toolsets a,b Only these toolsets (issues,docs,comments,agents,\n scripts,slack,linear,canvas,design-context). Default: all.\n --readonly Register no write tools at all\n\nDirect tool access (for hosts without MCP support — Codex cloud, bots):\n tools [--schemas] List every tool (add --schemas for arg schemas)\n call <tool> --json \'{"orgId": "..."}\'\n Invoke any tool; same pipeline as the MCP server.\n --json - reads the argument object from stdin.\n Both accept --toolsets / --readonly.\n\nAuth (identity only — optional; the server prompts on first use):\n login Sign in via the browser ahead of time\n logout Clear stored credentials (~/.tempo/auth.json)\n whoami Show the signed-in user (exchanges TEMPO_AUTH_TOKEN\n if set — the smoke test for headless environments)\n token create [--name <label>]\n Mint a personal access token (printed once) for\n headless environments — cloud sandboxes with no\n browser. Set it there as TEMPO_AUTH_TOKEN.\n token list List your tokens\n token revoke <id-or-prefix>\n Revoke a token\n\nEnvironment:\n TEMPO_CONVEX_URL Override the Convex deployment (default: production)\n TEMPO_MCP_READONLY=1 Same as --readonly\n TEMPO_AUTH_TOKEN Personal access token — signs in without a browser\n TEMPO_MCP_NO_BROWSER=1 Never open a browser; sign-in links are only\n printed / returned to the host\n TEMPO_MCP_SIGN_IN_WAIT_MS\n How long a tool call waits for the browser sign-in\n before returning the link (default 120000)\n';async function runWhoami(){let e=await a();if(r())try{await t(),e=await a()}catch(e){return console.error("TEMPO_AUTH_TOKEN sign-in failed:",e instanceof Error?e.message:String(e)),1}if(!e)return console.log("Not signed in. Use a Tempo tool from your agent to get a sign-in link, or run `npx -y @tempo-ai/mcp login`."),1;const o=e.email?`${e.email} (${e.userId})`:e.userId;console.log(`Signed in as: ${o}`);const n=e.expiresAt-Date.now();return n<=0?console.log(`Token state: expired ${Math.round(-n/1e3)}s ago (refresh on next call)`):console.log(`Token state: fresh, expires in ${Math.round(n/1e3)}s`),0}async function runLogout(){return await n(),console.log("Signed out. The next Tempo tool call from your agent will prompt for sign-in (or run `npx -y @tempo-ai/mcp login`)."),0}async function run(e){const[,,n,...t]=e;if("--help"===n||"-h"===n||"help"===n)return process.stdout.write(l),0;try{if(!n||"serve"===n||n.startsWith("--")){const e=n&&"serve"!==n?[n,...t]:t,o=s(e);if("error"in o)return console.error(o.error),process.stderr.write(l),1;const{runServe:r}=await(import("./serve-WUCN4DIX.js"));return await r(o)}switch(n){case"login":return await i();case"logout":return await runLogout();case"whoami":return await runWhoami();case"token":{const{runToken:e}=await(import("./token-O44QDXRT.js"));return await e(t)}case"tools":{const{runTools:e}=await(import("./call-M5BE3JNG.js"));return await e(t)}case"call":{const{runCall:e}=await(import("./call-M5BE3JNG.js"));return await e(t)}default:return console.error(`Unknown subcommand: ${n}`),process.stderr.write(l),1}}catch(e){return e instanceof o?(console.error(e.message),1):(console.error(e instanceof Error?e.stack||e.message:String(e)),1)}}export{run};
1
+ import{createRequire as e}from"node:module";e(import.meta.url);import{NotSignedInError as o,clearAuth as n,ensureCliAuth as t,envAccessToken as r,parseServeArgs as s,readAuth as a,runLogin as i}from"./chunk-F6FX3DG7.js";var l='tempo-mcp <subcommand>\n\nTempo\'s MCP server — issues, docs, comments, agents, scripts, Slack,\nLinear, and (inside a Tempo repo) canvas tools, served as ONE stdio MCP\nserver.\n\nGet started (no account needed first):\n claude mcp add tempo -- npx -y @tempo-ai/mcp\n Then use any Tempo tool from Claude Code — the first one that needs\n Tempo opens the browser to sign in or create an account. Other hosts\n (Codex / Cursor) take the same command:\n { "tempo": { "command": "npx", "args": ["-y", "@tempo-ai/mcp"] } }\n\nScoping: the AI passes an explicit orgId (and projectId where\nproject-scoped) on every tool call, discovered via the built-in\ntempo_list_orgs / tempo_list_projects tools. Nothing org-related is\nconfigured on the connection.\n\nServer:\n (default) | serve Serve the aggregate MCP server over stdio\n --toolsets a,b Only these toolsets (issues,docs,comments,agents,\n scripts,slack,linear,canvas,design-context). Default: all.\n --readonly Register no write tools at all\n\nDirect tool access (for hosts without MCP support — Codex cloud, bots):\n tools [--schemas] List every tool (add --schemas for arg schemas)\n call <tool> --json \'{"orgId": "..."}\'\n Invoke any tool; same pipeline as the MCP server.\n --json - reads the argument object from stdin.\n Both accept --toolsets / --readonly.\n\nAuth (identity only — optional; the server prompts on first use):\n login Sign in via the browser ahead of time\n logout Clear stored credentials (~/.tempo/auth.json)\n whoami Show the signed-in user (exchanges TEMPO_AUTH_TOKEN\n if set — the smoke test for headless environments)\n token create [--name <label>]\n Mint a personal access token (printed once) for\n headless environments — cloud sandboxes with no\n browser. Set it there as TEMPO_AUTH_TOKEN.\n token list List your tokens\n token revoke <id-or-prefix>\n Revoke a token\n\nEnvironment:\n TEMPO_CONVEX_URL Override the Convex deployment (default: production)\n TEMPO_MCP_READONLY=1 Same as --readonly\n TEMPO_AUTH_TOKEN Personal access token — signs in without a browser\n TEMPO_MCP_NO_BROWSER=1 Never open a browser; sign-in links are only\n printed / returned to the host\n TEMPO_MCP_SIGN_IN_WAIT_MS\n How long a tool call waits for the browser sign-in\n before returning the link (default 120000)\n';async function runWhoami(){let e=await a();if(r())try{await t(),e=await a()}catch(e){return console.error("TEMPO_AUTH_TOKEN sign-in failed:",e instanceof Error?e.message:String(e)),1}if(!e)return console.log("Not signed in. Use a Tempo tool from your agent to get a sign-in link, or run `npx -y @tempo-ai/mcp login`."),1;const o=e.email?`${e.email} (${e.userId})`:e.userId;console.log(`Signed in as: ${o}`);const n=e.expiresAt-Date.now();return n<=0?console.log(`Token state: expired ${Math.round(-n/1e3)}s ago (refresh on next call)`):console.log(`Token state: fresh, expires in ${Math.round(n/1e3)}s`),0}async function runLogout(){return await n(),console.log("Signed out. The next Tempo tool call from your agent will prompt for sign-in (or run `npx -y @tempo-ai/mcp login`)."),0}async function run(e){const[,,n,...t]=e;if("--help"===n||"-h"===n||"help"===n)return process.stdout.write(l),0;try{if(!n||"serve"===n||n.startsWith("--")){const e=n&&"serve"!==n?[n,...t]:t,o=s(e);if("error"in o)return console.error(o.error),process.stderr.write(l),1;const{runServe:r}=await(import("./serve-QKEMBDNI.js"));return await r(o)}switch(n){case"login":return await i();case"logout":return await runLogout();case"whoami":return await runWhoami();case"token":{const{runToken:e}=await(import("./token-O44QDXRT.js"));return await e(t)}case"tools":{const{runTools:e}=await(import("./call-GVSFO6WO.js"));return await e(t)}case"call":{const{runCall:e}=await(import("./call-GVSFO6WO.js"));return await e(t)}default:return console.error(`Unknown subcommand: ${n}`),process.stderr.write(l),1}}catch(e){return e instanceof o?(console.error(e.message),1):(console.error(e instanceof Error?e.stack||e.message:String(e)),1)}}export{run};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{createRequire as r}from"node:module";r(import.meta.url);import{run as o}from"./chunk-ORWZHZDG.js";import"./chunk-F6FX3DG7.js";import"./chunk-NCFWHGWN.js";export{o as run};
1
+ import{createRequire as r}from"node:module";r(import.meta.url);import{run as o}from"./chunk-M22S2I46.js";import"./chunk-F6FX3DG7.js";import"./chunk-NCFWHGWN.js";export{o as run};