Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

1.1 KB
Raw Blame
import type { McpManager } from "@mastra/code-sdk/mcp/index";

/** A disconnected manager; tests override only the operations they exercise. */
export function mcpManagerFixture(overrides: Partial<McpManager> = {}): McpManager {
  const unavailable = async () => {
    throw new Error("Unexpected MCP operation in test.");
  };

  return {
    init: async () => {},
    initInBackground: async () => ({ connected: [], failed: [], skipped: [], totalTools: 0 }),
    reload: async () => {},
    reconnectServer: unavailable,
    authenticateServer: unavailable,
    cancelServerAuthentication: async () => false,
    setServerDisabled: unavailable,
    setAllDisabled: async () => {},
    getDisabledServers: () => [],
    isAllDisabledGlobally: () => false,
    disconnect: async () => {},
    getTools: () => ({}),
    hasServers: () => false,
    getServerStatuses: () => [],
    getSkippedServers: () => [],
    getConfigPaths: () => ({ project: "", global: "", claude: "" }),
    getConfig: () => ({ mcpServers: {} }),
    getServerLogs: () => [],
    ...overrides,
  };
}