fix(mcp): default Slack registry entry to streamable HTTP with OAuth

Slack offers a hosted MCP server at https://mcp.slack.com/mcp over
streamable HTTP with OAuth, so the curated discovery preset should point
there instead of spawning the npx stdio bot-token server. Carry an
auth_type through the discovery entry into the create-server form so the
preset lands on OAuth by default.
This commit is contained in:
Tin Chi Lo 2026-06-15 16:44:20 -07:00
parent 45d5153c12
commit effc40132a
5 changed files with 44 additions and 7 deletions

View file

@ -69,13 +69,10 @@
"icon_url": "https://cdn.simpleicons.org/slack",
"category": "Communication",
"registry_url": null,
"transport": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env_vars": [
{"name": "SLACK_BOT_TOKEN", "description": "Slack Bot User OAuth Token", "secret": true},
{"name": "SLACK_TEAM_ID", "description": "Slack Team/Workspace ID", "secret": false}
]
"transport": "http",
"url": "https://mcp.slack.com/mcp",
"auth_type": "oauth2",
"env_vars": []
},
{
"name": "discord",

View file

@ -94,6 +94,17 @@ class TestMCPRegistryFile:
assert linear["url"] == "https://mcp.linear.app/mcp"
assert "/sse" not in linear["url"]
def test_slack_defaults_to_streamable_http_oauth(self, registry_path):
"""Slack's MCP server should default to streamable HTTP with the hosted /mcp endpoint and OAuth."""
with open(registry_path, "r") as f:
data = json.load(f)
slack = next(s for s in data["servers"] if s["name"] == "slack")
assert slack["transport"] == "http"
assert slack["url"] == "https://mcp.slack.com/mcp"
assert slack["auth_type"] == "oauth2"
assert "command" not in slack
assert "args" not in slack
def test_well_known_servers_present(self, registry_path):
"""Ensure key well-known MCPs are in the registry."""
with open(registry_path, "r") as f:

View file

@ -754,6 +754,30 @@ describe("CreateMCPServer", () => {
expect(nameInput).toHaveValue("github_mcp");
});
});
it("prefills streamable HTTP, URL, and OAuth from a discovery preset like Slack", async () => {
const prefillData = {
name: "slack",
title: "Slack",
description: "Channel management, messaging, and Slack workspace integration",
category: "Communication",
transport: "http",
url: "https://mcp.slack.com/mcp",
auth_type: "oauth2",
};
render(<CreateMCPServer {...defaultProps} prefillData={prefillData} />);
await waitFor(() => {
const urlInput = screen.getByPlaceholderText("https://your-mcp-server.com");
expect(urlInput).toHaveValue("https://mcp.slack.com/mcp");
});
// Setting auth_type to oauth2 should render the OAuth form fields
await waitFor(() => {
expect(screen.getByText("OAuth Flow Type")).toBeInTheDocument();
});
});
});
describe("with back to discovery button", () => {

View file

@ -273,6 +273,10 @@ const CreateMCPServer: React.FC<CreateMCPServerProps> = ({
transport: transport,
};
if (prefillData.auth_type) {
prefillValues.auth_type = prefillData.auth_type;
}
if (transport === "stdio") {
const stdioObj: Record<string, any> = {};
if (prefillData.command) stdioObj.command = prefillData.command;

View file

@ -332,6 +332,7 @@ export interface DiscoverableMCPServer {
url?: string | null;
command?: string | null;
args?: string[] | null;
auth_type?: string | null;
env_vars?: Array<{ name: string; description?: string; secret?: boolean }> | null;
}