Skip to content

Commit 2f83178

Browse files
committed
fix: review update
1 parent bad4e81 commit 2f83178

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/__tests__/__snapshots__/options.defaults.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ exports[`options defaults should return specific properties: defaults 1`] = `
111111
---
112112
113113
",
114-
"serverOptions": {
114+
"serverInstanceOptions": {
115115
"instructions": "Use the PatternFly MCP when a user asks about: PatternFly, pf, pf docs, design tokens, design guidelines, accessibility, PatternFly components, and frontend development.",
116116
},
117117
"stats": {

src/__tests__/server.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ describe('runServer', () => {
153153
{
154154
minMax: DEFAULT_OPTIONS.minMax,
155155
patternflyOptions: DEFAULT_OPTIONS.patternflyOptions,
156-
serverOptions: DEFAULT_OPTIONS.serverOptions,
156+
serverInstanceOptions: DEFAULT_OPTIONS.serverInstanceOptions,
157157
...options
158158
} as any,
159159
Object.keys(settings).length > 0 ? settings : { allowProcessExit: false }
@@ -187,7 +187,6 @@ describe('runServer', () => {
187187
{
188188
minMax: DEFAULT_OPTIONS.minMax,
189189
patternflyOptions: DEFAULT_OPTIONS.patternflyOptions,
190-
serverOptions: DEFAULT_OPTIONS.serverOptions,
191190
...options,
192191
name: 'test-server'
193192
} as any,

src/options.defaults.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { type ToolModule } from './server.toolsUser';
3333
* @property resourceModules - Array for programmatic registration of resource provider modules, similar to `toolModules` but
3434
* for MCP resources and currently only internal.
3535
* @property separator - Default string delimiter.
36-
* @property serverOptions - Server-instance options.
36+
* @property serverInstanceOptions - Server-instance options.
3737
* @property {StatsOptions} stats - Stats options.
3838
* @property {typeof TOOL_MEMO_OPTIONS} toolMemoOptions - Tool-specific memoization options.
3939
* @property {ToolModule|ToolModule[]} toolModules - Array of external tool modules (ESM specs or paths) to be loaded and
@@ -63,7 +63,7 @@ interface DefaultOptions<TLogOptions = LoggingOptions> {
6363
resourceMemoOptions: Partial<typeof RESOURCE_MEMO_OPTIONS>;
6464
resourceModules: unknown | unknown[];
6565
separator: string;
66-
serverOptions: ServerOptions;
66+
serverInstanceOptions: ServerInstanceOptions;
6767
stats: StatsOptions;
6868
toolMemoOptions: Partial<typeof TOOL_MEMO_OPTIONS>;
6969
toolModules: ToolModule | ToolModule[];
@@ -249,10 +249,10 @@ interface LoggingSession extends LoggingOptions {
249249
/**
250250
* MCP Server instance options.
251251
*
252-
* @interface ServerOptions
253-
* @property instructions Instructions for the MCP server.
252+
* @interface ServerInstanceOptions
253+
* @property instructions Instructions for the MCP server instance.
254254
*/
255-
interface ServerOptions {
255+
interface ServerInstanceOptions {
256256
instructions: string;
257257
}
258258

@@ -412,7 +412,7 @@ const TOOL_MEMO_OPTIONS = {
412412
/**
413413
* Default server instance options.
414414
*/
415-
const SERVER_OPTIONS: ServerOptions = {
415+
const SERVER_INSTANCE_OPTIONS: ServerInstanceOptions = {
416416
instructions: 'Use the PatternFly MCP when a user asks about: PatternFly, pf, pf docs, design tokens, design guidelines, accessibility, PatternFly components, and frontend development.'
417417
};
418418

@@ -517,7 +517,7 @@ const DEFAULT_OPTIONS: DefaultOptions = {
517517
repoName: basename(process.cwd() || '').trim(),
518518
repoResources: REPO_RESOURCES,
519519
resourceMemoOptions: RESOURCE_MEMO_OPTIONS,
520-
serverOptions: SERVER_OPTIONS,
520+
serverInstanceOptions: SERVER_INSTANCE_OPTIONS,
521521
stats: STATS_OPTIONS,
522522
resourceModules: [],
523523
toolMemoOptions: TOOL_MEMO_OPTIONS,

src/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ const runServer = async (options: ServerOptions = getOptions(), {
233233

234234
try {
235235
const enableProtocolLogging = options?.logging?.protocol;
236+
const serverInstructions = options?.serverInstanceOptions?.instructions;
236237

237238
server = new McpServer(
238239
{
@@ -245,7 +246,7 @@ const runServer = async (options: ServerOptions = getOptions(), {
245246
resources: {},
246247
...(enableProtocolLogging ? { logging: {} } : {})
247248
},
248-
instructions: options.serverOptions.instructions
249+
...(serverInstructions ? { instructions: serverInstructions } : {})
249250
}
250251
);
251252

0 commit comments

Comments
 (0)