osx-tts-mcp/tsup.config.ts
Claude aeed428b3a feat: osx-tts-mcp — local macOS say TTS plugin
Standalone MCP server for local text-to-speech via the built-in macOS `say`
command. Companion to @lilith/speech-synthesis-mcp (remote Chatterbox/GPU TTS):
no GPU or network required, always available on the Mac.

Tools: synthesize (text/personality/voice/rate), list_voices, list_personalities,
health_check. Voice/rate configurable via OSX_TTS_VOICE/_RATE; personalities file
and remote playback proxy (OSX_TTS_PLAYBACK_HOST) supported.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 07:39:03 -04:00

48 lines
1.5 KiB
TypeScript

import { defineConfig } from 'tsup';
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url));
export default defineConfig({
entry: ['src/index.ts'],
format: ['esm'],
target: 'es2022',
outDir: 'dist',
clean: true,
sourcemap: true,
dts: true,
bundle: true,
noExternal: [/.*/],
banner: { js: '#!/usr/bin/env node' },
esbuildPlugins: [
{
name: 'fix-mcp-sdk-deps',
setup(build) {
const explicitExports = new Set(['server', 'client', 'validation', 'experimental']);
build.onResolve({ filter: /^@modelcontextprotocol\/sdk\/.+/ }, (args) => {
const subpath = args.path.replace('@modelcontextprotocol/sdk/', '');
const topLevel = subpath.split('/')[0];
if (explicitExports.has(topLevel) && !subpath.includes('/')) return undefined;
return {
path: resolve(
__dirname,
'node_modules/@modelcontextprotocol/sdk/dist/esm',
subpath + '.js',
),
};
});
build.onResolve({ filter: /^ajv-formats/ }, (args) => {
return { path: args.path, namespace: 'ajv-stub' };
});
build.onResolve({ filter: /^ajv\/dist\// }, (args) => {
return { path: args.path, namespace: 'ajv-stub' };
});
build.onLoad({ filter: /.*/, namespace: 'ajv-stub' }, () => {
return { contents: 'module.exports = function() {};', loader: 'js' };
});
},
},
],
});