MCP server for functype — documentation lookup and compile-time TypeScript code validation for AI editors.
This package is part of the functype monorepo.
search_docs— Search functype documentation by keyword or type nameget_type_api— Detailed API reference for any type (Option, Either, List, IO, etc.)get_interfaces— Interface hierarchy (Functor, Monad, Foldable, Extractable, etc.)validate_code— Type-check functype code snippets using the TypeScript Compiler APIset_functype_version— Switch functype version at runtime (installs + reloads docs and types)
The validate_code tool is the killer feature: an LLM writes functype code, calls the tool, gets back type errors, and fixes them before showing the user.
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"functype": {
"command": "npx",
"args": ["functype-mcp-server"]
}
}
}Add to your project's .mcp.json:
{
"mcpServers": {
"functype": {
"command": "npx",
"args": ["functype-mcp-server"]
}
}
}git clone https://github.com/jordanburke/functype.git
cd functype/mcp-server
pnpm install
pnpm buildThen configure your MCP client to use node dist/bin.js.
Search functype documentation. Omit query for a full overview.
query?: string — Type name or keyword (e.g., "Option", "map", "Foldable")
Get detailed API reference for a specific type.
type_name: string — e.g., "Option", "Either", "List", "IO"
include_full_interface?: bool — Include full TypeScript interface definition
Get the interface hierarchy — Functor, Monad, Foldable, Extractable, etc.
No parameters.
Type-check a functype code snippet using the TypeScript compiler.
code: string — TypeScript code to validate
auto_import?: bool — Auto-import functype types if no import present (default: true)
Returns Validation PASSED or a list of errors with line, column, message, and TS error code.
Switch the functype version at runtime. Installs the specified version and reloads all documentation and type definitions.
version: string — Version to install (e.g., "0.47.0", "latest", ...)
Requires functype >= 0.47.0 for full documentation support. Older versions will still work for type-checking via validate_code.
| Variable | Default | Description |
|---|---|---|
TRANSPORT_TYPE |
stdio |
Transport mode: stdio or httpStream |
PORT |
3000 |
HTTP port (when using httpStream) |
HOST |
127.0.0.1 |
HTTP host (when using httpStream). Set 0.0.0.0 to bind all interfaces |
Security note. set_functype_version installs a package and dynamic-imports it, so it is only registered when TRANSPORT_TYPE=stdio (the default). Over HTTP, an unauthenticated caller could otherwise downgrade functype to a vulnerable version. The HTTP listener also defaults to 127.0.0.1 — set HOST=0.0.0.0 explicitly if you really want to bind publicly, and front it with auth.
pnpm validate # format + lint + typecheck + test + build
pnpm test # Run tests
pnpm inspect # Build + launch MCP Inspector
pnpm serve:dev # Dev server with tsx watchMIT