Files
gods-eye-view/server/mcp/server.js
T
Sameh Khamis df0e0f32e8 feat: choose per tool whether MCP, voice or both offer it
src/tools/surfaces.js lists the tools a surface leaves out, and the MCP
server, the voice session's tool list and the browser catalog voice calls
all filter through it. Voice leaves out tools that answer with images, link
to the app, or repeat what its app actions already answer.
2026-10-01 14:36:12 -07:00

35 lines
1.1 KiB
JavaScript

/** The local MCP server: Core's tools over services backed by a running app. */
import { readFileSync } from 'node:fs';
import {
composeCatalog,
coreTools,
toolsForSurface,
} from '../../src/tools/index.js';
import { createMcpServer } from '../../src/tools/mcp/index.js';
import { DEFAULT_API_BASE, createLocalToolServices } from './services.js';
const INSTRUCTIONS =
"Tools answer questions from God's Eye View's live public data. Location " +
'tools take an area: a place name, a bbox, or lat/lon with radius_km. ' +
'Results are capped; check truncated and total before concluding there is nothing more.';
/** Construct the local MCP server for Core's tools. */
export function createLocalMcpServer({
apiBase = DEFAULT_API_BASE,
fetchImpl,
} = {}) {
const { version } = JSON.parse(
readFileSync(new URL('../../package.json', import.meta.url), 'utf8'),
);
return createMcpServer({
catalog: composeCatalog({
tools: toolsForSurface(coreTools, 'mcp'),
services: createLocalToolServices({ apiBase, fetchImpl }),
}),
name: 'gods-eye-view',
version,
instructions: INSTRUCTIONS,
});
}