mcpo supports OAuth 2.1 for streamable-http server types using dynamic client registration.
Basic Configuration:
{
"mcpServers": {
"oauth-protected-server": {
"type": "streamable-http",
"url": "http://localhost:8000/mcp",
"oauth": {
"server_url": "http://localhost:8000"
}
}
}
}
OAuth Configuration Options:
server_url (required): OAuth server base URL.storage_type: "file" (persistent, default) or "memory" (session-only).callback_port: Local port for OAuth callback (default: 3030).use_loopback: Whether to auto-open the browser for auth (default: true).
Advanced (Static Client Metadata):
For servers not supporting dynamic registration:
{
"mcpServers": {
"legacy-oauth-server": {
"type": "streamable-http",
"url": "http://api.example.com/mcp",
"oauth": {
"server_url": "http://api.example.com",
"client_metadata": {
"client_name": "My MCPO Client",
"redirect_uris": ["http://localhost:3030/callback"]
}
}
}
}
}
Note: Do not manually set scope, authorization_endpoint, or token_endpoint; these are discovered automatically.
{
"mcpServers": {
"oauth-protected-server": {
"type": "streamable-http",
"url": "http://localhost:8000/mcp",
"oauth": {
"server_url": "http://localhost:8000"
}
}
}
}