mirror of
https://github.com/coder/coder.git
synced 2026-11-02 21:50:08 +08:00
feat(site): add MCP server admin UI (#23301)
This adds the UI but does not add it to the Settings sidebar. Until it's actually functional and usable (which will come in future PRs) it will remain hidden. Next step is wiring this up to chats and actually testing the full flow end-to-end, but we aren't there yet.
This commit is contained in:
@@ -402,6 +402,7 @@ export type DeploymentConfig = Readonly<{
|
||||
|
||||
const chatProviderConfigsPath = "/api/experimental/chats/providers";
|
||||
const chatModelConfigsPath = "/api/experimental/chats/model-configs";
|
||||
const mcpServerConfigsPath = "/api/experimental/mcp/servers";
|
||||
|
||||
type ChatCostDateParams = {
|
||||
start_date?: string;
|
||||
@@ -3221,6 +3222,40 @@ class ApiMethods {
|
||||
`${chatModelConfigsPath}/${encodeURIComponent(modelConfigId)}`,
|
||||
);
|
||||
};
|
||||
|
||||
getMCPServerConfigs = async (): Promise<TypesGen.MCPServerConfig[]> => {
|
||||
const response =
|
||||
await this.axios.get<TypesGen.MCPServerConfig[]>(mcpServerConfigsPath);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
createMCPServerConfig = async (
|
||||
req: TypesGen.CreateMCPServerConfigRequest,
|
||||
): Promise<TypesGen.MCPServerConfig> => {
|
||||
const response = await this.axios.post<TypesGen.MCPServerConfig>(
|
||||
mcpServerConfigsPath,
|
||||
req,
|
||||
);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
updateMCPServerConfig = async (
|
||||
id: string,
|
||||
req: TypesGen.UpdateMCPServerConfigRequest,
|
||||
): Promise<TypesGen.MCPServerConfig> => {
|
||||
const response = await this.axios.patch<TypesGen.MCPServerConfig>(
|
||||
`${mcpServerConfigsPath}/${encodeURIComponent(id)}`,
|
||||
req,
|
||||
);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
deleteMCPServerConfig = async (id: string): Promise<void> => {
|
||||
await this.axios.delete(
|
||||
`${mcpServerConfigsPath}/${encodeURIComponent(id)}`,
|
||||
);
|
||||
};
|
||||
|
||||
getAIBridgeModels = async (options: SearchParamOptions) => {
|
||||
const url = getURLWithSearchParams("/api/v2/aibridge/models", options);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user