Skip to content

Support MCP InitializeResult.instructions / server instructions? #183

@esgn

Description

@esgn

Hi! I’m trying to understand whether mcp-framework currently supports MCP server instructions, specifically the instructions field in InitializeResult:

https://modelcontextprotocol.io/specification/draft/schema#initializeresult-instructions

From the MCP spec, instructions is an optional string returned during initialization that can describe how the client should use the server and its available features.

The official TypeScript SDK appears to support this through server options, for example:

const server = new McpServer(
  { name: "my-server", version: "1.0.0" },
  {
    instructions: "Use this server for X. Always call tool A before tool B."
  }
);

I looked through mcp-framework’s MCPServer configuration and didn’t find an equivalent option. It looks like MCPServerConfig currently exposes fields like name, version, basePath, and transport, but not instructions.

Is there currently a supported way to set server-level MCP instructions in mcp-framework?

For example, I was hoping to do something like:

import { MCPServer } from "mcp-framework";

const server = new MCPServer({
  name: "my-server",
  version: "1.0.0",
  instructions: `
Use search_docs before get_page.
Use list_sections when the user asks to browse documentation.
Do not call write tools unless the user explicitly asks for a change.
  `.trim()
});

await server.start();

If this is not currently supported, would you be open to adding an instructions?: string field to MCPServerConfig and forwarding it to the underlying TypeScript SDK server initialization?

Roughly:

export interface MCPServerConfig {
  name?: string;
  version?: string;
  basePath?: string;
  transport?: TransportConfig;
  instructions?: string;
}

And then passing it through when creating the underlying SDK server:

this.server = new Server(
  {
    name: this.serverName,
    version: this.serverVersion
  },
  {
    capabilities: this.capabilities,
    instructions: this.instructions
  }
);

This would make it possible for framework users to provide server-level usage guidance in a standards-compatible way.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions