fix: include headers when importing MCP server configurations (#7944)

- Add missing headers field to newServer object creation in AddMcpServerModal.tsx
- Update streamableHttp JSON example to show headers format
- Fixes issue where Content-Type and Authorization headers were not imported

Fixes #7932

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
LiuVaayne 2025-07-08 17:16:59 +08:00 committed by GitHub
parent 8fd59e89de
commit 4f7ca3ede8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,7 +44,11 @@ const initialJsonExample = `// 示例 JSON (stdio):
// "mcpServers": {
// "streamable-http-example": {
// "type": "streamableHttp",
// "url": "http://localhost:3001"
// "url": "http://localhost:3001",
// "headers": {
// "Content-Type": "application/json",
// "Authorization": "Bearer your-token"
// }
// }
// }
// }
@ -102,7 +106,8 @@ const AddMcpServerModal: FC<AddMcpServerModalProps> = ({ visible, onClose, onSuc
provider: serverToAdd!.provider,
providerUrl: serverToAdd!.providerUrl,
tags: serverToAdd!.tags,
configSample: serverToAdd!.configSample
configSample: serverToAdd!.configSample,
headers: serverToAdd!.headers || {}
}
onSuccess(newServer)