@nowline/mcp 0.8.5 → 0.8.6

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/src/index.ts CHANGED
@@ -15,8 +15,8 @@ import { readFileSync } from 'node:fs';
15
15
  import { createServer } from 'node:http';
16
16
  import { dirname, resolve } from 'node:path';
17
17
  import { fileURLToPath } from 'node:url';
18
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
19
- import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
18
+ import { NodeStreamableHTTPServerTransport } from '@modelcontextprotocol/node';
19
+ import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
20
20
  import { expandRootPath } from './root-path.js';
21
21
  import { createMcpServer } from './server.js';
22
22
 
@@ -104,7 +104,7 @@ const server = createMcpServer({
104
104
 
105
105
  if (port !== undefined) {
106
106
  // Streamable HTTP transport — stateless (no session management).
107
- const transport = new StreamableHTTPServerTransport({
107
+ const transport = new NodeStreamableHTTPServerTransport({
108
108
  sessionIdGenerator: undefined,
109
109
  });
110
110
  await server.connect(transport);
package/src/prompts.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // MCP prompt registrations for @nowline/mcp.
2
2
  // Wired into the server via registerPrompts(server).
3
3
 
4
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
+ import type { McpServer } from '@modelcontextprotocol/server';
5
5
  import { z } from 'zod';
6
6
 
7
7
  export function registerPrompts(server: McpServer): void {
@@ -13,13 +13,13 @@ export function registerPrompts(server: McpServer): void {
13
13
  title: 'Create Roadmap from Description',
14
14
  description:
15
15
  'Generate a new .nowline roadmap from a plain-English description. Composes the DSL reference and example files so the LLM has full context.',
16
- argsSchema: {
16
+ argsSchema: z.object({
17
17
  description: z
18
18
  .string()
19
19
  .describe(
20
20
  'Plain-English description of the roadmap you want to create (teams, timeline, key milestones, etc.).',
21
21
  ),
22
- },
22
+ }),
23
23
  },
24
24
  ({ description }) => ({
25
25
  messages: [
@@ -64,7 +64,7 @@ export function registerPrompts(server: McpServer): void {
64
64
  title: 'Fix Roadmap Diagnostics',
65
65
  description:
66
66
  'Fix validation errors in a .nowline file. Describe the validate→fix→re-validate loop keyed on NL.E#### diagnostic codes.',
67
- argsSchema: {
67
+ argsSchema: z.object({
68
68
  source: z
69
69
  .string()
70
70
  .describe('The .nowline source text that contains validation errors.'),
@@ -74,7 +74,7 @@ export function registerPrompts(server: McpServer): void {
74
74
  .describe(
75
75
  'JSON array of diagnostic objects from the validate tool. Omit to let the LLM call validate itself.',
76
76
  ),
77
- },
77
+ }),
78
78
  },
79
79
  ({ source, diagnostics }) => {
80
80
  const diagSection = diagnostics
@@ -113,7 +113,7 @@ export function registerPrompts(server: McpServer): void {
113
113
  title: 'Convert to Nowline',
114
114
  description:
115
115
  'Convert a gantt/timeline from another format (Mermaid gantt, MS Project, Excel, Google Sheets, CSV) into Nowline DSL. Uses the conversion guide resource for format-specific rules.',
116
- argsSchema: {
116
+ argsSchema: z.object({
117
117
  source: z
118
118
  .string()
119
119
  .describe('The source content to convert (paste the raw text/CSV/XML here).'),
@@ -130,7 +130,7 @@ export function registerPrompts(server: McpServer): void {
130
130
  .describe(
131
131
  'Source format hint. Use "auto" (default) to let the LLM detect the format.',
132
132
  ),
133
- },
133
+ }),
134
134
  },
135
135
  ({ source, from }) => {
136
136
  const formatHint =
package/src/server.ts CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  registerAppResource,
15
15
  registerAppTool,
16
16
  } from '@modelcontextprotocol/ext-apps/server';
17
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
17
+ import { McpServer } from '@modelcontextprotocol/server';
18
18
  import { type NowlineFile, parseNowlineJson, printNowlineFile } from '@nowline/core';
19
19
  import {
20
20
  type ExportFormat,
@@ -616,7 +616,8 @@ export function createMcpServer(opts: McpServerOptions = {}): McpServer {
616
616
  .boolean()
617
617
  .optional()
618
618
  .describe(
619
- 'When true, force the in-chat MCP Apps preview. On MCP Apps hosts the preview auto-renders via _meta.ui without this flag.',
619
+ 'When true, force the in-chat MCP Apps preview; when false, return inline output even on an MCP Apps host. ' +
620
+ 'Omit to follow the host: on MCP Apps hosts the preview auto-renders via _meta.ui.',
620
621
  ),
621
622
  }),
622
623
  outputSchema: RenderOutputSchema,
@@ -652,7 +653,8 @@ export function createMcpServer(opts: McpServerOptions = {}): McpServer {
652
653
  pngScale: args.scale,
653
654
  };
654
655
  const host = createNodeHostEnv(filePath);
655
- const appActive = args.preview === true || clientSupportsAppsUi(server);
656
+ // Explicit true/false wins; undefined follows the host's capabilities.
657
+ const appActive = args.preview ?? clientSupportsAppsUi(server);
656
658
  // Skip the full render when the bytes won't be used: apps host with
657
659
  // no write-to-disk path and no review attachment requested.
658
660
  const needsRender = !appActive || !!args.output || args.review === true;