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
25 changes: 2 additions & 23 deletions pkg/api/handlers/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -2772,10 +2772,6 @@ func (m *MCPHandler) GetServerDetails(req api.Context) error {
return types.NewErrNotFound("MCP server not found")
}

if serverConfig.Runtime == types.RuntimeRemote {
return types.NewErrBadRequest("cannot get details for remote MCP server")
}

if !req.UserIsAdmin() && !req.UserIsAuditor() {
workspaceID := req.PathValue("workspace_id")
if workspaceID == "" {
Expand Down Expand Up @@ -2819,10 +2815,6 @@ func (m *MCPHandler) RestartServerDeployment(req api.Context) error {
return err
}

if serverConfig.Runtime == types.RuntimeRemote {
return types.NewErrBadRequest("cannot restart deployment for remote MCP server")
}

if !req.UserIsAdmin() {
workspaceID := req.PathValue("workspace_id")
if workspaceID == "" {
Expand Down Expand Up @@ -2910,7 +2902,8 @@ func (m *MCPHandler) CheckK8sSettingsStatus(req api.Context) error {
workspaceID := req.PathValue("workspace_id")
entryID := req.PathValue("entry_id")

server, serverConfig, err := serverForAction(req)
// Get the server and load the config
server, _, err := serverForAction(req)
if err != nil {
return err
}
Expand All @@ -2937,11 +2930,6 @@ func (m *MCPHandler) CheckK8sSettingsStatus(req api.Context) error {
return types.NewErrNotFound("MCP server not found")
}

// Remote servers don't have deployments
if serverConfig.Runtime == types.RuntimeRemote {
return types.NewErrBadRequest("K8s settings check is not supported for remote servers")
}

// Check if server has K8sSettingsHash in Status (only populated for Kubernetes runtime)
deployedHash := server.Status.K8sSettingsHash
if deployedHash == "" {
Expand Down Expand Up @@ -3010,11 +2998,6 @@ func (m *MCPHandler) RedeployWithK8sSettings(req api.Context) error {
return types.NewErrNotFound("MCP server not found")
}

// Remote servers don't have deployments
if serverConfig.Runtime == types.RuntimeRemote {
return types.NewErrBadRequest("Redeployment is not supported for remote servers")
}

// Check if server has K8sSettingsHash in Status (only populated for Kubernetes runtime)
deployedHash := server.Status.K8sSettingsHash
if deployedHash == "" {
Expand Down Expand Up @@ -3196,10 +3179,6 @@ func (m *MCPHandler) StreamServerLogs(req api.Context) error {
return err
}

if serverConfig.Runtime == types.RuntimeRemote {
return types.NewErrBadRequest("cannot stream logs for remote MCP server")
}

// If this is a single-user MCP server that belongs to the user, then let them access the logs.
if server.Spec.UserID != req.User.GetUID() || server.Spec.PowerUserWorkspaceID != "" || server.Spec.MCPCatalogID != "" {
// If the user doesn't own the server and is not an admin or auditor, check if they have access to the workspace.
Expand Down
12 changes: 0 additions & 12 deletions pkg/api/handlers/systemmcpserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,6 @@ func (h *SystemMCPServerHandler) Restart(req api.Context) error {
return err
}

if systemServer.Spec.Manifest.Runtime == types.RuntimeRemote {
return types.NewErrBadRequest("cannot restart deployment for remote MCP server")
}

credEnv, err := getCredentialsForSystemServer(req.Context(), req.GPTClient, systemServer)
if err != nil {
return err
Expand Down Expand Up @@ -272,10 +268,6 @@ func (h *SystemMCPServerHandler) Logs(req api.Context) error {
return err
}

if systemServer.Spec.Manifest.Runtime == types.RuntimeRemote {
return types.NewErrBadRequest("cannot stream logs for remote MCP server")
}

credEnv, err := getCredentialsForSystemServer(req.Context(), req.GPTClient, systemServer)
if err != nil {
return err
Expand Down Expand Up @@ -369,10 +361,6 @@ func (h *SystemMCPServerHandler) GetDetails(req api.Context) error {
return err
}

if systemServer.Spec.Manifest.Runtime == types.RuntimeRemote {
return types.NewErrBadRequest("cannot get details for remote MCP server")
}

credEnv, err := getCredentialsForSystemServer(req.Context(), req.GPTClient, systemServer)
if err != nil {
return err
Expand Down
11 changes: 0 additions & 11 deletions pkg/mcp/details.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@ package mcp

import (
"context"
"fmt"
"io"
"slices"

"github.com/obot-platform/obot/apiclient/types"
)

// GetServerDetails will get the details of a specific MCP server based on its configuration, if the backend supports it.
// If the server is remote, it will return an error as remote servers do not support this operation.
// If the backend does not support the operation, it will return an [ErrNotSupportedByBackend] error.
func (sm *SessionManager) GetServerDetails(ctx context.Context, serverConfig ServerConfig) (types.MCPServerDetails, error) {
if serverConfig.Runtime == types.RuntimeRemote {
return types.MCPServerDetails{}, fmt.Errorf("getting server details is not supported for remote servers")
}

if err := sm.deployServer(ctx, serverConfig); err != nil {
return types.MCPServerDetails{}, err
}
Expand All @@ -25,13 +19,8 @@ func (sm *SessionManager) GetServerDetails(ctx context.Context, serverConfig Ser
}

// StreamServerLogs will stream the logs of a specific MCP server based on its configuration, if the backend supports it.
// If the server is remote, it will return an error as remote servers do not support this operation.
// If the backend does not support the operation, it will return an [ErrNotSupportedByBackend] error.
func (sm *SessionManager) StreamServerLogs(ctx context.Context, serverConfig ServerConfig) (io.ReadCloser, error) {
if serverConfig.Runtime == types.RuntimeRemote {
return nil, fmt.Errorf("streaming logs is not supported for remote servers")
}

if err := sm.deployServer(ctx, serverConfig); err != nil {
return nil, err
}
Expand Down
3 changes: 0 additions & 3 deletions pkg/mcp/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,6 @@ func (sm *SessionManager) closeClients(serverName string) {
// RestartServerDeployment restarts the server in the currently used backend, if the backend supports it.
// If the backend does not support restarts, then an [ErrNotSupportedByBackend] error is returned.
func (sm *SessionManager) RestartServerDeployment(ctx context.Context, server ServerConfig) error {
if server.Runtime == otypes.RuntimeRemote {
return otypes.NewErrBadRequest("cannot restart deployment for remote MCP server")
}
return sm.backend.restartServer(ctx, server.MCPServerName)
}

Expand Down
2 changes: 1 addition & 1 deletion ui/user/src/lib/components/admin/McpServerInstances.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
{ title: 'User', property: 'userID' },
{ title: 'URL', property: 'url' }
]}
onClickRow={type === 'single' || type === 'composite'
onClickRow={type === 'single' || type === 'composite' || type === 'remote'
? (d, isCtrlClick) => {
setLastVisitedMcpServer();

Expand Down
10 changes: 8 additions & 2 deletions ui/user/src/lib/components/admin/McpServerK8sInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Group,
type K8sServerDetail,
type MCPCatalogEntry,
type MCPCatalogServer,
type OrgUser,
type ServerK8sSettings
} from '$lib/services';
Expand Down Expand Up @@ -41,6 +42,7 @@
title?: string;
};
catalogEntry?: MCPCatalogEntry;
mcpServer?: MCPCatalogServer;
readonly?: boolean;
compositeParentName?: string;
}
Expand All @@ -53,6 +55,7 @@
title,
classes,
catalogEntry,
mcpServer,
compositeParentName,
entity = 'catalog',
readonly
Expand Down Expand Up @@ -235,7 +238,7 @@
const details = [
{
id: 'kubernetes_deployments',
label: 'Kubernetes Deployment',
label: 'Deployment',
value: `${info.namespace}/${info.deploymentName}`
},
{
Expand Down Expand Up @@ -383,6 +386,9 @@
{#each k8sInfo as detail (detail.id)}
{@render detailRow(detail.label, detail.value, detail.id)}
{/each}
{#if catalogEntry?.manifest.runtime === 'remote' && mcpServer?.manifest.remoteConfig?.url}
{@render configurationRow('URL', mcpServer?.manifest.remoteConfig?.url)}
{/if}
</div>

{#if profile.current?.isAdmin?.()}
Expand Down Expand Up @@ -417,7 +423,7 @@
</div>
{:else}
<span class="text-on-surface1 text-sm font-light"
>No configured environment of file variables set.</span
>No configured environment or file variables set.</span
>
{/if}
</div>
Expand Down
178 changes: 0 additions & 178 deletions ui/user/src/lib/components/admin/McpServerRemoteInfo.svelte

This file was deleted.

Loading
Loading