@theronap/cortex-mcp 0.9.0 → 0.9.1

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.
@@ -16,7 +16,7 @@
16
16
  * Get your token from the Cortex console → Connect your AI.
17
17
  */
18
18
 
19
- const VERSION = '0.6.0'
19
+ const VERSION = '0.9.1'
20
20
  const cmd = process.argv[2]
21
21
  const rest = process.argv.slice(3)
22
22
 
package/lib/server.mjs CHANGED
@@ -41,10 +41,45 @@ export async function runServer(version) {
41
41
  'my_context',
42
42
  {
43
43
  title: 'My Cortex context',
44
- description: 'Your current work context from the org your projects, recent activity, gaps, and any directives from leadership. Scoped to what you are permitted to see.',
45
- inputSchema: {},
44
+ description: 'Your current work context from the org. Pass a question to get query-centered session context seeded from the most relevant node and its neighborhood; omit it for the baseline snapshot.',
45
+ inputSchema: { question: z.string().optional().describe('optional opening user question to center the context around') },
46
+ },
47
+ async ({ question }) => {
48
+ if (!question?.trim()) return { content: [{ type: 'text', text: await fetchContext() }] }
49
+ const res = await fetchCortex(`${BASE}/api/session-context`, {
50
+ method: 'POST',
51
+ headers: { Authorization: `Bearer ${TOKEN}`, 'Content-Type': 'application/json' },
52
+ body: JSON.stringify({ question }),
53
+ })
54
+ if (!res.ok) {
55
+ const body = await res.text()
56
+ throw new Error(classify(res.status, res.headers.get('content-type'), body, res.headers.get('x-vercel-id')).message)
57
+ }
58
+ const { context } = await res.json()
59
+ return { content: [{ type: 'text', text: context }] }
60
+ },
61
+ )
62
+
63
+ server.registerTool(
64
+ 'session_context',
65
+ {
66
+ title: 'Query-centered session context',
67
+ description: 'Build a session-start context block around the user\'s opening question: pick the most relevant seed node, pull its neighborhood, and compress farther hops.',
68
+ inputSchema: { question: z.string().describe('the opening user question or request for this session') },
69
+ },
70
+ async ({ question }) => {
71
+ const res = await fetchCortex(`${BASE}/api/session-context`, {
72
+ method: 'POST',
73
+ headers: { Authorization: `Bearer ${TOKEN}`, 'Content-Type': 'application/json' },
74
+ body: JSON.stringify({ question }),
75
+ })
76
+ if (!res.ok) {
77
+ const body = await res.text()
78
+ throw new Error(classify(res.status, res.headers.get('content-type'), body, res.headers.get('x-vercel-id')).message)
79
+ }
80
+ const { context } = await res.json()
81
+ return { content: [{ type: 'text', text: context }] }
46
82
  },
47
- async () => ({ content: [{ type: 'text', text: await fetchContext() }] }),
48
83
  )
49
84
 
50
85
  server.registerTool(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theronap/cortex-mcp",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Connect your AI assistant to Cortex — your org's projects, activity, gaps, and directives, scoped to you.",
5
5
  "type": "module",
6
6
  "bin": {