ragflow/docs/develop/mcp/mcp_client_example.md
Yongteng Lei 601e024d77
Docs: add authorization header for MCP server based on OAuth 2.1 (#8293)
### What problem does this PR solve?

Add documentation of authorization header for MCP server based on OAuth
2.1

### Type of change

- [x] Documentation Update

---------

Co-authored-by: writinwaters <93570324+writinwaters@users.noreply.github.com>
2025-06-16 16:27:40 +08:00

823 B

sidebar_position slug
3 /mcp_client

RAGFlow MCP client example

We provide a prototype MCP client example for testing here.

:::danger IMPORTANT If your MCP server is running in host mode, include your acquired API key in your client's headers as shown below:

async with sse_client("http://localhost:9382/sse", headers={"api_key": "YOUR_KEY_HERE"}) as streams:
    # Rest of your code...

Or follow the requirements of OAuth 2.1 Section 5 by providing an Authorization request headers field:

async with sse_client("http://localhost:9382/sse", headers={"Authorization": "YOUR_KEY_HERE"}) as streams:
    # Rest of your code...

:::