
napthaai/http-oauth-mcp-server
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
napthaai/http-oauth-mcp-server — это кандидат на MCP-сервер, импортированный из https://github.com/napthaai/http-oauth-mcp-server.
Обзор
napthaai/http-oauth-mcp-server — это кандидат на MCP-сервер, импортированный из https://github.com/napthaai/http-oauth-mcp-server.
Обзор (машинный перевод)
Введение
Этот репозиторий предоставляет эталонную реализацию для создания удалённого MCP-сервера, поддерживающего потоковые HTTP и SSE транспорты, авторизованные с помощью OAuth на основе спецификации MCP.
Обратите внимание, что MCP-сервер в этом репозитории логически отделен от приложения, которое обрабатывает отчётные SSE + HTTP-транспорты, а также от OAuth.
В результате вы легко можете форковать этот репозиторий и подключить свой собственный MCP-сервер и учетные данные OAuth для рабочего SSE/HTTP + OAuth MCP сервера с собственной функциональностью.
Но почему?
Отличный вопрос! Спецификация MCP добавила спецификацию авторизации на основе OAuth 25 марта 2025 года. На данный момент, по состоянию на 1 мая 2025 года:
- Typescript SDK содержит многие строительные блоки для создания OAuth-авторизованного MCP-сервера с потоковым HTTP, но нет документации или обучающих материалов по созданию такого сервера
- Python SDK не содержит ни реализации потокового HTTP-транспорта, ни реализации строительных блоков OAuth, присутствующих в typescript SDK
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
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
StreamableHttpClientTransportclass
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:
- An MCP server, which you can easily replace with your own
- 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
Установка
npx mcp-remote --transport http-first https://some-domain.server.com/mcp