0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MCP TypeScript SDKのMCPサーバサンプルを動かす

0
Posted at

概要

2026-07-28 にMCPがアップデートされた。
Javaで対応しているSDKがないため、対応済みであるMCP TypeScript SDKのMCPサーバサンプルを動かす。

MCPサーバ立ち上げ

このREADMEに沿って進めればいい

image.png

typescript-sdkの下で以下のコマンドで、依存パッケージをインストールとビルドを実行する。

pnpm install
pnpm build:all

今回はツールのMCPサーバを実行したいので、以下のコマンドでサーバを立ち上げる。

pnpm --filter @mcp-examples/tools server -- --http --port 3000

MCP Inspectorで接続(v2)

以下でMCP Inspectorを起動

npx @modelcontextprotocol/inspector

MCP Inspectorの設定

以下の設定にする。
Server ID: 自由
Transport Type: Streamable HTTP
URL: http://127.0.0.1:3000/mcp
image.png

Protocol Era

Server SettingProtocol Era で3種類(Legacy, Auto, Modern)から接続方式を選択できる。
MCP TypeScript SDKのMCPサーバサンプルは2026-07-282025-11-25の両方に対応している。
image.png

接続(Legacy)

バージョンは2025-11-25
image.png

INITIALIZEから接続が始まっているので間違いなく2025-11-25以前の接続方式である。
image.png

接続(Modern)

バージョンは2026-07-28
image.png

SERVER/DISCOVERから接続が始まっている。
image.png

接続(Auto)

バージョンは2026-07-282026-07-28で接続できない場合は、2025-11-25で接続を試みるらしい。
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?