Skip to content

docs(examples): add minimal remote MCP server example#1715

Open
travisbreaks wants to merge 1 commit intomodelcontextprotocol:mainfrom
travisbreaks:feat/remote-server-example
Open

docs(examples): add minimal remote MCP server example#1715
travisbreaks wants to merge 1 commit intomodelcontextprotocol:mainfrom
travisbreaks:feat/remote-server-example

Conversation

@travisbreaks
Copy link

Summary

Adds a focused, well-documented example of a remote MCP server using StreamableHTTP transport. This addresses the documentation gap described in #777.

The existing simpleStreamableHttp.ts example includes OAuth, tasks, elicitation, and other advanced features that make it hard for newcomers to identify the minimal setup. The new remoteServer.ts example strips away everything except what you need to get a working remote server:

  • Session management: tracks connected clients via Mcp-Session-Id header
  • Streaming responses: tools that emit progress notifications via SSE
  • Tools, resources, and prompts: one of each, clearly commented
  • Graceful shutdown: closes all active transports on SIGINT
  • Claude Desktop config: shows the exact JSON to connect

The example is ~200 lines, fully commented, and runnable with a single command:

pnpm --filter @modelcontextprotocol/examples-server exec tsx src/remoteServer.ts

Test plan

  • pnpm build:all passes
  • pnpm --filter @modelcontextprotocol/examples-server run lint passes
  • Server starts and accepts connections from MCP Inspector
  • greet tool returns expected response
  • count tool streams log notifications during execution
  • server-info resource returns JSON with uptime
  • summarize prompt returns expected template
  • Session termination via DELETE works correctly

Fixes #777

🤖 Generated with Claude Code

Adds a focused, runnable example of a remote MCP server using
StreamableHTTP transport. Covers session management, streaming
responses via SSE, tools, resources, prompts, and graceful shutdown.

This addresses the documentation gap described in modelcontextprotocol#777 where users
struggle to find a working starting point for remote MCP servers.

Fixes modelcontextprotocol#777

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@travisbreaks travisbreaks requested a review from a team as a code owner March 19, 2026 16:27
@changeset-bot
Copy link

changeset-bot bot commented Mar 19, 2026

⚠️ No Changeset found

Latest commit: 28664b0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 19, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1715

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1715

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1715

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1715

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1715

commit: 28664b0

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.

Where to search actually WORKING example of using Remote MCP server aka "Connector" for Claude?

1 participant