OM

本页由 AI 翻译,技术细节请以原文为准。 查看原文

13 stars 5 forks 质量 68 趋势 17Apache-2.0

ory/mcp 是从 https://github.com/ory/mcp. 导入的 MCP 服务器候选

概览

ory/mcp 是从 https://github.com/ory/mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

该仓库包含用于将 Ory 认证和访问控制与模型上下文协议(MCP)集成的 TypeScript 包。该仓库已从 mcp-oauth-provider 更名为 mcp,以涵盖所有 Ory MCP 项目。

包裹

@ory/MCP-OAUTH-提供者

这是 Ory MCP 的 OAuth 提供者的 TypeScript 实现,支持 Ory Network 和 Ory Hydra 作为后端提供者。该软件包实现了 MCP 服务器与 Ory OAuth2.1 认证系统之间的无缝集成。

主要功能:

  • 支持 Ory Network 和 Ory Hydra 作为后端提供商
  • 使用 PKCE 处理 OAuth2 授权码流程
  • 管理客户端注册和令牌操作
  • 提供代币内省和验证
  • 与MCP服务器认证无缝集成

安装:

有关详细文档和使用示例,请参见包 README。

@ory/MCP-访问控制

一个 TypeScript 模块,提供 Ory 网络访问控制集成的 MCP 工具定义。该模块帮助验证 JWT 令牌、创建/检索 Ory 身份以及管理认证会话。

主要功能:

  • 使用 JWKS 进行 JWT 令牌验证

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Ory MCP (Model Context Protocol)

This repository contains TypeScript packages for integrating Ory authentication and access control with the Model Context Protocol (MCP). The repository has been renamed from mcp-oauth-provider to mcp to be inclusive of all Ory MCP projects.

Packages

@ory/mcp-oauth-provider

A TypeScript implementation of an OAuth provider for Ory MCP that supports both Ory Network and Ory Hydra as backend providers. This package provides seamless integration between MCP servers and Ory’s OAuth2.1 authentication system.

Key Features:

  • Supports both Ory Network and Ory Hydra as backend providers
  • Handles OAuth2 authorization code flow with PKCE
  • Manages client registration and token operations
  • Provides token introspection and verification
  • Integrates seamlessly with MCP server authentication

Installation:

npm install @ory/mcp-oauth-provider

For detailed documentation and usage examples, see the package README.

@ory/mcp-access-control

A TypeScript module that provides MCP tool definitions for Ory Network access control integration. This module helps validate JWT tokens, create/retrieve Ory identities, and manage authentication sessions.

Key Features:

  • JWT token validation using JWKS
  • Configurable JWT audience and claim extraction
  • Automatic identity creation/retrieval in Ory Network
  • Password-based authentication with session management
  • Session token validation for MCP middleware
  • MCP tool definition generation

Installation:

npm install @ory/mcp-access-control

For detailed documentation and usage examples, see the package README.

Examples

OAuth Provider Example

The examples/oauth-provider-example/ directory contains a complete MCP server implementation that demonstrates how to use the @ory/mcp-oauth-provider package with Ory Network authentication.

Features demonstrated:

  • Complete MCP server setup with Ory OAuth2.1 authentication
  • Bearer token authentication middleware
  • Project management tools
  • Both Streamable HTTP and SSE transport support

Getting Started:

  1. Set up your environment variables:

    ORY_PROJECT_URL=https://your-project.projects.oryapis.com
    ORY_PROJECT_API_KEY=your-api-key
    MCP_BASE_URL=http://localhost:3000
    SERVICE_DOCUMENTATION_URL=https://your-docs-url.com
    
  2. Run the example server:

    cd examples/oauth-provider-example
    npm install
    npm start
    

For the complete implementation, see examples/oauth-provider-example/mcp-server.ts.

Repository History

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →