Skip to content

Commit 18305a9

Browse files
committed
fix: resolve TypeScript errors for runtime MCP server support
- Update method signatures to accept "runtime" as valid source parameter - Fix createPlaceholderConnection to handle runtime source - Update findConnection and fetch methods to support runtime servers
1 parent 05aebec commit 18305a9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/services/mcp/McpHub.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ export class McpHub {
599599
private createPlaceholderConnection(
600600
name: string,
601601
config: z.infer<typeof ServerConfigSchema>,
602-
source: "global" | "project",
602+
source: "global" | "project" | "runtime",
603603
reason: DisableReason,
604604
): DisconnectedMcpConnection {
605605
return {
@@ -900,10 +900,10 @@ export class McpHub {
900900
/**
901901
* Helper method to find a connection by server name and source
902902
* @param serverName The name of the server to find
903-
* @param source Optional source to filter by (global or project)
903+
* @param source Optional source to filter by (global, project, or runtime)
904904
* @returns The matching connection or undefined if not found
905905
*/
906-
private findConnection(serverName: string, source?: "global" | "project"): McpConnection | undefined {
906+
private findConnection(serverName: string, source?: "global" | "project" | "runtime"): McpConnection | undefined {
907907
// If source is specified, only find servers with that source
908908
if (source !== undefined) {
909909
return this.connections.find((conn) => conn.server.name === serverName && conn.server.source === source)
@@ -922,7 +922,7 @@ export class McpHub {
922922
)
923923
}
924924

925-
private async fetchToolsList(serverName: string, source?: "global" | "project"): Promise<McpTool[]> {
925+
private async fetchToolsList(serverName: string, source?: "global" | "project" | "runtime"): Promise<McpTool[]> {
926926
try {
927927
// Use the helper method to find the connection
928928
const connection = this.findConnection(serverName, source)
@@ -979,7 +979,10 @@ export class McpHub {
979979
}
980980
}
981981

982-
private async fetchResourcesList(serverName: string, source?: "global" | "project"): Promise<McpResource[]> {
982+
private async fetchResourcesList(
983+
serverName: string,
984+
source?: "global" | "project" | "runtime",
985+
): Promise<McpResource[]> {
983986
try {
984987
const connection = this.findConnection(serverName, source)
985988
if (!connection || connection.type !== "connected") {
@@ -995,7 +998,7 @@ export class McpHub {
995998

996999
private async fetchResourceTemplatesList(
9971000
serverName: string,
998-
source?: "global" | "project",
1001+
source?: "global" | "project" | "runtime",
9991002
): Promise<McpResourceTemplate[]> {
10001003
try {
10011004
const connection = this.findConnection(serverName, source)

0 commit comments

Comments
 (0)