mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-29 06:33:28 +00:00
fix(mcp): prefill discovery authentication
This commit is contained in:
parent
a3e2565023
commit
c8d1287a13
5 changed files with 14 additions and 7 deletions
|
|
@ -278,6 +278,7 @@
|
|||
"registry_url": null,
|
||||
"transport": "http",
|
||||
"url": "https://mcp.nimbleway.com/mcp",
|
||||
"auth_type": "bearer_token",
|
||||
"env_vars": [
|
||||
{"name": "NIMBLE_API_KEY", "description": "Nimble API Key", "secret": true}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ class TestMCPRegistryFile:
|
|||
"registry_url": None,
|
||||
"transport": "http",
|
||||
"url": "https://mcp.nimbleway.com/mcp",
|
||||
"auth_type": "bearer_token",
|
||||
"env_vars": [
|
||||
{
|
||||
"name": "NIMBLE_API_KEY",
|
||||
|
|
|
|||
|
|
@ -1934,20 +1934,23 @@ describe("CreateMCPServer", () => {
|
|||
describe("when prefillData is provided", () => {
|
||||
it("should populate form fields from discovery data", async () => {
|
||||
const prefillData = {
|
||||
name: "github-mcp",
|
||||
title: "GitHub MCP",
|
||||
description: "GitHub integration server",
|
||||
category: "Development",
|
||||
name: "nimble",
|
||||
title: "Nimble",
|
||||
description: "Nimble search server",
|
||||
category: "Search",
|
||||
transport: "http",
|
||||
url: "https://github-mcp.example.com",
|
||||
url: "https://mcp.nimbleway.com/mcp",
|
||||
auth_type: "bearer_token",
|
||||
};
|
||||
|
||||
render(<CreateMCPServer {...defaultProps} prefillData={prefillData} />);
|
||||
|
||||
await waitFor(() => {
|
||||
// Server name should be sanitized (hyphens replaced with underscores)
|
||||
const nameInput = getServerNameInput();
|
||||
expect(nameInput).toHaveValue("github_mcp");
|
||||
expect(nameInput).toHaveValue("nimble");
|
||||
expect(screen.getByPlaceholderText("https://your-mcp-server.com")).toHaveValue("https://mcp.nimbleway.com/mcp");
|
||||
expect(screen.getByText("Bearer Token")).toBeInTheDocument();
|
||||
expect(screen.getByText("Authentication Value")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -384,6 +384,7 @@ const CreateMCPServer: React.FC<CreateMCPServerProps> = ({
|
|||
alias: sanitizedName,
|
||||
description: prefillData.description || "",
|
||||
transport: transport,
|
||||
auth_type: prefillData.auth_type || undefined,
|
||||
};
|
||||
|
||||
if (transport === "stdio") {
|
||||
|
|
|
|||
|
|
@ -549,6 +549,7 @@ export interface DiscoverableMCPServer {
|
|||
category: string;
|
||||
registry_url?: string | null;
|
||||
transport: string;
|
||||
auth_type?: string | null;
|
||||
url?: string | null;
|
||||
command?: string | null;
|
||||
args?: string[] | null;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue