# aifp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/aryanduntley/AIFP  
**GitHub Stars:** 0  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/aifp

## Description
Database-driven FP enforcement and project management for AI-maintained codebases

## Tools
Capabilities this server exposes over MCP:

- **acknowledge_notice** — Mark a notice as delivered so it never fires again for this project. Writes to acknowledged_notices in user_preferences.db; the notice text itself lives in the read-only core database and is untouched. Call only AFTER acting on the notice — for an action_required notice that means after the user has actually answered, not merely been asked.
- **activate_user_directive** — Set directive status to 'active' and record activated_at timestamp. Does NOT deploy services - AI handles deployment via directive workflow.
- **add_completion_path** — Add completion path stage
- **add_directive_preference** — Add/update user preference for directive
- **add_file_flows** — Batch-assign multiple files to flows. Skips existing links silently. More efficient than multiple add_file_to_flow calls.
- **add_file_to_flow** — Assign a finalized file to an architectural flow. Every finalized file needs at least one flow assignment to stay architecturally connected.
- **add_file_to_module** — Assign a file to a module. Creates module_files junction entry. Same pattern as add_file_to_flow.
- **add_files_to_module** — Batch assign multiple files to modules. More efficient than multiple add_file_to_module calls. Skips duplicates silently, fails fast on missing entities.
- **add_flow** — Add a project flow (evolving behaviour/architecture description) linked to at least one theme. theme_ids is required: a flow never exists without a theme.
- **add_flow_themes** — Batch-link flows to themes (flow_themes). Every flow must belong to at least one theme; use this to fix theme-less flows or give a flow a second theme.
- **add_interaction** — Record a dependency between two functions by name (call, chain, borrow, compose, pipe). Interactions are how the AI traces dependency graphs. An edge already tracked is not duplicated (already_existed=true).
- **add_interactions** — Batch-record function dependencies by ID. More efficient than multiple add_interaction calls for tracking all cross-function dependencies. Edges already tracked (same source, target, type) are skipped and counted in skipped_count; ids stay in input order.
- **add_item** — Create a single work item under a task, subtask, or sidequest. Items are the smallest trackable units of work.
- **add_items** — Batch-create multiple work items under a single parent in one call. All items created with status 'pending'.
- **add_milestone** — Add milestone to completion path
- **add_milestone_flows** — Batch-link milestones to the flows (evolving behaviour) they build or change (milestone_flows). A milestone that introduces new behaviour should get a NEW flow (add_flow) rather than growing an existing flow's description.
- **add_module** — Create a new module (reusable code boundary). A module maps to a directory. Files are assigned explicitly via add_file_to_module. Use external_dependencies to record wrapped libraries.
- **add_note** — Record a decision, architecture change, or context event in the project's audit trail. Supports typed notes with optional directive linking.
- **add_path_themes** — Batch-link completion paths to the themes (stable project areas) they advance (completion_path_themes). Themes change rarely, like paths.
- **add_project_entry** — Add new entry to project database
- **add_settings_entry** — Add entry to user settings database
- **add_sidequest** — Create an urgent interruption that pauses the current task. Use for bug fixes, blockers, or unexpected work discovered mid-task.
- **add_subtask** — Create a focused sub-unit of work under a parent task. The parent is paused until all subtasks complete.
- **add_task** — Create a task under a milestone with flow associations. Tasks are created ONE at a time as work progresses, not all at once.
- **add_theme** — Add project theme
- **add_tracking_note** — Add tracking note to user_preferences.db (only when tracking enabled)
- **add_types_functions** — Link tracked types to the functions that use them with a role (factory, transformer, validator, etc.). Enables 'what functions use TypeX?' queries. Links already tracked are skipped and counted in skipped_count instead of failing the batch.
- **add_user_custom_entry** — Add entry to user_directives.db table. Returns inserted record with ID.
- **add_user_directive_note** — Add note to user_directives.db notes table for AI record-keeping
- **add_user_setting** — Add new project-wide user setting to user_settings table
- **aimfp_end** — Session termination orchestrator. Gathers session audit data: reads watchdog state and final reminders, queries all files and functions from DB for AI to cross-reference, reads recent notes and task state. Stops watchdog process if running. Returns structured audit data for AI to interpret and act on. No analysis logic — AI determines what is stale or missing. Also runs the tracking audit (functions, interactions, descriptions) over the session's uncommitted changes (or the in-progress work item's files without git) and returns data.audit with counts, verdict and report_path.
- **aimfp_init** — Phase 1 mechanical setup orchestrator for project initialization. Atomically creates directories, databases with schemas, and templates. No deep logic - pure mechanical operations.
- **aimfp_run** — Main entry point orchestrator. Called on session start (is_new_session=true) for full context bundle, and at work checkpoints (is_new_session=false) for watchdog alerts only.
- **aimfp_status** — Project status in three tiers. Default 'quick' is the cheap position check for completion loops; 'summary' is the reload after lost or compacted context. Structure (themes/flows/modules) is attached to the work and files shown, never listed whole.
- **apply_audit_fixes** — Apply audit findings in ONE call and ONE transaction, with a restore manifest written in the same transaction. Name report categories (report + apply) so thousands of IDs never pass through the conversation, hold back reviewed false positives for this call with exclude={category: [ids]} or for good with exempt=[...], and/or pass explicit changes. Every report finding is re-checked against its row first: an edge whose endpoints changed since the audit, or an entity already gone or renamed, is skipped with a reason. One entry_deletion note lists every deleted row (cascaded edges and type links included) and the old values of every changed row, so any change can be undone. Judgement categories (unconfirmed_interactions, dangling_mentions, missing_functions, untracked_files) are refused: they need prose, a mark, or reconcile_paths. Description review lists (unbaselined_needs_review, stale_descriptions) apply as baselines once reviewed: exclude the ones whose prose you are rewriting.
- **apply_state_changeset** — (For use with InterCommAIMFP) Apply a semantic changeset onto the current-main project.db as a 3-way merge (base@base_main_commit vs branch intent vs current main). Accepts EITHER the inline changeset object OR a changeset_id handle (loaded server-side). Auto-applies non-overlapping changes, mints canonical IDs for genuinely new entities, rewrites all references to canonical IDs, and returns EVERY conflict as structured data for the master/AI to review — it never guesses on a conflict. Mutates the working .aimfp-project/project.db in place after taking a backup; a genuine failure rolls back and restores the backup.
- **audit_descriptions** — Audit function and type descriptions for drift from the code. Read-only. stale_descriptions: the function's code changed after its purpose/parameters/returns were written (functions.source_hash, recorded on every prose write, differs from the current code hash; formatting, comments and docstrings never change the hash). dangling_mentions: a description names a callable that exists nowhere — 'name()' or 'snake_name(...)' not defined, imported or called anywhere in the tracked Python files, not tracked, not a builtin or Python keyword, and not vocabulary the code writes in its string literals (a whole-string identifier or 'name(' in a string: DSL built-ins such as jsonencode, parse_json); attribute calls, ALLCAPS and 'file(s)' plurals are ignored. Described functions with no hash yet are triaged against the code: unbaselined_descriptions (info) pass and can be baselined in one call; unbaselined_needs_review (info) carry triage reasons (recorded parameter names or return type differing from the code, a purpose under three words, snake_case/backticked names in the prose that neither the function nor the rest of its file uses — names, imports, string words, plural or singular forms count), the recorded prose and a code excerpt; a name found nowhere in the repo (any file under the project root the exclusion stack keeps) ranks priority 'high' with signature mismatches, one found elsewhere ranks 'low', and lists are sorted high first. stale_descriptions carry the same triage, priority and excerpt. Warnings only — never blocks a task. Scope selectors combine as a union; with none, the whole project (tracked files plus untracked source files) is audited. Writes the full report to <project folder>/audit/ and returns counts + samples + report_path.
- **audit_functions** — Audit tracked files, functions and types against the source. Read-only. Python files (full fidelity): missing_functions (public, untracked), stale_functions (tracked, gone from the source; a module-level `f = partial(...)`, lambda or alias binding of the name counts as defined), incomplete_functions (purpose/parameters/returns empty), malformed_json (not one JSON encoding of a list/object; double-encoded is fixable), reserved_functions (never finalized), param_mismatch (recorded parameters vs the signature: names, order, required vs default), missing_types, stale_types (name defined nowhere in the file), incomplete_types, missing_type_links (a tracked type named in a signature with no types_functions link, role suggested), files_without_functions (informational). Every file: missing_files (tracked, gone from disk), untracked_files. Regex languages only report names_only_missing (warning) and never claim anything stale. Tracking _private functions is optional: untracked ones are never reported, tracked ones get every check. Scope selectors combine as a union; with none, the whole project (tracked files plus untracked source files) is audited. Writes the full report to <project folder>/audit/ and returns counts + samples + report_path.
- **audit_interactions** — Audit tracked interactions against the call graph the code makes, for the callers in scope. Read-only. Expected edges: calls AND functions used as values (map(fn, xs), partial, dispatch dicts built in the body), credited through untracked same-file helpers, resolved through imports, aliases and re-exports. Categories: missing_interactions (code makes it, DB lacks it), stale_interactions (provably gone: every use of the target's name in the caller resolves to something else — another function, a local or loop variable, a method on a value — or there is none), repoint_interactions (a stale edge that is the same dependency moved: call moved to another function in the same file, or target moved under the same name — one change, not delete+add), unconfirmed_interactions (may be real but unprovable, each with a reason: name resolves ambiguously, called through a record field or factory several functions are stored under, a callback parameter of the target's name, the name as a string in a lookup position (call argument such as getattr's, subscript key, list/tuple/set element; never a dict-literal key, comparison or assignment), a non-Python target: mark indirect or delete), indirect_interactions (is_indirect edges) and non_call_interactions (chain/compose/pipe/borrow types): informational, never flagged. Confirmed without being expected (never reported, never asked to be added): self-recursion, functions held in a module-level table the caller reads (dispatch), a .field() call when the target is the only tracked function stored under that field anywhere (Rec(field=target)), a non-Python function called as name( in the caller's string literals (SQL). Python callers only (full fidelity); other files listed in unchecked_files. Scope selectors combine as a union; with none, the whole project (tracked files plus untracked source files) is audited. Writes the full report to <project folder>/audit/ and returns counts + samples + report_path.
- **audit_tracking** — Run EVERY tracking audit over one scope with one code index and one report: files, functions, types, parameters, JSON encoding, type links (audit_functions), interactions with repoints (audit_interactions), stale prose and dangling mentions (audit_descriptions), plus modularity gaps (structure_gaps). Read-only. The same audit gates task/subtask/sidequest completion (over the item's linked files), runs in aimfp_end over uncommitted work, runs per changed file in the watchdog, and runs in CI as `aimfp audit`. Scope selectors combine as a union; with none, the whole project (tracked files plus untracked source files) is audited. Writes the full report to <project folder>/audit/ and returns counts + samples + block/warn verdict + report_path.
- **backfill_semantic_keys** — (For use with InterCommAIMFP) Mint stable identity keys for any rows that lack one: slugs on work-hierarchy rows (milestones, tasks, subtasks, sidequests, items) and entity_key on functions/types — e.g. rows that predate those columns. OPTIONAL one-time prep: run once on main (and commit) only when a pre-v1.11 project is about to start multi-agent parallel work, so every clone inherits stable baseline keys that export_state_changeset can match. Unnecessary for solo projects (keys never read) and for projects started fresh on v1.11+ (keys minted at creation — no-op). Idempotent.
- **batch_update_progress** — Update multiple project items atomically. Used after code generation or bulk operations to ensure consistency.
- **blueprint_has_changed** — Check if ProjectBlueprint.md has changed using Git or filesystem timestamp
- **catalog_files** — Register existing files in project.db in a single phase. For code already on disk: rows are written finalized (is_reserved=0) with ID naming off, because existing filenames are fixed and cannot carry an _id_ suffix. Use INSTEAD OF reserve_files/finalize_files when adopting an existing codebase. Idempotent on path; re-cataloging keeps a stored name or language that is omitted.
- **catalog_functions** — Register existing functions in project.db in a single phase. Use INSTEAD OF reserve_functions/finalize_functions when adopting an existing codebase. Idempotent on (file_id, name), so a re-scan after source changes refreshes signatures instead of duplicating them. Only supplied fields are overwritten: an omitted or blank purpose, parameters or returns keeps the stored value, so a refresh never erases prose.
- **catalog_types** — Register existing type definitions in project.db in a single phase. Use INSTEAD OF reserve_types/finalize_types when adopting an existing codebase. Idempotent on (file_id, name); definition is always refreshed, an omitted description keeps the stored one.
- **check_directive_health** — Assess every user directive and report which need attention. The health states, in the order they are checked: 'error' (the directive's own status is error); 'overdue' (next_scheduled_time is in the past, meaning the runner said when it would next fire and did not); 'skipping' (consecutive_skip_count is at or above skip_threshold with no run since the last skip, meaning the runner is alive but keeps skipping occurrences, usually because the host is down at the scheduled time); 'degraded' (error rate at or above the threshold); 'never_run' (active but never executed; when dispatch errors exist, the detail says the runner is running but refusing or failing to dispatch, otherwise that the runner may not be deployed); or 'ok'. Returns a verdict per directive with a one-line explanation and the skip fields, plus a count per state, designed to render as a single sentence at session start.
- **check_scheduled_backup_due** — Check whether a scheduled backup is overdue, measured from the LAST BACKUP. Distinct from the inactivity rule (backup_duration), which measures time since the last project change and therefore only ever fires on dormant projects — an actively developed project would otherwise never be backed up. Governed by backup_interval_days; 0 disables scheduling. Called automatically by aimfp_run(is_new_session=true); available standalone for hosts that want the check on demand.
- **clear_watchdog** — Clear watchdog reminders after they have been reviewed and handled. Reminders persist in .aimfp-project/watchdog/reminders.json until this is called. Call after addressing all watchdog findings (file deletions, unregistered files, etc.).
- **core_allowed_check_constraints** — Returns list of allowed values for CHECK constraint enum fields in aimfp_core.db. Parses schema to extract CHECK(field IN (...)) constraints.
- **create_project** — Initialize project entry (one per database)
- **create_project_backup** — Create a backup of .aimfp-project/ right now, ignoring any threshold. Zips everything except backups/ and watchdog/, adds a generated backup_summary.md, and rotates old archives per the backup_count setting, naming every archive it deletes (rotated, plus a warning sentence). The on-demand counterpart to the automatic inactivity check — call this when aimfp_run reports a scheduled backup due, or before any risky operation.
- **create_state_database** — Create per-project state database (.state/runtime.db) from SQL schema. FP-compliant replacement for mutable global variables.
- **create_user_branch** — Create work branch following aimfp-{user}-{number} convention
- **deactivate_user_directive** — Set directive status to 'paused'. Does NOT stop services - AI handles service shutdown via directive workflow.
- **delete_completion_path** — Delete completion path with milestone validation
- **delete_custom_return_statement** — Delete custom return statement(s) for a helper function. By ID, by text, or all for a helper.
- **delete_file** — Delete file with comprehensive cross-reference validation
- **delete_flow** — Delete flow with file validation
- **delete_function** — Delete a function, deciding explicitly what happens to its interactions: refused (with the edges listed) unless repoint_to moves them to the function that took over its job, or confirm_cascade removes them. Every moved or removed edge is recorded in the deletion note so it can be undone. Type relationships must be unlinked first.
- **delete_interaction** — Delete interaction
- **delete_item** — Delete item with status validation
- **delete_milestone** — Delete milestone with task validation
- **delete_module** — Delete a module. CASCADE removes module_files junction entries. Files themselves are NOT deleted.
- **delete_note** — Delete note (discouraged)
- **delete_project_entry** — Smart delete with automatic routing to specialized functions when needed
- **delete_reserved** — Delete abandoned reserved entries (escape hatch for cancelled reserve operations)
- **delete_settings_entry** — Delete entry from user_preferences.db table
- **delete_sidequest** — Delete sidequest with item validation (same logic as delete_task)
- **delete_subtask** — Delete subtask with item validation (same logic as delete_task)
- **delete_task** — Delete task with item validation
- **delete_theme** — Delete theme with flow validation
- **delete_type** — Delete type with relationship validation
- **delete_type_function** — Remove type-function relationship
- **delete_user_custom_entry** — Delete entry from user_directives.db table, writing an entry_deletion note in the same transaction
- **detect_conflicts_before_merge** — Dry-run merge analysis - retrieves potential conflict data for AI to evaluate
- **detect_external_changes** — Compare current Git HEAD with project.last_known_git_hash
- **detect_state_conflicts** — (For use with InterCommAIMFP) OPTIONAL pre-apply planning aid: export each pending worker branch and report where two or more branches touch the SAME semantic entity or edge, so the master can re-partition or deliberately order integration BEFORE applying any changeset. Pure read (built entirely from export_state_changeset). An overlap is a heuristic warning, not a verdict — the authoritative 3-way resolution still happens in apply_state_changeset.
- **execute_merge** — Execute git merge and return result. Updates work_branches table on success.
- **export_state_changeset** — (For use with InterCommAIMFP) Export a semantic changeset of project.db between two committed git states (branch point -> branch tip), expressed entirely in stable semantic keys (file path, file+function/type name, module/theme/flow/path name, and work-hierarchy slugs) with branch-local integer PKs stripped. Each entity is classified add/modify/delete and each edge add/remove. This is the integer-free artifact the master applies to merge a worker's project-state into main without binary-blob conflicts or PK collisions. The changeset is ALSO persisted server-side under .aimfp-project/changesets/ and a small changeset_id handle + counts summary are returned, so the master can drive apply by handle instead of re-transcribing the full object. Pure read of git blobs (the export itself never mutates project.db); persistence writes only a JSON file under .aimfp-project/.
- **file_has_changed** — Check if file changed using Git (if available) or filesystem timestamp
- **finalize_file** — Mark a reserved file as tracked after writing it to disk. The path must be a regular file relative to the project root: '.', a directory, or a path leaving the project is refused. Triggers flow assignment and function/type tracking checks.
- **finalize_files** — Batch-finalize multiple reserved files after writing them to disk. All-or-nothing operation. Each path must be a regular file relative to the project root ('.' or a directory is refused).
- **finalize_function** — Mark a reserved function as tracked after writing it. Triggers interaction and type-function relationship checks.
- **finalize_functions** — Batch-finalize multiple reserved functions after writing them. Triggers interaction and type-function checks for all.
- **finalize_type** — Finalize reserved type after creation
- **finalize_types** — Finalize multiple reserved types
- **find_directive_by_intent** — Match a natural-language user request to the most relevant directive(s). Use when the user describes what they want and you need to find which directive handles it.
- **find_directives_by_intent_keyword** — Find directive IDs matching one or more intent keywords (direct keyword lookup)
- **get_active_user_directives** — Get all user directives with status='active'. Convenience query for checking active directive count.
- **get_all_completion_paths** — Get the project's ordered completion roadmap (stages from setup through completion). Each path contains milestones which contain tasks.
- **get_all_directive_keywords** — Get list of all unique intent keywords available for searching (simple list)
- **get_all_directive_names** — Get list of all directive names (or filtered by types). Returns names only, NOT full directive data. AI queries by name when needs details.
- **get_all_directives** — Load all directives for caching (special orchestrator)
- **get_all_flows** — Get all project flows (architectural groupings describing intended behavior). Check BEFORE starting any task to understand the architecture.
- **get_all_infrastructure** — Get all infrastructure entries including standard fields (even if empty). Returns complete infrastructure table for session bundling and status reports.
- **get_all_intent_keywords_with_counts** — Get all unique intent keywords with usage counts for analytics
- **get_all_modules** — Get all modules in the project. Returns list of all module records sorted by name.
- **get_all_themes** — Get all project themes (high-level architectural areas). Use to orient on project structure before starting work.
- **get_categories** — Get all directive categories
- **get_category_by_name** — Get category by name (fairly frequent)
- **get_claude_permissions** — Returns the Claude Code allowlist (.claude/settings.local.json contents) that pre-approves every AIMFP MCP tool, so the user is not prompted once per tool on first use. Allowlist is derived live from the tool registry so it can never drift. Does NOT write any file — returns ready-to-write JSON + target path; the AI writes/merges it, keeping AIMFP's 'never write outside .aimfp-project/' guarantee intact. Call when the user asks to set up AIMFP permissions or skip approval prompts.
- **get_completion_loop_target** — Get where to loop back after completing directive
- **get_completion_paths_by_status** — Get completion paths filtered by status
- **get_core_fields** — Get field names and types for a specific table
- **get_core_schema** — Get complete schema for core database (all tables and fields)
- **get_core_tables** — List all tables in core database
- **get_current_branch** — Get current Git branch name
- **get_current_commit_hash** — Get current Git HEAD commit hash
- **get_current_progress** — Single entry point for scoped project status queries. Replaces 5-10 separate helper calls with one flexible query.
- **get_databases** — Get list of all available databases with metadata
- **get_directive_by_name** — Load a directive's workflow steps, preferences, and linked notes by name. ALWAYS call BEFORE executing any workflow — directives are the authoritative source, not memory.
- **get_directive_content** — Read and return the full MD documentation file for a directive. Resolves the md_file_path from aimfp_core.db to an absolute path within the installed package, reads the file, and returns content + absolute path + token estimate.
- **get_directive_execution_stats** — Read execution statistics from directive_executions joined to directive names and statuses, for one user directive or all of them. Includes a derived error_rate per row. This is how the AI sees what the user's automation did while no session was open — executions, successes, errors, average and maximum duration, and the last recorded error. On a database at schema 1.3 or later, each row also carries skip_count, consecutive_skip_count, last_skip_time, last_skip_reason, condition_latched and last_condition_eval_time.
- **get_directive_flows** — General-purpose query for directive flows by category, type, or directive names. Complements the navigation helpers (get_flows_from_directive, get_flows_to_directive, get_wildcard_flows), which answer where a specific directive routes.
- **get_directive_keywords** — Get all intent keywords for a specific directive
- **get_directives_by_category** — Get all directives in a category
- **get_directives_by_type** — Get all directives filtered by type (orchestration vs reference)
- **get_directives_for_helper** — Get all directives that use a helper (reciprocal lookup)
- **get_directives_with_intent_keywords** — Search directives by intent keywords and return full directive objects
- **get_file_by_name** — Look up a tracked file by name — use BEFORE reading source files. Returns metadata, path, and ID for follow-up queries.
- **get_file_by_path** — Look up a tracked file by path — use BEFORE reading source files. Returns file metadata and ID for follow-up queries.
- **get_file_ids_from_flows** — Get all file IDs associated with flows
- **get_files_by_flow** — Get all files for a flow
- **get_files_by_flow_context** — Get all files for a flow with functions embedded in each file dict.
- **get_flow_by_name** — Get flow by name (fairly frequent)
- **get_flows_for_file** — Get all flows for a file
- **get_flows_for_milestone** — Get the flows a milestone builds or changes (id, name, description). Use for task flow_ids and before starting milestone work.
- **get_flows_for_theme** — Get all flows for a theme
- **get_flows_from_directive** — Get all flows originating from a directive (what comes next?). Returns raw flow data - AI evaluates conditions.
- **get_flows_to_directive** — Get all directive flows leading to a directive (what leads here?). Useful for understanding directive prerequisites.
- **get_fp_directive_index** — Get lightweight FP directive index grouped by category (names only, not full definitions)
- **get_from_core** — Get records by ID(s), or all records if empty array
- **get_from_core_where** — Flexible filtering with structured JSON conditions
- **get_from_project** — Get records by ID(s) - **EMPTY ARRAY NOT ALLOWED**
- **get_from_project_where** — Flexible filtering with structured JSON conditions
- **get_from_settings** — Get records by ID(s) - **EMPTY ARRAY NOT ALLOWED**
- **get_from_settings_where** — Flexible filtering with structured JSON conditions
- **get_from_user_custom** — Get records by ID(s) from user_directives.db - **EMPTY ARRAY NOT ALLOWED**
- **get_from_user_custom_where** — Flexible filtering with structured JSON conditions on user_directives.db tables
- **get_function_by_name** — Look up a tracked function by name with file location — use BEFORE reading source files. Returns purpose, parameters, returns, and file path.
- **get_functions_by_file** — Get all tracked function signatures for a file — use BEFORE reading source code. Often provides everything needed without opening the file.
- **get_git_status** — Get comprehensive Git state snapshot (orchestrator)
- **get_helper_by_name** — Get specific helper function details (high-frequency)
- **get_helpers_are_sub** — Get all sub-helpers (is_sub_helper=true)
- **get_helpers_are_tool** — Get all MCP tools (is_tool=true)
- **get_helpers_by_database** — Get all helpers for a specific database
- **get_helpers_for_directive** — Get the list of MCP tools available for a directive workflow. Use to discover which tools to call when executing a directive's steps.
- **get_hooks** — Get AIMFP's library surface for code running OUTSIDE AIMFP (src/aimfp/hooks/). Hooks are NOT MCP tools and you cannot call them — they are imported by code that is not AIMFP, such as a generated Use Case 2 automation runner firing from cron or systemd with no AI session open. Your relationship to a hook is that you WRITE CODE CALLING IT during user_directive_implement. Queries is_hook=1 affirmatively; it replaced get_helpers_not_tool_not_sub, which described hooks as the absence of two other flags and so returned an empty list silently for as long as nothing populated that gap.
- **get_incomplete_completion_paths** — Get all non-completed paths
- **get_incomplete_items** — Get incomplete items for any parent type
- **get_incomplete_milestones** — Get all non-completed milestones
- **get_incomplete_sidequests** — Get all non-completed sidequests
- **get_incomplete_subtasks** — Get all non-completed subtasks
- **get_incomplete_subtasks_by_task** — Get incomplete subtasks for specific task
- **get_incomplete_tasks** — Get all unfinished tasks (pending, in_progress, blocked) as flat task rows. Does NOT include subtasks, sidequests or items: use get_open_work for the whole open tree (tasks with their open items and subtasks, plus sidequests) in one call.
- **get_incomplete_tasks_by_milestone** — Get open tasks for a milestone with related subtasks/sidequests
- **get_infrastructure_by_type** — Get all infrastructure of specific type
- **get_interactions_by_file** — Get all interactions involving functions in a file or a set of files (file_ids), each with source and target function names and file paths — one call for a feature's whole dependency picture.
- **get_interactions_by_function** — Get all interactions for a function (both as source and target) — trace dependency graphs
- **get_items_for_sidequest** — Get items for sidequest
- **get_items_for_subtask** — Get items for subtask
- **get_items_for_task** — Get items for task, optionally filtered by status
- **get_merge_history** — (For use with InterCommAIMFP) Read tool over the existing merge_history and work_branches tables: which branches were integrated, when, with how many conflicts, by whom. Lets the master answer 'has this branch already been applied?' (idempotency / resume after interruption) and gives a human an audit trail. Pure read; small surface over data merge_worker_branch records.
- **get_milestones_by_path** — Get all milestones for a completion path
- **get_milestones_by_status** — Get milestones filtered by status
- **get_module_by_name** — Get module by name. Returns module record with path, purpose, and external_dependencies.
- **get_module_by_path** — Get module by directory path.
- **get_module_dependencies** — Get cross-module dependencies. Finds interactions where a function in this module calls a function in a different module via module_files junction. Returns aggregated counts per target module.
- **get_module_files** — Get all files assigned to a module via module_files junction table.
- **get_module_for_file** — Find which module a file belongs to. Reverse lookup via module_files junction table.
- **get_module_functions** — Get all functions in module files. Joins through module_files junction to files to functions.
- **get_module_types** — Get all types in module files. Joins through module_files junction to files to types.
- **get_next_completion_path** — Get lowest order_index with status != completed
- **get_notes_comprehensive** — Query notes with structured filters (id, type, reference, source, severity, directive). Use note_id to read one note in full, e.g. after search_notes returned a preview.
- **get_open_work** — Every open task (pending, in_progress, blocked) with its open items and open subtasks (each with open items), plus open sidequests with their open items, in one read-only call. Ordered in_progress first, then by priority. Replaces get_incomplete_tasks followed by one get_items_for_task per task.
- **get_pending_notices** — Get one-time release notices this project has not yet been shown. Returns ONLY unacknowledged notices, already filtered for applicability — a notice pinned to a schema version stays hidden until that database has actually reached it. An empty result is the normal steady state. Called automatically by aimfp_run(is_new_session=true), which puts the result in data.notices and omits the key entirely when nothing is pending, so you never need to call this yourself in a normal session.
- **get_project** — Get project metadata (single entry)
- **get_project_fields** — Get field names and types for a specific table
- **get_project_json_parameters** — Get available fields for table to use with generic add/update operations
- **get_project_root** — Get project root directory from infrastructure table
- **get_project_schema** — Get complete schema for project database
- **get_project_tables** — List all tables in project database
- **get_recent_directive_errors** — Tail the JSON-lines directive error log, newest first, optionally filtered to one directive. Each record carries directive_id, error_type, message, timestamp, and a full traceback when the failure came from a handler exception. The database keeps only the last error per directive (store_last_error_only defaults to 1), so this file is the only place error history survives.
- **get_settings_fields** — Get field names and types for a specific table
- **get_settings_json_parameters** — Get available fields for table to use with generic add/update operations
- **get_settings_schema** — Get complete schema for user settings database
- **get_settings_tables** — List all tables in user settings database
- **get_sidequest_files** — Get the files worked on for a sidequest (task_files junction). Files are linked automatically when reserved, finalized, cataloged, or updated (and when their functions/types are finalized, cataloged, or updated) while a work item is in_progress — the most recent in_progress sidequest, else subtask, else task.
- **get_sidequest_flows** — Get flow IDs for a sidequest
- **get_sidequests_comprehensive** — Advanced sidequest search
- **get_source_directory** — Get project source directory from infrastructure table
- **get_state_operations_template** — Return the Python state_operations.py template content for AI to adapt to the project's language. Use this to retrieve the CRUD helper template for .state/runtime.db.
- **get_structure_health** — Report the project's modularity layer and every gap in it: themes -> flows -> files, open paths -> themes, open milestones -> flows, module membership. Gaps: flows without theme, themes without flows, files without flow (and no no_flow_reason), files under a module path but in no module, open paths without themes, open milestones without flows, oversized flow descriptions (split candidates). The same report appears in aimfp_status, aimfp_end and watchdog reminders.
- **get_subtasks_by_task** — Get subtasks for task, optionally filtered by status
- **get_subtasks_comprehensive** — Advanced subtask search
- **get_supportive_context** — Returns supportive context reference documents by variant. All variants auto-provided: core + coding by aimfp_run(is_new_session=true) for initialized projects, case2 by aimfp_run when Case 2 active, init by aimfp_init(). Also callable on demand to reload stale context.
- **get_system_prompt** — Returns the AIMFP system prompt (AIMFP's record-keeping backbone) plus where and how to place it. The user's FIRST move — especially for plugin installs where nothing was downloaded — is to ask the AI to add the AIMFP system prompt; the AI calls this and writes the file. Does NOT write anything: returns the prompt text + target path + placement policy; the AI does the write, keeping AIMFP's 'never write outside .aimfp-project/' guarantee. AIMFP content is always placed FIRST; if the existing instructions file is extensive the AI must review/consolidate with the user instead of blindly prepending.
- **get_task_context** — Get complete context for resuming work on a specific task/subtask/sidequest. Single call retrieves item + associated items + linked files + their functions and modules + flows + optionally interactions and notes. Files are linked automatically when reserved, finalized, cataloged, or updated (and when their functions/types are finalized, cataloged, or updated) while a work item is in_progress — the most recent in_progress sidequest, else subtask, else task. A task's context includes its subtasks' files. Uses cached project root internally.
- **get_task_files** — Get the files worked on for a task, including files linked to its subtasks (task_files junction). Files are linked automatically when reserved, finalized, cataloged, or updated (and when their functions/types are finalized, cataloged, or updated) while a work item is in_progress — the most recent in_progress sidequest, else subtask, else task.
- **get_task_flows** — Get the architectural flow IDs for a task. Use to understand which part of the codebase a task touches and find relevant files.
- **get_tasks_by_milestone** — Get all tasks for a milestone (any status)
- **get_tasks_comprehensive** — Advanced task search with multiple filters
- **get_theme_by_name** — Get theme by name (fairly frequent)
- **get_themes_for_flow** — Get all themes for a flow
- **get_themes_for_path** — Get the themes a completion path advances (id, name, description).
- **get_tracking_notes** — Get tracking notes with optional filters
- **get_tracking_settings** — Get all tracking feature flags
- **get_type_by_name** — Look up a tracked type by name with full definition and file location — use BEFORE reading source files. Returns definition_json and description.
- **get_unassigned_files** — Find files not assigned to any module. Useful for identifying tracking gaps — domain logic files that should belong to a module but haven't been assigned.
- **get_user_custom_fields** — Get field names and types for a specific table in user_directives.db
- **get_user_custom_json_parameters** — Get available fields for table to use with generic add/update operations. Returns field names, types, and whether required.
- **get_user_custom_schema** — Get complete schema SQL for user directives database
- **get_user_custom_tables** — List all tables in user directives database
- **get_user_directive_by_name** — Get a single user directive by its unique name
- **get_user_directive_notes** — Get notes from user_directives.db with optional filters. All filters are AND logic. No filters returns all notes.
- **get_user_setting** — Get project-wide user setting by key (fairly frequent)
- **get_user_settings** — Get all user settings from user_settings table (complements get_user_setting which gets one setting by key)
- **get_wildcard_flows** — Get all directive flows from wildcard '*' source (available from ANY context). Includes FP references, utilities, cross-cutting concerns.
- **init_user_directives_db** — Initialize user_directives.db for Case 2 (custom directive automation) projects. Creates the database from schema. Call when project transitions to Case 2.
- **link_files_to_task** — Link files to a task, subtask, or sidequest (task_files junction) so get_task_context and get_task_files return them. Files are linked automatically when reserved, finalized, cataloged, or updated (and when their functions/types are finalized, cataloged, or updated) while a work item is in_progress — the most recent in_progress sidequest, else subtask, else task. Use this for files worked on before the item was in_progress, or to correct a link.
- **list_active_branches** — List all AIMFP work branches from work_branches table
- **list_project_backups** — List available backup archives, newest first, with size, modification time, and which targets each one actually contains. Read-only. Call BEFORE restore_project_backup: a backup only holds databases that existed when it was taken, so an older archive may not carry every target you want.
- **load_directive_preferences** — Load all active preferences for a directive (high-frequency)
- **merge_worker_branch** — (For use with InterCommAIMFP) ONE-CALL branch-ref merge orchestrator: takes a branch name and runs the whole documented sequence internally — export_state_changeset, optional source text-merge (keeping main's project.db, never blob-merging it), then apply_state_changeset — returning only a small result/conflict summary. The ~8k-token changeset never crosses the agent boundary, so a real fan-out stops serializing on the master hand-carrying blobs. Idempotent like apply; records a merge_history row; conflicts are still returned as structured data (never guessed). Mutates the working project.db (after backup) and leaves the source merge uncommitted for you to review and commit.
- **merge_worker_branches** — (For use with InterCommAIMFP) Batch wrapper over merge_worker_branch: integrate a list of worker branches one at a time, each moving main forward and re-minting against the prior. 'additive-first' ordering lands the low-risk purely-additive branches before any structural/deleting ones. Each branch goes through the full export->source-merge->apply sequence; conflicts are surfaced per branch, never guessed.
- **migrate_databases** — Migrate all pending project databases to current schema versions, in place. Per database: refuses if another connection has it open, write-locks it, keeps a pre-migration copy at <project folder>/backups/<db>_pre_migration_v<old>_<YYYYMMDD>.db (never overwriting an earlier copy), rebuilds it from the new schema SQL (shared columns via ATTACH), verifies row counts and atomically swaps the rebuilt file in. A count mismatch or any error leaves the original untouched (placed=false, error). Nothing is left in temp folders.
- **move_files_to_flow** — Re-point many files from one flow to another in one transaction — the tool for splitting an oversized flow or retiring one. Moves links only; files are never touched. Files not in the source flow are skipped.
- **move_flows_to_theme** — Re-point many flows from one theme to another in one transaction (e.g. when a theme is split or merged). Flows not in the source theme are skipped.
- **plan_disjoint_partitions** — (For use with InterCommAIMFP) Compute DISJOINT file/module partitions so parallel workers don't overlap — the cheap complexity lever that converts most semantic conflicts into non-events. Only AIMFP can compute this well because it owns the function->function interaction graph and type-usage edges that define real dependency boundaries. Builds an undirected file-coupling graph (interaction edges + type-usage edges + module co-membership), takes connected components as atomic ownership units (never split), and bin-packs whole components into n_workers balanced partitions. Returns proposed per-worker ownership sets plus shared/contended files. Pure read; a planning aid you may tweak or override.
- **project_allowed_check_constraints** — Returns list of allowed values for CHECK constraint enum fields in project.db. Parses schema to extract CHECK(field IN (...)) constraints.
- **query_core** — Execute complex SQL WHERE clause (advanced, rare use)
- **query_project** — Execute complex SQL WHERE clause (advanced, rare use)
- **query_project_state** — Flexible SQL-like query interface for complex project queries. Provides powerful filtering and joining capabilities without writing raw SQL.
- **query_settings** — Execute complex SQL WHERE clause (advanced, rare use)
- **query_user_custom** — Execute complex SQL WHERE clause on user_directives.db (advanced, rare use)
- **reconcile_paths** — Bring the tracking of changed files up to date in ONE call and one transaction (after a git pull, external edits, or edits made outside reserve/finalize). Per path: an untracked file is cataloged with its functions and types; a tracked file gets functions/types newly present in its source cataloged (existing rows and their prose are never touched) and those no longer in the source reported; a tracked file gone from disk is renamed as declared in renames, else to the one untracked path in the call with the same file name, else reported missing; a legacy row recorded at a folder path ('.' or a directory) is adopted by the one new file with its name instead of being duplicated (reported in files_renamed). Then adds the affected files' call edges (Python), skipping edges already tracked, and reports tracked call edges whose target the caller no longer references, directly or through the untracked same-file helpers it uses (stale_interactions). A tracked _private function is never reported missing just because include_private is false. Never deletes anything. Honours watchdog exclusions.
- **remove_file_from_flow** — Remove a file-flow link from the file_flows junction table. Use when reassigning a file to a different flow or preparing for file deletion.
- **remove_file_from_module** — Remove a file from a module. Deletes module_files junction entry. File itself is not deleted.
- **remove_files_from_module** — Batch remove multiple files from modules. More efficient than multiple remove_file_from_module calls. Skips non-existent entries, reports modules left empty.
- **remove_flow_themes** — Batch-unlink flows from themes. A note is required. Refused (whole batch) if any flow would be left with no theme — link the replacement first, or use move_flows_to_theme.
- **remove_milestone_flows** — Batch-unlink milestones from flows. A note is required. Refused (whole batch) while an open task or sidequest of that milestone still lists the flow in its flow_ids — update those first.
- **remove_path_themes** — Batch-unlink completion paths from themes. A note is required.
- **reorder_all_completion_paths** — Fix gaps and duplicates in order_index
- **reorder_completion_path** — Change order_index for a completion path
- **reserve_file** — Reserve a file ID before writing code, declaring the flow(s) it implements — part of the mandatory reserve-write-finalize tracking flow. flow_ids is required: a list of flows, or an explicit null for a file with no flow. Returns ID to embed in filename.
- **reserve_files** — Batch-reserve file IDs before writing code, each declaring the flow(s) it implements (flow_ids list, or explicit null for no flow). Atomic: all reserve or none.
- **reserve_function** — Reserve a function ID before writing code. Include purpose, parameters, and returns — null fields make functions invisible to future sessions.
- **reserve_functions** — Batch-reserve function IDs before writing multiple functions. Include purpose/parameters/returns for every function.
- **reserve_type** — Reserve a type ID before writing the definition. Include definition_json and description — null fields force full file reads in future sessions.
- **reserve_types** — Batch-reserve type IDs before writing multiple type definitions. Include definition_json and description for every type.
- **restore_project_backup** — Restore selected databases from a backup archive, side-by-side rather than in place. Every requested member is extracted to a temporary file FIRST; only once all extractions succeed is anything live touched. The current file is then moved into backups/ as 'replaced-<timestamp>-<filename>' and the restored copy moved into position. Nothing is ever deleted, so the displaced state remains recoverable.
- **scan_call_graph** — Build the interaction graph for already-cataloged functions: which tracked function calls which. Read-only — returns tuples shaped for add_interactions, which does the writing. Run AFTER catalog_files and catalog_functions. Resolution is conservative and strictest-first (explicit import, then same-file, then module alias, then project-wide unique name), following re-export chains through modules that define no functions of their own. Ambiguous targets are dropped and counted rather than guessed at, because a wrong edge sends future refactors chasing dependencies that do not exist.
- **scan_source_tree** — Read-only inventory of an existing codebase for adoption into AIMFP tracking. Walks source_directory applying the watchdog's exact exclusion stack (built-in exclusions + watchdog_excluded_* settings + .watchdogignore), extracts signatures, and reports tracked vs untracked. Writes nothing — review the inventory, then register with catalog_files/catalog_functions/catalog_types.
- **search_directives** — Find directives by type, category, or keyword when you know the domain but not the exact directive name. Multi-word input is split into words; a row matches if ANY word prefix-matches ("disk space free" finds get_free_disk_space). Rows matching more words rank first. Punctuation is ignored, so no FTS syntax is needed or honored. Common stopwords (the, of, and, ...) are ignored unless the query is nothing but stopwords. Keyword results are ordered by name/description relevance.
- **search_functions** — Search tracked functions by name or purpose with relevance ranking. Multi-word input is split into words; a row matches if ANY word prefix-matches ("disk space free" finds get_free_disk_space). Rows matching more words rank first. Punctuation is ignored, so no FTS syntax is needed or honored. Common stopwords (the, of, and, ...) are ignored unless the query is nothing but stopwords. Results are capped by limit; total_count reports all matches.
- **search_modules** — Search modules by name, purpose, or description with relevance ranking. Multi-word input is split into words; a row matches if ANY word prefix-matches ("disk space free" finds get_free_disk_space). Rows matching more words rank first. Punctuation is ignored, so no FTS syntax is needed or honored. Common stopwords (the, of, and, ...) are ignored unless the query is nothing but stopwords. Results are capped by limit; total_count reports all matches.
- **search_notes** — Search past decisions and context by keyword. Multi-word input is split into words; a row matches if ANY word prefix-matches ("disk space free" finds get_free_disk_space). Rows matching more words rank first. Punctuation is ignored, so no FTS syntax is needed or honored. Common stopwords (the, of, and, ...) are ignored unless the query is nothing but stopwords. Returns capped previews by default; read a note in full with get_notes_comprehensive(note_id=X).
- **search_tracking_notes** — Search tracking note content with optional filters
- **search_types** — Search tracked types by name or description with relevance ranking. Multi-word input is split into words; a row matches if ANY word prefix-matches ("disk space free" finds get_free_disk_space). Rows matching more words rank first. Punctuation is ignored, so no FTS syntax is needed or honored. Common stopwords (the, of, and, ...) are ignored unless the query is nothing but stopwords. Results are capped by limit; total_count reports all matches.
- **search_user_directive_notes** — Search note content in user_directives.db with optional additional filters
- **search_user_directives** — Search user directives with optional filters. At least one filter required.
- **set_custom_return_statement** — Add a custom return statement for a helper function. Extends core return_statements with user-defined guidance, context, or preferences. To modify: delete first, then set new statement.
- **summarize_state_changeset** — (For use with InterCommAIMFP) Cheap, low-token counts summary of ONE branch's changeset — add/modify/delete per entity kind, add/remove per reference kind, touched files/modules, and warning count — WITHOUT returning the full ~8k-token object. Affordable to read for every pending branch before deciding apply order. Identify the changeset by changeset_id (loads the persisted artifact) or by branch+base_commit (re-exports). Pure read.
- **swap_completion_paths_order** — Swap order_index of two completion paths
- **sync_git_state** — Update project.last_known_git_hash with current Git HEAD
- **toggle_tracking_feature** — Enable/disable tracking feature
- **unlink_files_from_task** — Remove file links from a task, subtask, or sidequest — e.g. a file auto-linked to the wrong in_progress item. Does not touch the files.
- **update_completion_path** — Update completion path
- **update_directive_preference** — Update existing directive preference in directive_preferences table
- **update_file** — Update file metadata
- **update_flow** — Update flow metadata
- **update_function** — Update function metadata
- **update_function_file_location** — Move function to different file (rarely used)
- **update_functions_for_file** — Update multiple functions in a single file
- **update_interaction** — Update interaction metadata
- **update_item** — Update a single item's status, name, or description. Primary use: marking items in_progress or completed as work progresses.
- **update_items** — Batch-update multiple items with the same field values. Primary use: marking multiple items completed at once when parent completes.
- **update_milestone** — Update milestone status, name, or description. When completing, check if all milestones in the path are done to cascade completion.
- **update_module** — Update module metadata. Only non-None fields are updated.
- **update_note** — Update note metadata
- **update_project** — Update project metadata
- **update_project_entry** — Update existing entry
- **update_project_root** — Update project root in infrastructure table. Failsafe: Inserts if not exists (should never happen, initialized by SQL).
- **update_project_state** — Orchestrated state change for tasks, milestones, and paths. Maps actions (start_task, complete_task, block_task, etc.) to correct status updates and note creation.
- **update_settings_entry** — Update entry in user settings database
- **update_sidequest** — Update sidequest metadata
- **update_source_directory** — Update existing source directory in infrastructure table
- **update_subtask** — Update subtask metadata
- **update_task** — Update task metadata
- **update_theme** — Update theme metadata
- **update_type** — Update type metadata
- **update_type_function_role** — Update relationship role only
- **update_user_custom_entry** — Update entry in user_directives.db table
- **update_user_setting** — Update existing project-wide user setting in user_settings table
- **user_directives_allowed_check_constraints** — Returns list of allowed values for CHECK constraint enum fields in user_directives.db. Parses schema to extract CHECK(field IN (...)) constraints.
- **user_preferences_allowed_check_constraints** — Returns list of allowed values for CHECK constraint enum fields in user_preferences.db. Parses schema to extract CHECK(field IN (...)) constraints.
- **validate_action_config** — Checks an action_config against AIMFP's envelope for its action_type BEFORE the row is written; add_user_custom_entry and update_user_custom_entry refuse a non-conforming config. AIMFP validates the ENVELOPE ONLY. api_call, script_execution and notification are generic, so AIMFP can specify them fully. function_call and command name a target that exists in the caller's own project, so AIMFP checks that a target is named and well-formed but never that it resolves - caller_resolved=true marks exactly that, and means 'the shape is right, now check it resolves'. Unknown keys are errors, not ignored. On failure, errors names every offending key and grammar carries the expected envelope.
- **validate_trigger_config** — Checks a trigger_config against AIMFP's grammar for its trigger_type BEFORE the row is written. add_user_custom_entry and update_user_custom_entry refuse a non-conforming config, so calling this first turns a rejected insert into a fixed config. Time triggers are a discriminated union on 'kind' (interval/daily/weekly/monthly); event, condition and manual have fixed shapes. Unknown keys are errors, not ignored - a typo'd schedule key is the silent failure this exists to surface, because a schedule that never fires produces no log line and no recorded error. On failure, errors names every offending key and grammar carries the expected shape for that trigger_type, so the AI is told what IS expected rather than guessing.
- **verify_fanout_ready** — (For use with InterCommAIMFP) Pre-fan-out preflight on current main: cheap insurance against silent fan-out corruption. Asserts (a) every relevant row has a stable identity key (hierarchy slugs + function/type entity_key — i.e. backfill_semantic_keys has nothing left to do), (b) .aimfp-project/project.db is committed (clean working tree for that path) so every clone shares the same base, and (c) no schema migration is pending. Returns {ready, blockers}. Run on main BEFORE spawning workers. Pure read.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "aifp": {
    "command": "uvx",
    "args": ["aimfp"]
  }
}
```

## Documentation

## What aifp does

aifp provides the database-backed coordination layer for AIMFP, a language-agnostic approach to AI-generated and AI-maintained software. It combines functional-programming guidance with procedural project tracking: code is organized around explicit functions, modules, flows, themes, and dependency relationships, while work is arranged into completion paths, milestones, tasks, subtasks, sidequests, and items.

The project model is intended to preserve context between AI sessions. Files, functions, interactions, notes, directives, preferences, and work state are stored in SQLite so an assistant can retrieve structured project information instead of reconstructing it by repeatedly examining source files. A single AIMFP instance is intended for one project directory; separate projects should use separate instances.

## How it works

An AI assistant communicates with the MCP server through JSON-RPC over standard input and output. The server manages connections to four SQLite databases:

- `aimfp_core.db` stores the global, read-only knowledge base of standards, directives, and helper definitions.
- `project.db` stores mutable project metadata, source entities, architecture, work tracking, and runtime notes.
- `user_preferences.db` stores project-scoped preferences, settings, tracking information, and learning records.
- `user_directives.db` optionally stores custom directives, execution data, dependencies, generated-code references, and related records.

The server exposes database helper operations; the AI assistant decides which operations to perform. Activating a directive changes its status and records a timestamp, but does not deploy a service. For custom automation, a generated project runner can use AIMFP as a regular library outside an AI session, while the MCP server later reads the resulting directive data and logs.

## Setup and configuration

Configure the MCP server as a stdio-based server in the AI client. The location of the global core database is user-defined and configured through the client. Project databases are associated with the project directory, and the design expects one instance per project.

AIMFP is language-agnostic and is described as adaptable to Python, JavaScript, TypeScript, Rust, Go, and other languages. The automation path uses project-owned runner code and does not require the MCP server to remain active between runs.

## Tools and capabilities

The exposed operations cover several related areas:

- **Architecture:** create modules, assign files to modules or flows, create flows and themes, link flows to themes, and record function interactions.
- **Dependency indexing:** add function-to-function relationships and link tracked types to the functions that use them.
- **Project planning:** create completion paths, milestones, tasks, subtasks, sidequests, and work items, then connect milestones to flows and paths to themes.
- **Directives and preferences:** activate directives, manage directive preferences, add custom directive records, and record directive notes.
- **Project history:** add audit notes, tracking notes, project entries, settings, and user settings.

Several operations have batch variants for assigning files, linking entities, creating items, and recording interactions. These reduce repeated calls and commonly skip duplicate relationships rather than creating them again. Some operations enforce structural rules: flows require at least one theme, finalized files should be assigned to a flow, and task creation is intended to proceed as work advances.

## Limitations and notes

aifp provides database helpers rather than making project decisions itself. The AI assistant remains responsible for interpreting directives, choosing workflow actions, generating code, and handling deployment. The core database is read-only, while project and preference databases are mutable.

Directive automation is not a built-in scheduler. A cron job, systemd service, or another daemon must run the generated project runner when automation needs to continue without an AI session. The runner writes execution information, which the assistant can inspect later through the stored directive data and logs.

_Full upstream README: https://allmcps.com/mcp/aifp/readme_

