Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* Tests that OAuth client metadata includes logo_uri for branding
* during OAuth consent flows (issue #1552).
*/

import { describe, it, expect, vi, beforeEach } from "vitest";

// Mock browser dependencies used by the providers
vi.mock("@/lib/session-token", () => ({
authFetch: vi.fn(),
}));

vi.mock("../state-machines/shared/helpers", () => ({
generateRandomString: vi.fn(() => "mock-random-string"),
}));

const EXPECTED_LOGO_URI = "https://www.mcpjam.com/mcp_jam_2row.png";

describe("OAuth client metadata logo_uri", () => {
beforeEach(() => {
vi.resetModules();
localStorage.clear();
sessionStorage.clear();
});

it("MCPOAuthProvider includes logo_uri in clientMetadata", async () => {
const { MCPOAuthProvider } = await import("../mcp-oauth");
const provider = new MCPOAuthProvider("test-server");
expect(provider.clientMetadata).toHaveProperty(
"logo_uri",
EXPECTED_LOGO_URI,
);
});

it("DebugMCPOAuthClientProvider includes logo_uri in clientMetadata", async () => {
const { DebugMCPOAuthClientProvider } =
await import("../debug-oauth-provider");
const provider = new DebugMCPOAuthClientProvider("https://example.com");
expect(provider.clientMetadata).toHaveProperty(
"logo_uri",
EXPECTED_LOGO_URI,
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class DebugMCPOAuthClientProvider implements OAuthClientProvider {
response_types: ["code"],
client_name: "MCPJam",
client_uri: "https://github.com/mcpjam/inspector",
logo_uri: "https://www.mcpjam.com/mcp_jam_2row.png",
};
}

Expand Down
1 change: 1 addition & 0 deletions mcpjam-inspector/client/src/lib/oauth/mcp-oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export class MCPOAuthProvider implements OAuthClientProvider {
return {
client_name: `MCPJam - ${this.serverName}`,
client_uri: "https://github.com/mcpjam/inspector",
logo_uri: "https://www.mcpjam.com/mcp_jam_2row.png",
redirect_uris: [this.redirectUri],
grant_types: ["authorization_code", "refresh_token"],
response_types: ["code"],
Expand Down
Loading