Skip to main content
Glama

RAGFlow MCP

by oraichain
Apache 2.0
11
  • Linux
  • Apple
auth.py952 B
import base64 from contextlib import asynccontextmanager from starlette.types import Scope, Receive, Send from starlette.exceptions import HTTPException from mcp.server.sse import SseServerTransport class JwtAuthTransport(SseServerTransport): """ Example basic auth implementation of SSE server transport. """ def __init__(self, endpoint: str): super().__init__(endpoint) @asynccontextmanager async def connect_sse(self, scope: Scope, receive: Receive, send: Send): auth_header = dict(scope["headers"]).get(b'authorization', b'') print("auth_header", auth_header) if not auth_header: raise HTTPException(status_code=401, detail="Unauthorized") # global_session[auth_header] = {} async with super().connect_sse(scope, receive, send) as streams: # get session from global_session print("global_session", streams) yield streams

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/oraichain/ragflow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server