functype-mcp-server 0.60.2 → 0.60.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/bin.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
if (!process.env.TRANSPORT_TYPE) process.env.TRANSPORT_TYPE = "stdio";
|
|
4
4
|
const args = process.argv.slice(2);
|
|
5
5
|
if (args.includes("--version") || args.includes("-v")) {
|
|
6
|
-
console.log("0.60.
|
|
6
|
+
console.log("0.60.3");
|
|
7
7
|
process.exit(0);
|
|
8
8
|
}
|
|
9
9
|
if (args.includes("--help") || args.includes("-h")) {
|
|
10
10
|
console.log(`
|
|
11
|
-
functype-mcp-server v0.60.
|
|
11
|
+
functype-mcp-server v0.60.3
|
|
12
12
|
|
|
13
13
|
MCP server for functype documentation lookup and TypeScript code validation.
|
|
14
14
|
|
package/dist/index.js
CHANGED
|
@@ -258,7 +258,7 @@ const validateCode = (code, options = {}) => {
|
|
|
258
258
|
//#endregion
|
|
259
259
|
//#region src/index.ts
|
|
260
260
|
const PROJECT_ROOT = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
261
|
-
const SERVER_VERSION = "0.60.
|
|
261
|
+
const SERVER_VERSION = "0.60.3";
|
|
262
262
|
function createServer() {
|
|
263
263
|
const server = new FastMCP({
|
|
264
264
|
name: "functype-mcp-server",
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["require"],"sources":["../src/lib/docs/data.ts","../src/lib/docs/formatters.ts","../src/lib/validator/compiler-host.ts","../src/lib/validator/validate.ts","../src/index.ts"],"sourcesContent":["/**\n * Runtime loader for functype CLI data.\n * Uses dynamic import so the data reflects whichever functype version\n * is installed in node_modules at runtime (not baked in at build time).\n */\n\nimport { createRequire } from \"node:module\"\nimport { pathToFileURL } from \"node:url\"\n\nexport type { InterfaceData, TypeData } from \"functype/cli\"\nimport type { InterfaceData, TypeData } from \"functype/cli\"\n\nconst require = createRequire(import.meta.url)\n\nexport let TYPES: Record<string, TypeData> = {}\nexport let INTERFACES: Record<string, InterfaceData> = {}\nexport let CATEGORIES: Record<string, string[]> = {}\nexport let FULL_INTERFACES: Record<string, string> = {}\nexport let VERSION = \"unknown\"\n\nlet initialized = false\n\nexport async function initDocsData(force?: boolean): Promise<void> {\n if (initialized && !force) return\n\n try {\n let cli: typeof import(\"functype/cli\")\n if (force) {\n const resolvedPath = require.resolve(\"functype/cli\")\n cli = await import(`${pathToFileURL(resolvedPath).href}?t=${Date.now()}`)\n } else {\n cli = await import(\"functype/cli\")\n }\n TYPES = cli.TYPES\n INTERFACES = cli.INTERFACES\n CATEGORIES = cli.CATEGORIES\n FULL_INTERFACES = cli.FULL_INTERFACES\n VERSION = cli.VERSION\n initialized = true\n } catch (err) {\n if (force) throw err\n console.error(\"[functype-mcp] Failed to load functype/cli data — doc tools will return empty results:\", err)\n }\n}\n","/**\n * Markdown formatters for MCP tool output.\n * Plain TypeScript — no functype dependency in formatters.\n */\n\nimport type { InterfaceData, TypeData } from \"./data\"\nimport { CATEGORIES, FULL_INTERFACES, INTERFACES, TYPES, VERSION } from \"./data\"\n\nconst METHOD_CATEGORIES = [\"create\", \"transform\", \"extract\", \"check\", \"other\"] as const\n\nexport const formatOverview = (): string => {\n const lines: string[] = [`# functype ${VERSION} — Scala-inspired FP for TypeScript`, \"\"]\n\n for (const [category, typeNames] of Object.entries(CATEGORIES)) {\n lines.push(`## ${category}`, \"\")\n for (const name of typeNames) {\n const type = TYPES[name]\n if (type) {\n const ifaces = type.interfaces.length > 0 ? ` [${type.interfaces.join(\", \")}]` : \"\"\n lines.push(`**${name}**${ifaces}`)\n lines.push(` ${type.description}`, \"\")\n }\n }\n }\n\n lines.push(\"---\", \"Use `get_type_api` for detailed type reference.\", \"Use `get_interfaces` for interface hierarchy.\")\n return lines.join(\"\\n\")\n}\n\nexport const formatType = (name: string, data: TypeData, includeFullInterface?: boolean): string => {\n const ifaceList = data.interfaces.length > 0 ? ` [${data.interfaces.join(\", \")}]` : \"\"\n const lines: string[] = [`# ${name}<T>${ifaceList}`, \"\", data.description, \"\"]\n\n for (const cat of METHOD_CATEGORIES) {\n const methods = data.methods[cat]\n if (methods && methods.length > 0) {\n lines.push(`## ${cat.charAt(0).toUpperCase() + cat.slice(1)}`, \"\")\n for (const method of methods) {\n lines.push(`- \\`${method}\\``)\n }\n lines.push(\"\")\n }\n }\n\n if (includeFullInterface) {\n const fullInterface = FULL_INTERFACES[name]\n if (fullInterface) {\n lines.push(\"## Full Interface\", \"\", \"```typescript\", fullInterface, \"```\")\n }\n }\n\n return lines.join(\"\\n\").trimEnd()\n}\n\nexport const formatInterfaces = (): string => {\n const lines: string[] = [\"# Interfaces\", \"\"]\n\n for (const [name, data] of Object.entries(INTERFACES)) {\n const ext = data.extends ? ` extends ${data.extends}` : \"\"\n lines.push(`## ${name}<A>${ext}`, \"\", data.description, \"\")\n for (const method of data.methods) {\n lines.push(`- \\`${method}\\``)\n }\n lines.push(\"\")\n }\n\n return lines.join(\"\\n\").trimEnd()\n}\n\nexport const searchTypes = (query: string): string => {\n const q = query.toLowerCase()\n\n // Check for exact type name match first (case-sensitive, e.g. \"IO\", \"Map\", \"Option\")\n const exactMatch = TYPES[query]\n if (exactMatch) {\n return formatType(query, exactMatch)\n }\n\n const matches: Array<{ name: string; data: TypeData }> = []\n\n for (const [name, data] of Object.entries(TYPES)) {\n const nameMatch = name.toLowerCase().includes(q)\n const descMatch = data.description.toLowerCase().includes(q)\n const ifaceMatch = data.interfaces.some((i) => i.toLowerCase().includes(q))\n const methodMatch = Object.values(data.methods)\n .flat()\n .some((m) => m.toLowerCase().includes(q))\n\n if (nameMatch || descMatch || ifaceMatch || methodMatch) {\n matches.push({ name, data })\n }\n }\n\n if (matches.length === 0) {\n return `No types found matching \"${query}\". Available types: ${Object.keys(TYPES).join(\", \")}`\n }\n\n if (matches.length === 1) {\n const match = matches[0]!\n return formatType(match.name, match.data)\n }\n\n // Prioritize name matches over description/method substring matches\n const nameMatches = matches.filter((m) => m.name.toLowerCase().includes(q))\n const otherMatches = matches.filter((m) => !m.name.toLowerCase().includes(q))\n const sorted = [...nameMatches, ...otherMatches]\n\n const lines: string[] = [`# Search results for \"${query}\"`, \"\", `Found ${sorted.length} matching types:`, \"\"]\n for (const match of sorted) {\n const ifaces = match.data.interfaces.length > 0 ? ` [${match.data.interfaces.join(\", \")}]` : \"\"\n lines.push(`**${match.name}**${ifaces}`)\n lines.push(` ${match.data.description}`, \"\")\n }\n\n lines.push(\"---\", \"Use `get_type_api` with a specific type name for full details.\")\n return lines.join(\"\\n\")\n}\n\nexport const getTypeByName = (name: string): { name: string; data: TypeData } | undefined => {\n const direct = TYPES[name]\n if (direct) return { name, data: direct }\n\n const entry = Object.entries(TYPES).find(([typeName]) => typeName.toLowerCase() === name.toLowerCase())\n if (entry) return { name: entry[0], data: entry[1] }\n\n return undefined\n}\n\nexport const getInterfaceByName = (name: string): { name: string; data: InterfaceData } | undefined => {\n const direct = INTERFACES[name]\n if (direct) return { name, data: direct }\n\n const entry = Object.entries(INTERFACES).find(([ifaceName]) => ifaceName.toLowerCase() === name.toLowerCase())\n if (entry) return { name: entry[0], data: entry[1] }\n\n return undefined\n}\n","/**\n * Custom TypeScript CompilerHost for in-memory type-checking of functype code.\n * Resolves functype .d.ts files from node_modules for accurate type validation.\n */\n\nimport { readFileSync } from \"node:fs\"\nimport { createRequire } from \"node:module\"\nimport { dirname, join, resolve } from \"node:path\"\n\nimport ts from \"typescript\"\n\nconst require = createRequire(import.meta.url)\n\nconst resolveFunctypeDistDir = (): string => {\n // Resolve the main entry point, then walk up to find the dist dir\n const functypeMain = require.resolve(\"functype\")\n // functypeMain is something like .../node_modules/functype/dist/index.js\n // Walk up until we find a directory containing package.json\n let dir = dirname(functypeMain)\n for (let i = 0; i < 5; i++) {\n try {\n readFileSync(join(dir, \"package.json\"), \"utf-8\")\n return join(dir, \"dist\")\n } catch {\n dir = dirname(dir)\n }\n }\n // Fallback: assume dist is sibling to main\n return dirname(functypeMain)\n}\n\nconst fileCache = new Map<string, string | undefined>()\n\nexport const clearFileCache = (): void => {\n fileCache.clear()\n}\n\nconst readFileCached = (path: string): string | undefined => {\n if (fileCache.has(path)) return fileCache.get(path)\n try {\n const content = readFileSync(path, \"utf-8\")\n fileCache.set(path, content)\n return content\n } catch {\n fileCache.set(path, undefined)\n return undefined\n }\n}\n\nexport const VIRTUAL_FILENAME = \"/__functype_validate__.ts\"\n\nexport const compilerOptions: ts.CompilerOptions = {\n strict: true,\n target: ts.ScriptTarget.ES2020,\n module: ts.ModuleKind.ESNext,\n moduleResolution: ts.ModuleResolutionKind.Bundler,\n noEmit: true,\n noUncheckedIndexedAccess: true,\n skipLibCheck: true,\n esModuleInterop: true,\n allowSyntheticDefaultImports: true,\n declaration: false,\n sourceMap: false,\n}\n\nexport const createCompilerHost = (sourceCode: string): ts.CompilerHost => {\n const functypeDistDir = resolveFunctypeDistDir()\n const defaultHost = ts.createCompilerHost(compilerOptions)\n\n const host: ts.CompilerHost = {\n ...defaultHost,\n\n getSourceFile(fileName, languageVersion) {\n if (fileName === VIRTUAL_FILENAME) {\n return ts.createSourceFile(fileName, sourceCode, languageVersion, true)\n }\n return defaultHost.getSourceFile(fileName, languageVersion)\n },\n\n fileExists(fileName) {\n if (fileName === VIRTUAL_FILENAME) return true\n return defaultHost.fileExists(fileName)\n },\n\n readFile(fileName) {\n if (fileName === VIRTUAL_FILENAME) return sourceCode\n return readFileCached(fileName) ?? defaultHost.readFile(fileName)\n },\n\n resolveModuleNames(moduleNames, containingFile) {\n return moduleNames.map((moduleName): ts.ResolvedModule | undefined => {\n if (moduleName === \"functype\" || moduleName.startsWith(\"functype/\")) {\n const subpath = moduleName === \"functype\" ? \"index.d.ts\" : moduleName.replace(\"functype/\", \"\") + \".d.ts\"\n const resolvedFileName = resolve(functypeDistDir, subpath)\n if (readFileCached(resolvedFileName) !== undefined) {\n return { resolvedFileName, isExternalLibraryImport: true }\n }\n // Try with /index.d.ts for subpath modules\n const indexPath = resolve(functypeDistDir, subpath.replace(\".d.ts\", \"/index.d.ts\"))\n if (readFileCached(indexPath) !== undefined) {\n return { resolvedFileName: indexPath, isExternalLibraryImport: true }\n }\n return undefined\n }\n\n const result = ts.resolveModuleName(moduleName, containingFile, compilerOptions, defaultHost)\n return result.resolvedModule\n })\n },\n }\n\n return host\n}\n","/**\n * Core validation function — type-checks functype code snippets using the TypeScript Compiler API.\n */\n\nimport ts from \"typescript\"\n\nimport { compilerOptions, createCompilerHost, VIRTUAL_FILENAME } from \"./compiler-host\"\nimport type { ValidateOptions, ValidationDiagnostic, ValidationResult } from \"./types\"\n\nconst DEFAULT_IMPORTS = `import { Option, Some, None, Either, Right, Left, Try, List, Set, Map, Lazy, LazyList, Task, IO, Cond, Match, Brand, ValidatedBrand, Tuple, Stack, Ok, Err } from \"functype\"\\n`\n\nconst hasFunctypeImport = (code: string): boolean => /from\\s+[\"']functype(?:\\/[^\"']*)?[\"']/.test(code)\n\nexport const validateCode = (code: string, options: ValidateOptions = {}): ValidationResult => {\n const autoImport = options.autoImport ?? true\n const shouldPrepend = autoImport && !hasFunctypeImport(code)\n const importLineCount = shouldPrepend ? 1 : 0\n const fullCode = shouldPrepend ? DEFAULT_IMPORTS + code : code\n\n const host = createCompilerHost(fullCode)\n const program = ts.createProgram([VIRTUAL_FILENAME], compilerOptions, host)\n const allDiagnostics = ts.getPreEmitDiagnostics(program)\n\n const fileDiagnostics = allDiagnostics.filter((d) => d.file?.fileName === VIRTUAL_FILENAME)\n\n const rawDiagnostics = fileDiagnostics.map((d) => {\n const { line, character } = d.file!.getLineAndCharacterOfPosition(d.start ?? 0)\n return {\n originalLine: line,\n line: line - importLineCount + 1,\n column: character + 1,\n message: ts.flattenDiagnosticMessageText(d.messageText, \"\\n\"),\n code: d.code,\n severity: (d.category === ts.DiagnosticCategory.Error ? \"error\" : \"warning\") as \"error\" | \"warning\",\n }\n })\n\n // Filter out diagnostics from the prepended import line(s) and map to final type\n const userDiagnostics: ValidationDiagnostic[] = rawDiagnostics\n .filter((d) => !shouldPrepend || d.originalLine >= importLineCount)\n .map(({ originalLine: _, ...rest }) => rest)\n\n return {\n success: userDiagnostics.filter((d) => d.severity === \"error\").length === 0,\n diagnostics: userDiagnostics,\n importsPrepended: shouldPrepend,\n }\n}\n","import { execFileSync } from \"node:child_process\"\nimport { dirname } from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\n\nimport { FastMCP } from \"fastmcp\"\nimport { z } from \"zod\"\n\nimport { FULL_INTERFACES, initDocsData, VERSION } from \"./lib/docs/data\"\nimport { formatInterfaces, formatOverview, formatType, getTypeByName, searchTypes } from \"./lib/docs/formatters\"\nimport { clearFileCache } from \"./lib/validator/compiler-host\"\nimport { validateCode } from \"./lib/validator/validate\"\n\nconst __dirname = dirname(fileURLToPath(import.meta.url))\nconst PROJECT_ROOT = dirname(__dirname)\n\ndeclare const __VERSION__: string\nconst SERVER_VERSION = (\n typeof __VERSION__ !== \"undefined\" ? __VERSION__ : \"0.0.0-dev\"\n) as `${number}.${number}.${number}`\n\nfunction createServer() {\n const server = new FastMCP({\n name: \"functype-mcp-server\",\n version: SERVER_VERSION,\n instructions: `Functype MCP Server — documentation lookup and code validation for the functype TypeScript FP library (v${VERSION}).\n\nAvailable tools:\n- search_docs: Search functype documentation by keyword or type name\n- get_type_api: Get detailed API reference for a specific type\n- get_interfaces: Get the interface hierarchy (Functor, Monad, Foldable, etc.)\n- validate_code: Type-check functype code snippets at compile time\n- set_functype_version: Switch the functype version at runtime (installs + reloads)\n\nUse validate_code to verify your functype code is type-correct before presenting it to the user.`,\n })\n\n server.addTool({\n name: \"search_docs\",\n description:\n \"Search functype documentation by keyword or type name. Omit query for a full overview of all types and categories.\",\n parameters: z.object({\n query: z.string().optional().describe(\"Type name or keyword to search for. Omit for full overview.\"),\n }),\n execute: async (args) => {\n if (!args.query || args.query.trim() === \"\") {\n return formatOverview()\n }\n return searchTypes(args.query)\n },\n })\n\n server.addTool({\n name: \"get_type_api\",\n description:\n \"Get detailed API reference for a specific functype type including methods by category and optionally the full TypeScript interface definition.\",\n parameters: z.object({\n type_name: z.string().describe(\"The type name (e.g., Option, Either, List, IO)\"),\n include_full_interface: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Include full TypeScript interface definition\"),\n }),\n execute: async (args) => {\n const found = getTypeByName(args.type_name)\n if (!found) {\n const available = Object.keys(FULL_INTERFACES).join(\", \")\n return `Type \"${args.type_name}\" not found. Available types: ${available}`\n }\n return formatType(found.name, found.data, args.include_full_interface)\n },\n })\n\n server.addTool({\n name: \"get_interfaces\",\n description:\n \"Get the functype interface hierarchy — Functor, Monad, Foldable, Extractable, Matchable, etc. — with their methods and inheritance.\",\n parameters: z.object({}),\n execute: async () => {\n return formatInterfaces()\n },\n })\n\n server.addTool({\n name: \"validate_code\",\n description:\n \"Type-check a functype code snippet using the TypeScript compiler. Returns PASSED or a list of type errors with line/column/message. Use this to verify functype code is type-correct before presenting to users.\",\n parameters: z.object({\n code: z.string().describe(\"TypeScript code snippet using functype to type-check\"),\n auto_import: z\n .boolean()\n .optional()\n .default(true)\n .describe(\"Automatically import all functype types if no import statement is present. Default: true\"),\n }),\n execute: async (args) => {\n const result = validateCode(args.code, { autoImport: args.auto_import })\n\n if (result.success) {\n const importNote = result.importsPrepended ? \" (functype imports auto-added)\" : \"\"\n return `Validation PASSED${importNote}\\n\\nThe code is type-correct.`\n }\n\n const errorLines = result.diagnostics.map((d) => `- Line ${d.line}, Col ${d.column}: ${d.message} (TS${d.code})`)\n const importNote = result.importsPrepended ? \"\\n\\nNote: functype imports were auto-added.\" : \"\"\n\n return `Validation FAILED — ${result.diagnostics.length} error(s):\\n\\n${errorLines.join(\"\\n\")}${importNote}`\n },\n })\n\n server.addTool({\n name: \"set_functype_version\",\n description:\n \"Switch the functype version at runtime. Installs the specified version and reloads all documentation and type definitions.\",\n parameters: z.object({\n version: z.string().describe('The functype version to install (e.g., \"0.46.0\", \"latest\", \"^0.45.0\")'),\n }),\n execute: async (args) => {\n const spec = `functype@${args.version}`\n try {\n execFileSync(\"pnpm\", [\"add\", spec], { cwd: PROJECT_ROOT, stdio: \"pipe\", timeout: 60_000 })\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n return `Failed to install ${spec}: ${message}`\n }\n\n clearFileCache()\n\n try {\n await initDocsData(true)\n } catch {\n return `Installed ${spec}, but this version does not export functype/cli. Documentation and type definitions are unavailable. The validator will still use the installed version's .d.ts files. Consider using functype >= 0.47.0 for full MCP support.`\n }\n\n return `Switched to functype v${VERSION}. Documentation and type definitions have been reloaded.`\n },\n })\n\n return server\n}\n\nasync function main() {\n await initDocsData()\n\n const server = createServer()\n\n const useHttp = process.env.TRANSPORT_TYPE === \"httpStream\" || process.env.TRANSPORT_TYPE === \"http\"\n const port = parseInt(process.env.PORT || \"3000\")\n const host = process.env.HOST || \"0.0.0.0\"\n\n if (useHttp) {\n console.error(`[functype-mcp] Starting HTTP server on ${host}:${port}`)\n await server.start({\n transportType: \"httpStream\",\n httpStream: { port, host, endpoint: \"/mcp\" },\n })\n console.error(`[functype-mcp] HTTP server ready at http://${host}:${port}/mcp`)\n } else {\n console.error(\"[functype-mcp] Starting in stdio mode\")\n await server.start({ transportType: \"stdio\" })\n }\n}\n\nprocess.on(\"SIGINT\", () => process.exit(0))\nprocess.on(\"SIGTERM\", () => process.exit(0))\n\nmain().catch(console.error)\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAMA,YAAU,cAAc,OAAO,KAAK,IAAI;AAE9C,IAAW,QAAkC,EAAE;AAC/C,IAAW,aAA4C,EAAE;AACzD,IAAW,aAAuC,EAAE;AACpD,IAAW,kBAA0C,EAAE;AACvD,IAAW,UAAU;AAErB,IAAI,cAAc;AAElB,eAAsB,aAAa,OAAgC;AACjE,KAAI,eAAe,CAAC,MAAO;AAE3B,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OAAO,SAAS,QAAQ,IAAI,QAAQ,OAAO;CACjD,MAAM,OAAO,QAAQ,IAAI,QAAQ;AAEjC,KAAI,SAAS;AACX,UAAQ,MAAM,0CAA0C,KAAK,GAAG,OAAO;AACvE,QAAM,OAAO,MAAM;GACjB,eAAe;GACf,YAAY;IAAE;IAAM;IAAM,UAAU;IAAQ;GAC7C,CAAC;AACF,UAAQ,MAAM,8CAA8C,KAAK,GAAG,KAAK,MAAM;QAC1E;AACL,UAAQ,MAAM,wCAAwC;AACtD,QAAM,OAAO,MAAM,EAAE,eAAe,SAAS,CAAC;;;AAIlD,QAAQ,GAAG,gBAAgB,QAAQ,KAAK,EAAE,CAAC;AAC3C,QAAQ,GAAG,iBAAiB,QAAQ,KAAK,EAAE,CAAC;AAE5C,MAAM,CAAC,MAAM,QAAQ,MAAM"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["require"],"sources":["../src/lib/docs/data.ts","../src/lib/docs/formatters.ts","../src/lib/validator/compiler-host.ts","../src/lib/validator/validate.ts","../src/index.ts"],"sourcesContent":["/**\n * Runtime loader for functype CLI data.\n * Uses dynamic import so the data reflects whichever functype version\n * is installed in node_modules at runtime (not baked in at build time).\n */\n\nimport { createRequire } from \"node:module\"\nimport { pathToFileURL } from \"node:url\"\n\nexport type { InterfaceData, TypeData } from \"functype/cli\"\nimport type { InterfaceData, TypeData } from \"functype/cli\"\n\nconst require = createRequire(import.meta.url)\n\nexport let TYPES: Record<string, TypeData> = {}\nexport let INTERFACES: Record<string, InterfaceData> = {}\nexport let CATEGORIES: Record<string, string[]> = {}\nexport let FULL_INTERFACES: Record<string, string> = {}\nexport let VERSION = \"unknown\"\n\nlet initialized = false\n\nexport async function initDocsData(force?: boolean): Promise<void> {\n if (initialized && !force) return\n\n try {\n let cli: typeof import(\"functype/cli\")\n if (force) {\n const resolvedPath = require.resolve(\"functype/cli\")\n cli = await import(`${pathToFileURL(resolvedPath).href}?t=${Date.now()}`)\n } else {\n cli = await import(\"functype/cli\")\n }\n TYPES = cli.TYPES\n INTERFACES = cli.INTERFACES\n CATEGORIES = cli.CATEGORIES\n FULL_INTERFACES = cli.FULL_INTERFACES\n VERSION = cli.VERSION\n initialized = true\n } catch (err) {\n if (force) throw err\n console.error(\"[functype-mcp] Failed to load functype/cli data — doc tools will return empty results:\", err)\n }\n}\n","/**\n * Markdown formatters for MCP tool output.\n * Plain TypeScript — no functype dependency in formatters.\n */\n\nimport type { InterfaceData, TypeData } from \"./data\"\nimport { CATEGORIES, FULL_INTERFACES, INTERFACES, TYPES, VERSION } from \"./data\"\n\nconst METHOD_CATEGORIES = [\"create\", \"transform\", \"extract\", \"check\", \"other\"] as const\n\nexport const formatOverview = (): string => {\n const lines: string[] = [`# functype ${VERSION} — Scala-inspired FP for TypeScript`, \"\"]\n\n for (const [category, typeNames] of Object.entries(CATEGORIES)) {\n lines.push(`## ${category}`, \"\")\n for (const name of typeNames) {\n const type = TYPES[name]\n if (type) {\n const ifaces = type.interfaces.length > 0 ? ` [${type.interfaces.join(\", \")}]` : \"\"\n lines.push(`**${name}**${ifaces}`)\n lines.push(` ${type.description}`, \"\")\n }\n }\n }\n\n lines.push(\"---\", \"Use `get_type_api` for detailed type reference.\", \"Use `get_interfaces` for interface hierarchy.\")\n return lines.join(\"\\n\")\n}\n\nexport const formatType = (name: string, data: TypeData, includeFullInterface?: boolean): string => {\n const ifaceList = data.interfaces.length > 0 ? ` [${data.interfaces.join(\", \")}]` : \"\"\n const lines: string[] = [`# ${name}<T>${ifaceList}`, \"\", data.description, \"\"]\n\n for (const cat of METHOD_CATEGORIES) {\n const methods = data.methods[cat]\n if (methods && methods.length > 0) {\n lines.push(`## ${cat.charAt(0).toUpperCase() + cat.slice(1)}`, \"\")\n for (const method of methods) {\n lines.push(`- \\`${method}\\``)\n }\n lines.push(\"\")\n }\n }\n\n if (includeFullInterface) {\n const fullInterface = FULL_INTERFACES[name]\n if (fullInterface) {\n lines.push(\"## Full Interface\", \"\", \"```typescript\", fullInterface, \"```\")\n }\n }\n\n return lines.join(\"\\n\").trimEnd()\n}\n\nexport const formatInterfaces = (): string => {\n const lines: string[] = [\"# Interfaces\", \"\"]\n\n for (const [name, data] of Object.entries(INTERFACES)) {\n const ext = data.extends ? ` extends ${data.extends}` : \"\"\n lines.push(`## ${name}<A>${ext}`, \"\", data.description, \"\")\n for (const method of data.methods) {\n lines.push(`- \\`${method}\\``)\n }\n lines.push(\"\")\n }\n\n return lines.join(\"\\n\").trimEnd()\n}\n\nexport const searchTypes = (query: string): string => {\n const q = query.toLowerCase()\n\n // Check for exact type name match first (case-sensitive, e.g. \"IO\", \"Map\", \"Option\")\n const exactMatch = TYPES[query]\n if (exactMatch) {\n return formatType(query, exactMatch)\n }\n\n const matches: Array<{ name: string; data: TypeData }> = []\n\n for (const [name, data] of Object.entries(TYPES)) {\n const nameMatch = name.toLowerCase().includes(q)\n const descMatch = data.description.toLowerCase().includes(q)\n const ifaceMatch = data.interfaces.some((i) => i.toLowerCase().includes(q))\n const methodMatch = Object.values(data.methods)\n .flat()\n .some((m) => m.toLowerCase().includes(q))\n\n if (nameMatch || descMatch || ifaceMatch || methodMatch) {\n matches.push({ name, data })\n }\n }\n\n if (matches.length === 0) {\n return `No types found matching \"${query}\". Available types: ${Object.keys(TYPES).join(\", \")}`\n }\n\n if (matches.length === 1) {\n const match = matches[0]!\n return formatType(match.name, match.data)\n }\n\n // Prioritize name matches over description/method substring matches\n const nameMatches = matches.filter((m) => m.name.toLowerCase().includes(q))\n const otherMatches = matches.filter((m) => !m.name.toLowerCase().includes(q))\n const sorted = [...nameMatches, ...otherMatches]\n\n const lines: string[] = [`# Search results for \"${query}\"`, \"\", `Found ${sorted.length} matching types:`, \"\"]\n for (const match of sorted) {\n const ifaces = match.data.interfaces.length > 0 ? ` [${match.data.interfaces.join(\", \")}]` : \"\"\n lines.push(`**${match.name}**${ifaces}`)\n lines.push(` ${match.data.description}`, \"\")\n }\n\n lines.push(\"---\", \"Use `get_type_api` with a specific type name for full details.\")\n return lines.join(\"\\n\")\n}\n\nexport const getTypeByName = (name: string): { name: string; data: TypeData } | undefined => {\n const direct = TYPES[name]\n if (direct) return { name, data: direct }\n\n const entry = Object.entries(TYPES).find(([typeName]) => typeName.toLowerCase() === name.toLowerCase())\n if (entry) return { name: entry[0], data: entry[1] }\n\n return undefined\n}\n\nexport const getInterfaceByName = (name: string): { name: string; data: InterfaceData } | undefined => {\n const direct = INTERFACES[name]\n if (direct) return { name, data: direct }\n\n const entry = Object.entries(INTERFACES).find(([ifaceName]) => ifaceName.toLowerCase() === name.toLowerCase())\n if (entry) return { name: entry[0], data: entry[1] }\n\n return undefined\n}\n","/**\n * Custom TypeScript CompilerHost for in-memory type-checking of functype code.\n * Resolves functype .d.ts files from node_modules for accurate type validation.\n */\n\nimport { readFileSync } from \"node:fs\"\nimport { createRequire } from \"node:module\"\nimport { dirname, join, resolve } from \"node:path\"\n\nimport ts from \"typescript\"\n\nconst require = createRequire(import.meta.url)\n\nconst resolveFunctypeDistDir = (): string => {\n // Resolve the main entry point, then walk up to find the dist dir\n const functypeMain = require.resolve(\"functype\")\n // functypeMain is something like .../node_modules/functype/dist/index.js\n // Walk up until we find a directory containing package.json\n let dir = dirname(functypeMain)\n for (let i = 0; i < 5; i++) {\n try {\n readFileSync(join(dir, \"package.json\"), \"utf-8\")\n return join(dir, \"dist\")\n } catch {\n dir = dirname(dir)\n }\n }\n // Fallback: assume dist is sibling to main\n return dirname(functypeMain)\n}\n\nconst fileCache = new Map<string, string | undefined>()\n\nexport const clearFileCache = (): void => {\n fileCache.clear()\n}\n\nconst readFileCached = (path: string): string | undefined => {\n if (fileCache.has(path)) return fileCache.get(path)\n try {\n const content = readFileSync(path, \"utf-8\")\n fileCache.set(path, content)\n return content\n } catch {\n fileCache.set(path, undefined)\n return undefined\n }\n}\n\nexport const VIRTUAL_FILENAME = \"/__functype_validate__.ts\"\n\nexport const compilerOptions: ts.CompilerOptions = {\n strict: true,\n target: ts.ScriptTarget.ES2020,\n module: ts.ModuleKind.ESNext,\n moduleResolution: ts.ModuleResolutionKind.Bundler,\n noEmit: true,\n noUncheckedIndexedAccess: true,\n skipLibCheck: true,\n esModuleInterop: true,\n allowSyntheticDefaultImports: true,\n declaration: false,\n sourceMap: false,\n}\n\nexport const createCompilerHost = (sourceCode: string): ts.CompilerHost => {\n const functypeDistDir = resolveFunctypeDistDir()\n const defaultHost = ts.createCompilerHost(compilerOptions)\n\n const host: ts.CompilerHost = {\n ...defaultHost,\n\n getSourceFile(fileName, languageVersion) {\n if (fileName === VIRTUAL_FILENAME) {\n return ts.createSourceFile(fileName, sourceCode, languageVersion, true)\n }\n return defaultHost.getSourceFile(fileName, languageVersion)\n },\n\n fileExists(fileName) {\n if (fileName === VIRTUAL_FILENAME) return true\n return defaultHost.fileExists(fileName)\n },\n\n readFile(fileName) {\n if (fileName === VIRTUAL_FILENAME) return sourceCode\n return readFileCached(fileName) ?? defaultHost.readFile(fileName)\n },\n\n resolveModuleNames(moduleNames, containingFile) {\n return moduleNames.map((moduleName): ts.ResolvedModule | undefined => {\n if (moduleName === \"functype\" || moduleName.startsWith(\"functype/\")) {\n const subpath = moduleName === \"functype\" ? \"index.d.ts\" : moduleName.replace(\"functype/\", \"\") + \".d.ts\"\n const resolvedFileName = resolve(functypeDistDir, subpath)\n if (readFileCached(resolvedFileName) !== undefined) {\n return { resolvedFileName, isExternalLibraryImport: true }\n }\n // Try with /index.d.ts for subpath modules\n const indexPath = resolve(functypeDistDir, subpath.replace(\".d.ts\", \"/index.d.ts\"))\n if (readFileCached(indexPath) !== undefined) {\n return { resolvedFileName: indexPath, isExternalLibraryImport: true }\n }\n return undefined\n }\n\n const result = ts.resolveModuleName(moduleName, containingFile, compilerOptions, defaultHost)\n return result.resolvedModule\n })\n },\n }\n\n return host\n}\n","/**\n * Core validation function — type-checks functype code snippets using the TypeScript Compiler API.\n */\n\nimport ts from \"typescript\"\n\nimport { compilerOptions, createCompilerHost, VIRTUAL_FILENAME } from \"./compiler-host\"\nimport type { ValidateOptions, ValidationDiagnostic, ValidationResult } from \"./types\"\n\nconst DEFAULT_IMPORTS = `import { Option, Some, None, Either, Right, Left, Try, List, Set, Map, Lazy, LazyList, Task, IO, Cond, Match, Brand, ValidatedBrand, Tuple, Stack, Ok, Err } from \"functype\"\\n`\n\nconst hasFunctypeImport = (code: string): boolean => /from\\s+[\"']functype(?:\\/[^\"']*)?[\"']/.test(code)\n\nexport const validateCode = (code: string, options: ValidateOptions = {}): ValidationResult => {\n const autoImport = options.autoImport ?? true\n const shouldPrepend = autoImport && !hasFunctypeImport(code)\n const importLineCount = shouldPrepend ? 1 : 0\n const fullCode = shouldPrepend ? DEFAULT_IMPORTS + code : code\n\n const host = createCompilerHost(fullCode)\n const program = ts.createProgram([VIRTUAL_FILENAME], compilerOptions, host)\n const allDiagnostics = ts.getPreEmitDiagnostics(program)\n\n const fileDiagnostics = allDiagnostics.filter((d) => d.file?.fileName === VIRTUAL_FILENAME)\n\n const rawDiagnostics = fileDiagnostics.map((d) => {\n const { line, character } = d.file!.getLineAndCharacterOfPosition(d.start ?? 0)\n return {\n originalLine: line,\n line: line - importLineCount + 1,\n column: character + 1,\n message: ts.flattenDiagnosticMessageText(d.messageText, \"\\n\"),\n code: d.code,\n severity: (d.category === ts.DiagnosticCategory.Error ? \"error\" : \"warning\") as \"error\" | \"warning\",\n }\n })\n\n // Filter out diagnostics from the prepended import line(s) and map to final type\n const userDiagnostics: ValidationDiagnostic[] = rawDiagnostics\n .filter((d) => !shouldPrepend || d.originalLine >= importLineCount)\n .map(({ originalLine: _, ...rest }) => rest)\n\n return {\n success: userDiagnostics.filter((d) => d.severity === \"error\").length === 0,\n diagnostics: userDiagnostics,\n importsPrepended: shouldPrepend,\n }\n}\n","import { execFileSync } from \"node:child_process\"\nimport { dirname } from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\n\nimport { FastMCP } from \"fastmcp\"\nimport { z } from \"zod\"\n\nimport { FULL_INTERFACES, initDocsData, VERSION } from \"./lib/docs/data\"\nimport { formatInterfaces, formatOverview, formatType, getTypeByName, searchTypes } from \"./lib/docs/formatters\"\nimport { clearFileCache } from \"./lib/validator/compiler-host\"\nimport { validateCode } from \"./lib/validator/validate\"\n\nconst __dirname = dirname(fileURLToPath(import.meta.url))\nconst PROJECT_ROOT = dirname(__dirname)\n\ndeclare const __VERSION__: string\nconst SERVER_VERSION = (\n typeof __VERSION__ !== \"undefined\" ? __VERSION__ : \"0.0.0-dev\"\n) as `${number}.${number}.${number}`\n\nfunction createServer() {\n const server = new FastMCP({\n name: \"functype-mcp-server\",\n version: SERVER_VERSION,\n instructions: `Functype MCP Server — documentation lookup and code validation for the functype TypeScript FP library (v${VERSION}).\n\nAvailable tools:\n- search_docs: Search functype documentation by keyword or type name\n- get_type_api: Get detailed API reference for a specific type\n- get_interfaces: Get the interface hierarchy (Functor, Monad, Foldable, etc.)\n- validate_code: Type-check functype code snippets at compile time\n- set_functype_version: Switch the functype version at runtime (installs + reloads)\n\nUse validate_code to verify your functype code is type-correct before presenting it to the user.`,\n })\n\n server.addTool({\n name: \"search_docs\",\n description:\n \"Search functype documentation by keyword or type name. Omit query for a full overview of all types and categories.\",\n parameters: z.object({\n query: z.string().optional().describe(\"Type name or keyword to search for. Omit for full overview.\"),\n }),\n execute: async (args) => {\n if (!args.query || args.query.trim() === \"\") {\n return formatOverview()\n }\n return searchTypes(args.query)\n },\n })\n\n server.addTool({\n name: \"get_type_api\",\n description:\n \"Get detailed API reference for a specific functype type including methods by category and optionally the full TypeScript interface definition.\",\n parameters: z.object({\n type_name: z.string().describe(\"The type name (e.g., Option, Either, List, IO)\"),\n include_full_interface: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Include full TypeScript interface definition\"),\n }),\n execute: async (args) => {\n const found = getTypeByName(args.type_name)\n if (!found) {\n const available = Object.keys(FULL_INTERFACES).join(\", \")\n return `Type \"${args.type_name}\" not found. Available types: ${available}`\n }\n return formatType(found.name, found.data, args.include_full_interface)\n },\n })\n\n server.addTool({\n name: \"get_interfaces\",\n description:\n \"Get the functype interface hierarchy — Functor, Monad, Foldable, Extractable, Matchable, etc. — with their methods and inheritance.\",\n parameters: z.object({}),\n execute: async () => {\n return formatInterfaces()\n },\n })\n\n server.addTool({\n name: \"validate_code\",\n description:\n \"Type-check a functype code snippet using the TypeScript compiler. Returns PASSED or a list of type errors with line/column/message. Use this to verify functype code is type-correct before presenting to users.\",\n parameters: z.object({\n code: z.string().describe(\"TypeScript code snippet using functype to type-check\"),\n auto_import: z\n .boolean()\n .optional()\n .default(true)\n .describe(\"Automatically import all functype types if no import statement is present. Default: true\"),\n }),\n execute: async (args) => {\n const result = validateCode(args.code, { autoImport: args.auto_import })\n\n if (result.success) {\n const importNote = result.importsPrepended ? \" (functype imports auto-added)\" : \"\"\n return `Validation PASSED${importNote}\\n\\nThe code is type-correct.`\n }\n\n const errorLines = result.diagnostics.map((d) => `- Line ${d.line}, Col ${d.column}: ${d.message} (TS${d.code})`)\n const importNote = result.importsPrepended ? \"\\n\\nNote: functype imports were auto-added.\" : \"\"\n\n return `Validation FAILED — ${result.diagnostics.length} error(s):\\n\\n${errorLines.join(\"\\n\")}${importNote}`\n },\n })\n\n server.addTool({\n name: \"set_functype_version\",\n description:\n \"Switch the functype version at runtime. Installs the specified version and reloads all documentation and type definitions.\",\n parameters: z.object({\n version: z.string().describe('The functype version to install (e.g., \"0.46.0\", \"latest\", \"^0.45.0\")'),\n }),\n execute: async (args) => {\n const spec = `functype@${args.version}`\n try {\n execFileSync(\"pnpm\", [\"add\", spec], { cwd: PROJECT_ROOT, stdio: \"pipe\", timeout: 60_000 })\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n return `Failed to install ${spec}: ${message}`\n }\n\n clearFileCache()\n\n try {\n await initDocsData(true)\n } catch {\n return `Installed ${spec}, but this version does not export functype/cli. Documentation and type definitions are unavailable. The validator will still use the installed version's .d.ts files. Consider using functype >= 0.47.0 for full MCP support.`\n }\n\n return `Switched to functype v${VERSION}. Documentation and type definitions have been reloaded.`\n },\n })\n\n return server\n}\n\nasync function main() {\n await initDocsData()\n\n const server = createServer()\n\n const useHttp = process.env.TRANSPORT_TYPE === \"httpStream\" || process.env.TRANSPORT_TYPE === \"http\"\n const port = parseInt(process.env.PORT || \"3000\")\n const host = process.env.HOST || \"0.0.0.0\"\n\n if (useHttp) {\n console.error(`[functype-mcp] Starting HTTP server on ${host}:${port}`)\n await server.start({\n transportType: \"httpStream\",\n httpStream: { port, host, endpoint: \"/mcp\" },\n })\n console.error(`[functype-mcp] HTTP server ready at http://${host}:${port}/mcp`)\n } else {\n console.error(\"[functype-mcp] Starting in stdio mode\")\n await server.start({ transportType: \"stdio\" })\n }\n}\n\nprocess.on(\"SIGINT\", () => process.exit(0))\nprocess.on(\"SIGTERM\", () => process.exit(0))\n\nmain().catch(console.error)\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAMA,YAAU,cAAc,OAAO,KAAK,IAAI;AAE9C,IAAW,QAAkC,EAAE;AAC/C,IAAW,aAA4C,EAAE;AACzD,IAAW,aAAuC,EAAE;AACpD,IAAW,kBAA0C,EAAE;AACvD,IAAW,UAAU;AAErB,IAAI,cAAc;AAElB,eAAsB,aAAa,OAAgC;AACjE,KAAI,eAAe,CAAC,MAAO;AAE3B,KAAI;EACF,IAAI;AACJ,MAAI,MAEF,OAAM,MAAM,OAAO,GAAG,cADDA,UAAQ,QAAQ,eACW,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK;MAEtE,OAAM,MAAM,OAAO;AAErB,UAAQ,IAAI;AACZ,eAAa,IAAI;AACjB,eAAa,IAAI;AACjB,oBAAkB,IAAI;AACtB,YAAU,IAAI;AACd,gBAAc;UACP,KAAK;AACZ,MAAI,MAAO,OAAM;AACjB,UAAQ,MAAM,0FAA0F,IAAI;;;;;ACjChH,MAAM,oBAAoB;CAAC;CAAU;CAAa;CAAW;CAAS;CAAQ;AAE9E,MAAa,uBAA+B;CAC1C,MAAM,QAAkB,CAAC,cAAc,QAAQ,sCAAsC,G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AAK,EAAE,CAAC;AAE5C,MAAM,CAAC,MAAM,QAAQ,MAAM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "functype-mcp-server",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.3",
|
|
4
4
|
"description": "MCP server for functype documentation lookup and TypeScript code validation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
"LICENSE"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"fastmcp": "^4.0.
|
|
47
|
+
"fastmcp": "^4.0.1",
|
|
48
48
|
"typescript": "^6.0.3",
|
|
49
49
|
"zod": "^4.3.6",
|
|
50
|
-
"functype": "0.60.
|
|
50
|
+
"functype": "0.60.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^24.12.2",
|
|
54
|
-
"ts-builds": "^2.7.
|
|
55
|
-
"tsdown": "^0.21.
|
|
54
|
+
"ts-builds": "^2.7.2",
|
|
55
|
+
"tsdown": "^0.21.10",
|
|
56
56
|
"tsx": "^4.21.0"
|
|
57
57
|
},
|
|
58
58
|
"prettier": "ts-builds/prettier",
|