Skip to main content
Glama

MCP FET Integration

Model Context Protocol (MCP) server that exposes FET — Liviu Lalescu’s free school/university timetable generator — as tools for ChatGPT, Claude, Gemini, Cursor, and other MCP clients.

This repository is the integration layer (TypeScript MCP server + docs). FET itself remains upstream software under AGPL-3.0.

Why TypeScript?

Option

Fit

TypeScript (chosen)

Official MCP server SDK is mature; easy stdio packaging for desktop clients; natural fit for spawning fet-cl, watching job files, and serving HTML/CSV paths.

Python

Also fine for CLI wrappers; skipped so we stay on the primary MCP TypeScript SDK used by most client examples.

FET’s heavy solver stays in C++/Qt (fet-cl). This MCP server owns the editable .fet XML model and orchestrates generation around that binary.

Related MCP server: P6-MCP

FET upstream pin

Field

Value

Homepage

https://lalescu.ro/liviu/fet/

Official GitHub (release archives)

https://github.com/lalesculiviu/fet

Pinned release

FET-7.12.0

Pinned commit

c4f67a7b9a430033133cab602d60d85e90ccbd86 (FET-7.12.0, 2026-10-14)

License

AGPL-3.0

The GitHub repo stores release archives, not an incremental source tree. Use npm run fetch-fet (see vendor/README.md). Do not commit the multi‑GB archive history.

Configurable feature map: docs/fet-configurable-features.md. Assignment text → .fet: docs/fet-from-assignments.md. Natural language → timetable: docs/fet-nl-timetable.md. Private-sample NL coverage notes: docs/private-sample-nl-coverage.md (real .fet only outside the repo, never published). Constraint advisor: docs/fet-advise.md. ChatGPT packaging + Streamable HTTP bridge: docs/chatgpt-mcp-plugin.md. Failed generate diagnosis: docs/fet-diagnose.md.

MCP tool surface (v0.7 — intelligent constraint advisor)

Design: a small meta-tool set over a round-trip XML document model, plus fet-cl job tools. All 275 time + 82 space + 1 generation-option constraint types from FET 7.12 are addressable by name (no 357 hard-coded handlers). v0.3 adds generation from structured Italian assignment lines. v0.4 explains blocking constraints when generation fails (fet_diagnose). v0.5 adds fet_nl_build / fet_nl_patch. v0.6 adds full NL phrase coverage (358 live) + ChatGPT packaging. v0.7 adds fet_advise / fet_advise_apply: heuristics grounded in IT school practice recommend MinDays, SameStartingTime, PreferredRoom, BreakTimes, MaxHoursDaily, NotAvailable, Consecutive, … even when the user does not know the FET type name. The advisor proposes; FET still generates the timetable. The MCP is not the chat LLM — ChatGPT/Claude/Gemini/Cursor call these tools. Real institute .fet stay outside this repository (never committed, never advertised to ChatGPT).

Documents (workspace)

Tool

Purpose

fet_document_new

Create Official/MA/Block/Terms document with basic compulsory constraints

fet_document_open

Load .fet into an editable workspace documentId

fet_document_save

Round-trip save (UTF-8 BOM)

fet_document_list / fet_document_close / fet_document_summary

Workspace management

fet_meta_get / fet_meta_set

Mode, institution, comments, Terms counters, version attr

Entities (CRUD by kind)

Tool

Purpose

fet_entity_kinds

days, hours, real_days, real_hours, subjects, activity_tags, teachers, students, activities, buildings, rooms

fet_entity_list / fet_entity_get

Read entities as JSON fields mirroring XML children

fet_entity_upsert / fet_entity_remove

Insert/update/delete

fet_entity_set_list

Replace days/hours(/real_*) name lists in one call

students uses the FET hierarchy: Year → Group → Subgroup (nested in fields).

Constraints (schema-driven, full catalog)

Tool

Purpose

fet_constraint_catalog

List/filter all 358 catalog types (mode/family/IT description)

fet_constraint_schema

XML tag hints for one type (from getXmlDescription)

fet_constraint_list / fet_constraint_get

Inspect constraints in a document

fet_constraint_add / fet_constraint_update / fet_constraint_remove

Mutate any catalog type via { type, fields }

fields mirrors FET XML: leaf tags → strings, repeated tags → arrays, nested blocks → objects/arrays of objects. Common tags: Weight_Percentage, Active, Comments.

From teacher assignments (v0.3)

Tool

Purpose

fet_parse_assignments

Parse IT/plain-text (or JSON) workloads → structured rows + ambiguities

fet_from_assignments

Build Official .fet in workspace (Teachers/Subjects/Year→Group/Activities/MinDays); optional savePath

Sample: examples/from-assignments/. Mapping rules: docs/fet-from-assignments.md.

Natural language timetable (v0.5–v0.6)

Tool

Purpose

fet_nl_parse

Free-form Italian (or structured intent) → assignments, class splits, constraints, gaps.ask

fet_nl_build

Build Official .fet with Year→Group→Subgroup, weekly MinDays, parallel SameStartingTime

fet_nl_extract

Real .fet → entities + Italian constraint digest + live/stub coverage

fet_describe_constraints

Constraint instances → Italian descriptions

fet_nl_phrase_catalog

358 phrase templates live (hand-tuned overlays on common school types) + parse helper

fet_nl_patch

Conversational add/change/remove on an existing workspace documentId

Sample: examples/from-nl/ (Antonio scenario). Mapping + known gaps: docs/fet-nl-timetable.md.

Constraint advisor (v0.7)

Tool

Purpose

fet_advise

Analyze document / .fet (+ optional IT intent text) → ranked constraint suggestions with Italian why + fieldsDraft + confidence

fet_advise_apply

Apply accepted suggestion ids, or all high-confidence; may create missing LAB rooms

Sample: examples/advise/. Guide: docs/fet-advise.md. Reminder: advisor proposes constraints; fet_generate still builds the timetable.

Diagnose blockers (v0.4)

Tool

Purpose

fet_diagnose

Static heuristics + optional fet-cl / logs/ → Italian blocker + suggested fix + catalog types

fet_generate diagnoseOnFail

On failed wait=true generate, attach the same diagnosis

Sample conflict: examples/diagnose/. Guide: docs/fet-diagnose.md.

Generation / I/O

Tool

Purpose

fet_status

Server + FET pin + catalog counts + fet-cl + workspace docs

fet_load_data

Copy a .fet into data/input and summarize

fet_validate

Structured XML summary (no solver)

fet_generate

Run fet-cl (wait=false for async; diagnosis on fail by default)

fet_job_status

Poll / list jobs

fet_export

List/read HTML, XML, CSV, logs under an output dir

fet_list_examples

Sample .fet paths

Typical flows

A. From linguaggio naturale (classi spezzate, modifiche)

  1. fet_nl_build with Italian prose (or fet_nl_parse first)

  2. If gaps → ask the user using gaps[].ask, then fet_nl_patch / rebuild with filled intent

  3. Optional: fet_advise → review suggestions → fet_advise_apply

  4. fet_document_save → fet_generate → fet_diagnose if needed

B. From incarichi riga-per-riga

  1. fet_from_assignments with Italian assignment text (ask on ambiguities if needed)

  2. fet_document_summary / refine with fet_entity_* / fet_constraint_*

  3. fet_document_save → fet_generate

  4. If failed: read diagnosis or call fet_diagnose

C. Manual edit → generate

  1. fet_document_new or fet_document_open

  2. fet_entity_upsert (subjects, teachers, students, activities, rooms, …)

  3. fet_constraint_schema → fet_constraint_add as needed

  4. fet_document_save → data/input/….fet

  5. fet_generate → fet_job_status / fet_export / fet_diagnose

npm run smoke:nl      # examples/from-nl → antonio-from-nl.fet
npm run smoke:advise  # stripped Antonio sample → advise + apply

Quick start (Windows)

cd "C:\path\to\MCPFETIntegration"
npm install
npm run fetch-fet   # if vendor/fet-src is missing
npm run generate-catalog   # regenerate constraint catalog from FET headers (already committed)
npm run build

Install fet-cl (Windows)

Official Liviu package (no Qt toolchain required):

npm run fetch-fet-windows
# → vendor\bin\fet-7.12.0\fet-cl.exe
$env:FET_CL_PATH = "C:\path\to\MCPFETIntegration\vendor\bin\fet-7.12.0\fet-cl.exe"

Alternatively build from vendor/fet-src/fet-7.12.0/ (CMake + Qt 6, C++17) per FET’s README.

Run the MCP server (stdio)

npm run start
# or during development:
npm run dev

The process waits on stdin for an MCP client. Logs go to stderr only.

Run the Streamable HTTP bridge (ChatGPT / remote MCP)

ChatGPT cloud cannot speak stdio to this PC. Run the local bridge on loopback, then connect ChatGPT via Secure MCP Tunnel (tunnel_id) or an opt-in HTTPS tunnel — not by pasting http://127.0.0.1… (ChatGPT rejects it).

$env:FET_CL_PATH = "C:\path\to\MCPFETIntegration\vendor\bin\fet-7.12.0\fet-cl.exe"
$env:MCP_HTTP_TOKEN = "long-secret"   # required if MCP_HTTP_ALLOWED_HOSTS is set
npm run mcp:http
# health (local only): http://127.0.0.1:3847/health
# opt-in public HTTPS URL helper: npm run mcp:http:tunnel -- -IUnderstandPublicExposure

See docs/chatgpt-mcp-plugin.md (rejected-settings error, Tunnel vs URL). Smoke: npm run smoke:http.

Connect clients

Example configs live in config/. Replace the absolute path with your machine path.

Claude Desktop / Claude MCP

{
  "mcpServers": {
    "fet": {
      "command": "node",
      "args": [
        "C:\\path\\to\\MCPFETIntegration\\build\\index.js"
      ],
      "env": {
        "FET_CL_PATH": "C:\\path\\to\\fet-cl.exe"
      }
    }
  }
}

See config/mcp.claude.example.json, config/mcp.chatgpt.example.json, config/mcp.gemini.example.json.

Cursor

Ready snippet: config/mcp.cursor.json (merge fet into %USERPROFILE%\.cursor\mcp.json).

Repository layout

MCPFETIntegration/
  src/                 TypeScript MCP server + FetDocument model
  src/fet/catalog/     Generated constraint catalog (358 types)
  scripts/             fetch-fet, generate-catalog, copy-catalog
  vendor/              FET pin docs (+ local extracted sources, gitignored)
  examples/            Sample .fet + from-assignments + from-nl + advise + diagnose conflict
  data/                Runtime input/output/jobs (gitignored contents)
  docs/                Feature catalog + NL + advise + diagnose guides
  config/              Example MCP client configs
  LICENSE              AGPL-3.0
  NOTICE               Attribution
  CONTRIBUTING.md

License and attribution

  • This project: AGPL-3.0-only (LICENSE)

  • FET: AGPL-3.0 by Liviu Lalescu — see NOTICE and THIRD_PARTY.md

If you deploy this as a network service that users interact with, AGPL requires you to offer Corresponding Source.

GitHub

Public repository: https://github.com/marconodio-ux/MCPFETIntegration

Real institute .fet are kept outside this repo (and private/ is gitignored with no tracked exceptions). node_modules/, vendor/bin|archives|fet-src/, and secrets stay gitignored and are not published. Public main has no real institute .fet blobs.

Status

v0.7.0 — Constraint advisor: fet_advise / fet_advise_apply recommend and optionally write catalog constraints (MinDays, SameStartingTime, PreferredRoom, …) from school heuristics. Advisor proposes; FET generates. Built on v0.6 full-catalog NL, v0.5 NL build/patch, v0.4 diagnose, v0.3 from-assignments.

Available Tools

39 tools
fet_adviseA

Intelligent FET constraint advisor: analyze a workspace document / .fet (and optional Italian intent text) and return ranked suggestions for constraints the user may not know by name (MinDays, SameStartingTime for parallel labs, PreferredRoom for LAB, BreakTimes, MaxHoursDaily, NotAvailable, Consecutive, …). Each suggestion has catalog type, fieldsDraft, Italian rationale, and confidence. Heuristics follow common IT school practice and map only to real catalog types. IMPORTANT: the advisor proposes constraints — FET (fet_generate) still produces the timetable. Use fet_advise_apply to write accepted suggestions. Do not open private real-institute files unless the user explicitly provides a path.

Inputs: text, limit, inputFile, documentId, +2 more.

fet_advise_applyA

Apply accepted fet_advise suggestions into the workspace document: pass suggestionIds, or omit ids to apply all high-confidence suggestions. May auto-create missing rooms referenced by PreferredRoom drafts. Returns applied/skipped lists. Does NOT run the FET solver — call fet_document_save then fet_generate afterwards.

Inputs: adviseId (required), savePath, documentId, minConfidence, +2 more.

fet_constraint_addB

Append a constraint of any catalog type. fields mirror XML children; Weight_Percentage/Active/Comments default to 100/true/"" when omitted (except generation options).

Inputs: type (required), documentId (required), fields.

fet_constraint_catalogA

List all FET constraint types from the 7.12 catalog (275 time + 82 space + 1 generation option). Filter by kind/mode/substring.

Inputs: q, kind, mode, limit, +1 more.

fet_constraint_getB

Get one constraint by kind + index (index is within that kind’s list).

Inputs: kind (required), index (required), documentId (required).

fet_constraint_listC

List constraints present in a document (optionally filter by kind/type).

Inputs: documentId (required), kind, type, limit, +1 more.

fet_constraint_removeC

Remove a constraint by kind + index.

Inputs: kind (required), index (required), documentId (required).

fet_constraint_schemaB

Return XML field/tag hints for one constraint type (extracted from FET getXmlDescription). fields JSON for add/update should mirror these tags; nested containers become objects/arrays.

Inputs: type (required).

fet_constraint_updateB

Update constraint fields by kind+index. Default merges into existing fields; set replace=true to overwrite all children.

Inputs: kind (required), index (required), fields (required), documentId (required), +1 more.

fet_describe_constraintsA

Describe FET constraints in Italian from a workspace document, .fet file, or inline {type,fields}. Uses live phrase templates for all 358 catalog types (common school types keep hand-tuned overlays).

Inputs: type, limit, filePath, documentId, +1 more.

fet_diagnoseA

Diagnose why FET timetable generation struggles or fails. Combines static conflict heuristics on a .fet / workspace document with optional fet-cl run and parsing of logs/ (errors.txt, difficult_activities.txt, result.txt). Returns Italian-friendly blockers with suggested fixes and catalog constraint types. When FET only says «Impossible», documents limits and points to max-placed / initial-order clues.

Inputs: jobId, runFet, language, inputFile, +4 more.

fet_document_closeC

Drop a document from the workspace (does not delete files).

Inputs: documentId (required).

fet_document_listB

List in-memory FET documents in the MCP workspace.

Inputs: no named parameters.

fet_document_newB

Create a new in-memory FET document (Official by default) with BasicCompulsory time/space constraints. Returns documentId for subsequent entity/constraint tools.

Inputs: days, mode, hours, comments, +2 more.

fet_document_openC

Load a .fet XML file into the workspace (round-trip capable). Optionally copy into data/input.

Inputs: sourcePath (required), documentId, copyToInput.

fet_document_saveC

Serialize a workspace document to a .fet file (UTF-8 with BOM, FET section order preserved).

Inputs: documentId (required), destPath.

fet_document_summaryC

Summarize entity and constraint counts for a workspace document.

Inputs: documentId (required).

fet_entity_getC

Get one entity by kind + index.

Inputs: kind (required), index (required), documentId (required).

fet_entity_kindsA

List supported entity kinds for fet_entity_* tools (days, hours, teachers, students, subjects, rooms, …).

Inputs: no named parameters.

fet_entity_listC

List entities of a kind from a document (JSON fields mirroring FET XML children).

Inputs: kind (required), documentId (required), limit, offset.

fet_entity_removeC

Remove an entity by kind + index.

Inputs: kind (required), index (required), documentId (required).

fet_entity_set_listC

Replace the entire days/hours/real_days/real_hours list (convenience for week definition).

Inputs: kind (required), names (required), documentId (required).

fet_entity_upsertB

Insert or update an entity. fields is a JSON object mirroring XML children (e.g. Subject: {Name, Long_Name, Code, Comments}). Omit index to append.

Inputs: kind (required), fields (required), documentId (required), index.

fet_exportB

List or read generation output artifacts under a job output directory (HTML/XML/CSV/logs).

Inputs: jobId, maxBytes, outputDir, relativePath.

fet_from_assignmentsA

Generate a valid Official (default) FET workspace .fet from Italian/plain-text teacher assignment descriptions (or structured JSON). Creates teachers, subjects, Year→Group students, split Activities, and MinDaysBetweenActivities. Returns documentId + mapping + ambiguities.

Inputs: text, calendar, savePath, documentId, +2 more.

fet_generateA

Run FET command-line generator (fet-cl) on a .fet input file. Generation may take seconds to hours; use wait=false for long jobs and poll with fet_job_status. On failure (wait=true), attaches fet_diagnose-style blockers when diagnoseOnFail is true (default).

Inputs: inputFile (required), wait, jobId, language, +5 more.

fet_job_statusA

Get status for one generation job, or list recent jobs if jobId is omitted.

Inputs: jobId.

fet_list_examplesB

List bundled synthetic/anonymous sample .fet files under examples/ (skips real-institute and non-example paths). Optional vendor FET examples if fetched.

Inputs: limit, includeVendor.

fet_load_dataA

Copy or register a .fet input file into the MCP data/input workspace and return a structured XML summary (also use fet_document_open for editable workspace docs).

Inputs: sourcePath (required), destName.

fet_meta_getC

Get file-level meta: version, Mode, Institution_Name, Comments, Terms fields.

Inputs: documentId (required).

fet_meta_setC

Patch file-level meta (Mode, Institution_Name, Comments, Terms, version attribute).

Inputs: documentId (required), mode, version, comments, +3 more.

fet_nl_buildB

Build a FET Official workspace .fet from Italian natural-language assignments + constraints (and/or structured intent). Maps Year→Group→Subgroup for split classes, teachers/subjects/activities, MinDays on weekly splits, and SameStartingTime for parallel halves. Returns documentId, mapping, and gaps (clarifying questions) — does not pretend to be the chat LLM.

Inputs: text, intent, calendar, savePath, +3 more.

fet_nl_extractA

Open a workspace document or .fet path and extract entities + every constraint instance into structured JSON and Italian descriptions. Reports phrase coverage (all 358 catalog types are live; common school types use hand-tuned overlays). Use before descriptive rebuild/patch. Handles Active=false preferred-time locks as solution artifacts. Prefer synthetic examples unless the user names a path.

Inputs: filePath, documentId, limitConstraints, includeConstraintFields.

fet_nl_parseA

Parse free-form Italian timetable prose (or structured intent JSON) into assignments, class splits (subgroups), and clarifying gaps. Does not write a .fet. Use before fet_nl_build when you want to inspect mapping/gaps. This MCP is NOT ChatGPT — the LLM client asks the user using returned gaps.ask.

Inputs: text, intent.

fet_nl_patchB

Apply conversational Italian modifications (or structured patches) to an existing workspace document: add/change/remove assignments & constraints, add class splits/subgroups. End state remains a .fet suitable for fet_generate / fet_diagnose.

Inputs: documentId (required), text, intent, patches, +1 more.

fet_nl_phrase_catalogC

List NL phrase templates for the 358 FET constraint types (all live: schema-driven + priority overlays). Optionally parse one Italian phrase into type+fields.

Inputs: q, kind, limit, status, +2 more.

fet_parse_assignmentsA

Parse Italian/plain-text teacher workloads (or JSON assignments) into structured rows without writing a .fet. Returns ambiguities that should be asked when unclear.

Inputs: text, assignments.

fet_statusA

Report MCP server status, configured FET version/upstream pin, catalog coverage, fet-cl availability, workspace docs, and data directories.

Inputs: no named parameters.

fet_validateA

Parse and summarize a .fet file (structure/counts via XML model). Does not run the full FET generator.

Inputs: inputFile (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 39 tools

    Disambiguation2/5

    Multiple clusters overlap heavily: fet_parse_assignments, fet_from_assignments, fet_nl_parse, fet_nl_build, and fet_nl_patch all convert Italian assignment text into structured/FET output, and fet_validate, fet_document_summary, fet_load_data, and fet_document_open all load-and-summarize .fet files. The four introspection tools (fet_constraint_catalog, fet_constraint_schema, fet_nl_phrase_catalog, fet_entity_kinds) and the description tools (fet_describe_constraints, fet_extract) are similarly hard to separate without reading long caveats.

    Naming Consistency4/5

    Names follow a consistent fet_<group>_<verb> pattern (fet_entity_*, fet_constraint_*, fet_document_*, fet_nl_*, fet_job_*), with minor deviations like fet_load_data, fet_list_examples, and fet_from_assignments that place the verb differently. The verbs (get, list, add, update, remove, upsert, set) are otherwise predictable.

    Tool Count2/5

    39 tools is heavy for a single server and several are redundant entry points to the same goal (e.g., three NL parsing/building paths, two file-loading tools). While the 358-constraint catalog justifies introspection tools, the surface feels bloated rather than tightly scoped.

    Completeness5/5

    The full timetable lifecycle is covered: document create/open/save/close, entity and constraint CRUD, meta patching, validation, NL parsing and building, generation via fet-cl, job polling, diagnosis, export, and advisory apply. Almost no obvious lifecycle dead ends remain.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables managing cron jobs, maintenance windows, and settings through natural language by exposing the Cronmanager REST API as MCP tools for LLM clients like Claude.
      GPL 3.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP-compatible AI clients to query, analyze, and mutate Oracle Primavera P6 schedules from XER files or live P6 EPPM, with tools for critical path, DCMA compliance, earned value, resources, baselines, and exports.
      45 PyPI
      2
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants like Claude, Cursor, VS Code, and Windsurf to manage workspaces, projects, tasks, and AI agents through natural language, with a hosted OAuth server or a local stdio package. Also supports generating MCP tools from any OpenAPI spec.
      2,530 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI clients such as Claude, Cursor, VS Code, and Windsurf to list and manage workspaces, projects, tasks, AI agents, and automations through a hosted OAuth-secured endpoint or a local stdio package. Also generates MCP tools from any OpenAPI spec.
      2,530 npm
      MIT