feat(mcp): drive auth by AuthType and auto-detect OAuth on test

Select the auth header for the configured strategy only, instead of
emitting both X-API-Key and Authorization whenever the fields happened
to be set (which double-authed after switching strategies). AuthType=""
keeps the legacy infer-from-fields behavior for pre-existing rows.

Add a configurable api_key_header (non-secret, defaults to X-API-Key) so
services expecting the key in a different header work without plaintext
custom headers.

On connection test, upgrade a bare 401 that advertises RFC 9728
protected-resource metadata into an explicit OAuthRequired signal so the
UI can guide the user to switch to OAuth 2.0. Surface the server's
description from the initialize handshake in the test result.
This commit is contained in:
wizardchen
2026-06-29 20:48:59 +08:00
committed by lyingbug
parent c29761331c
commit f2686e9e39
16 changed files with 546 additions and 155 deletions
+1
View File
@@ -306,6 +306,7 @@ curl --location --request POST 'http://localhost:8080/api/v1/mcp-services/mcp-00
"data": {
"success": true,
"message": "连接成功",
"description": "提供全球天气信息查询",
"tools": [
{
"name": "get_weather",