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?

SpringのOAuth認証付きStreamable HTTPのMCPサーバを動かす(MCP Inspector v2版)

0
Posted at

概要

2026-07-28 にMCPがアップデートされ、MCP Inspectorもアップデートされた。
image.png

アップデートされたMCP Inspectorの使い方を勉強していく。
以前も動かしたことがあるSpringのOAuth認証付きのMCPサンプルに接続してみる。
詳しくは以下参照。

MCPサーバ・OAuth認証サーバ立ち上げ

サンプルにはMCPサーバとOAuth認証サーバ両方含まれているので、README通りに起動するだけ。今回はWindowsのコマンドプロンプトに合わせた手順を紹介する。

image.png

フォルダ準備

このGitHubをcloneもしくは、ダウンロードしたZIPを解凍してフォルダを準備する。

OAuth認証サーバ起動

サンプル中のmvnw.cmdのあるディレクトリで以下を実行

mvnw.cmd spring-boot:run -pl samples/sample-authorization-server

MCPサーバ起動

サンプル中のmvnw.cmdのあるディレクトリで以下を実行

mvnw.cmd spring-boot:run -pl samples/sample-mcp-server

OAuth認証の操作方法(MCP Inspector)

MCP Inspectorを起動

コマンドプロンプトで以下を実行

npx @modelcontextprotocol/inspector

MCP Inspectorの設定

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

OAuthの設定はこのように書いてあるのでこれに合わせる。
image.png

Settingを開いて以下を設定。
Client ID: default-client
Client Secret: default-secret
image.png

MCP Inspectorの接続

トグルスイッチをONにするとログイン画面に移動する。
ここでuserpasswordを入力して「Sign in」をクリック。これで接続完了。
image.png

接続完了後は、この画面に戻ってくる。
image.png

Connection Info

接続後は、Connection Info が増える。Access Tokenなどを確認できる。
image.png

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?