Skip to content

feat(server): allow appending deployment-specific MCP instructions#203

Open
daltoniam wants to merge 1 commit into
mainfrom
feat/server-extra-instructions
Open

feat(server): allow appending deployment-specific MCP instructions#203
daltoniam wants to merge 1 commit into
mainfrom
feat/server-extra-instructions

Conversation

@daltoniam

Copy link
Copy Markdown
Owner

Why

The MCP initialize response tells connecting clients how to use the gateway (search before execute, session context, pinning, etc.). That guidance was fixed, so a deployment had no way to add notes that only apply to some tenants — for example that a particular organization has private-resource tunnels and how to target a specific one.

What changed

  • Add a WithExtraInstructions(text) server option that appends deployment-specific guidance to the standard instructions.
  • The open-source default is unchanged: with no option set, clients receive exactly the same instructions as before.

Tests

Added a test that drives the initialize handshake over an in-memory transport and asserts the base instructions are always present and that supplied extra text is appended only when the option is used.

Context

Enables a hosted deployment to tell assistants, per organization, that private tunnels exist and how to reach them — the client-facing half of making multi-tunnel querying discoverable.

💘 Generated with Crush

The initialize response tells connecting clients how to use the gateway,
but the guidance was fixed. Hosted deployments need to add notes that only
apply to some tenants — for example that an organization has private
resource tunnels and how to target them.

Add an option to append extra text to the standard instructions so those
deployments can surface capabilities that vary per tenant, without changing
what the open-source default sends.

💘 Generated with Crush

Assisted-by: Crush:claude-opus-4-8

@acmacalister acmacalister left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All CI checks passed (build, test, lint, security). Clean diff — follows existing Option pattern, extracts baseInstructions cleanly, and the in-memory transport test verifies the initialize handshake. LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants