Can't use more than one context provider on a MCP server

This commit is contained in:
Lucas Wojciechowski 2025-02-15 17:40:19 -08:00
parent 62978d19ee
commit 73ee9f22ab
2 changed files with 4 additions and 2 deletions

View file

@ -164,6 +164,7 @@ class MCPConnection {
config.contextProviders.push(
new MCPContextProvider({
submenuItems,
mcpId,
}),
);
}

View file

@ -9,6 +9,7 @@ import {
import { MCPManagerSingleton } from "../mcp";
interface MCPContextProviderOptions {
mcpId: string;
submenuItems: ContextSubmenuItem[];
}
@ -74,10 +75,10 @@ class MCPContextProvider extends BaseContextProvider {
args: LoadSubmenuItemsArgs,
): Promise<ContextSubmenuItem[]> {
return (this.options as MCPContextProviderOptions).submenuItems.map(
(item, index) => ({
(item) => ({
...item,
id: JSON.stringify({
mcpId: String(index),
mcpId: (this.options as MCPContextProviderOptions).mcpId,
uri: item.id,
}),
}),