NH

napthaai/http-oauth-mcp-server

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

110 stars 18 forks 品質 56 トレンド 0MIT

napthaai/http-oauth-mcp-server は、https://github.com/napthaai/http-oauth-mcp-server. からインポートされた MCP サーバー候補です。

概要

napthaai/http-oauth-mcp-server は、https://github.com/napthaai/http-oauth-mcp-server. からインポートされた MCP サーバー候補です。

概要(AI 翻訳)

はじめに

このリポジトリは、MCP仕様に基づいてOAuthで認可されたStreamable HTTPおよびSSEトランスポートをサポートするリモートMCPサーバーを作成するための参照実装を提供します。

このリポジトリ内のMCPサーバーは、SSE + HTTPトランスポートを扱うアプリケーションやOAuthとは論理的に別物であることに注意してください。

その結果、このリポジトリを簡単にフォークし、自分のMCPサーバーとOAuth認証情報を接続して、独自の機能を持つ動作するSSE/HTTP + OAuth MCPサーバーを作ることができます。

でも、なぜ?

素晴らしい質問ですね!MCP仕様は2025年3月25日にOAuthに基づく認可仕様を追加しました。現在、2025年5月1日時点で:

  • Typescript SDKには、ストリーミング可能なHTTPでOAuth認証済みMCPサーバーを実現するための多くの構成要素が含まれていますが、そのようなサーバーの構築方法に関するドキュメントやチュートリアルはありません
  • Python SDKには、Streamable HTTPトランスポートの実装も、typescript SDKに存在するOAuthビルディングブロックの実装も含まれていません

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

🌊 HTTP + SSE MCP Server w/ OAuth

Introduction

This repo provides a reference implementation for creating a remote MCP server that supports the Streamable HTTP & SSE Transports, authorized with OAuth based on the MCP specification.

Note that the MCP server in this repo is logically separate from the application that handles the report SSE + HTTP transports, and from OAuth.

As a result, you can easily fork this repo, and plug in your own MCP server and OAuth credentials for a working SSE/HTTP + OAuth MCP server with your own functionality.

But, why?

Great question! The MCP specification added the authorization specification based on OAuth on March 25, 2025. At present, as of May 1, 2025:

  • The Typescript SDK contains many of the building blocks for accomplishing an OAuth-authorized MCP server with streamable HTTP, but there is no documentation or tutorial on how to build such a server
  • The Python SDK contains neither an implementation of the streamable HTTP transport, nor an implementation of the OAuth building blocks that are present in the typescript SDK
  • The Streamable HTTP transport is broadly unsupported by MCP host applications such as Cursor and Claude desktop, though it may be integrated directly into agents written in JavaScript using the JS/TS SDK’s StreamableHttpClientTransport class

At Naptha AI, we really wanted to build an OAuth-authorized MCP server on the streamable HTTP transport, and couldn’t find any reference implementations, so we decided to build one ourselves!

Dependencies

Bun, a fast all-in-one JavaScript runtime, is the recommended runtime and package manager for this repository. Limited compatibility testing has been done with npm + tsc.

Overview

This repository provides the following:

  1. An MCP server, which you can easily replace with your own
  2. An express.js application that manages both the SSE and Streamable HTTP transports and OAuth authorization.

This express application is what you plug your credentials and MCP server into.

Note that while this express app implements the required OAuth endpoints including /authorize and the Authorization Server Metadata endpoint (RFC8414), it does not implement an OAuth authorization server!

This example proxies OAuth to an upstream OAuth server which supports dynamic client registration (RFC7591). To use this example, you will need to bring your own authorization server. We recommend using Auth0; see the “Setting up OAuth” Section below.

Configuring your server

Notes on OAuth & Dynamic Client Registration

GitHub で README 全文を見る

インストール

npx mcp-remote --transport http-first https://some-domain.server.com/mcp
MCP 初心者?mcpskill.org のガイドから始めましょう →