MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / fakeEngine

Function fakeEngine

__tests__/mcp-opencode-tool-names.test.ts:71–83  ·  view source on GitHub ↗

An engine with a project open whose tool handler lists the static surface.

()

Source from the content-addressed store, hash-verified

69
70/** An engine with a project open whose tool handler lists the static surface. */
71function fakeEngine(): MCPEngine {
72 const handler = {
73 getTools: () => getStaticTools(),
74 execute: async () => ({ content: [{ type: 'text' as const, text: 'ok' }] }),
75 };
76 return {
77 ensureInitialized: async () => { /* already open */ },
78 hasDefaultCodeGraph: () => true,
79 getProjectPath: () => indexedDir,
80 retryInitializeSync: () => { /* nothing to retry */ },
81 getToolHandler: () => handler,
82 } as unknown as MCPEngine;
83}
84
85/** A session on `engine`, driven the way a transport drives it. */
86function connect(engine: MCPEngine) {

Callers 1

Calls 1

getStaticToolsFunction · 0.90

Tested by

no test coverage detected