Fortran Companion MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| extensions | {
"io.modelcontextprotocol/ui": {}
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| explain_best_practicesA | Returns a comprehensive guide of modern Fortran coding standards, design patterns, and practices. |
| lint_codeA | Statically analyzes a string of Fortran code for legacy syntax, implicit typing, missing intents, and bad practices. |
| lint_fileA | Statically analyzes a local Fortran source file for legacy syntax, implicit typing, missing intents, and bad practices. |
| format_codeB | Auto-formats a string of Fortran code using fprettify to enforce modern indentation and spacing. |
| format_fileA | Auto-formats a local Fortran file in-place using fprettify to enforce modern indentation and spacing. |
| initialize_projectA | Initializes a new, modern Fortran project at the specified path. Uses fpm if available, or bootstraps a standard layout with a Makefile. |
| compile_projectA | Compiles the Fortran project. Automatically detects and runs 'fpm build' or 'make' depending on layout. |
| run_testsA | Runs tests for the project. Automatically detects and runs 'fpm test' or 'make test' depending on layout. |
| suggest_design_patternA | Provides boilerplate templates and architectural explanations for modern Fortran design patterns mapping to GoF / Refactoring.Guru. |
| suggest_refactoringA | Analyzes a block of Fortran code and suggests modern design patterns and refactoring options mapped to Refactoring Guru. |
| suggest_refactoring_fileA | Analyzes a local Fortran file and suggests modern design patterns and refactoring options mapped to Refactoring Guru. |
| modernize_fileC | Performs automated syntax replacements to jumpstart modernizing a legacy Fortran file. Updates obsolete operators, converts legacy types, and formats spacing. |
| verify_regressionA | Runs a legacy binary and a modernized binary, comparing their outputs to verify that the refactoring has no regressions. |
| rename_legacy_identifiersA | Safely renames legacy variables to descriptive modern names across a file scope. Validates scope rules, renames variables in code while preserving comments, and builds using compiler flags to verify correctness. |
| convert_common_to_moduleB | Extracts a legacy COMMON block and generates an encapsulated modern Fortran module. Comments out the legacy COMMON statement and inserts matching module imports. |
| analyze_pure_candidatesA | Scans procedures in a file and identifies subprograms suitable for 'pure' or 'elemental' attributes. Helps promote parallelization, vectorization, and side-effect-free code design. |
| audit_implicit_interfacesA | Audits the project and lists all subroutine/function calls lacking an explicit interface. Prevents runtime memory crashes and type mismatches. |
| scaffold_unit_testB | Generates unit testing templates for a specific module procedure. Inspects dummy arguments, intents, and shapes, and registers the test target. |
| scaffold_hpc_gridB | Bootstraps a modern HPC template for grid/stencil calculations using Coarrays or OpenMP. Sets up stencil iteration loops and ghost cell exchange wrappers. |
| generate_c_bindingsB | Auto-generates a standard C binding layer module for a modern Fortran module. Maps Fortran types to C-compatible types using iso_c_binding, and generates bind(c) wrapper interfaces. |
| generate_python_interfaceA | Auto-generates ctypes/numpy binding wrapper scripts for Python integration. Also calls generate_c_bindings first to ensure the C-binding Fortran code is present. |
| project_metricsA | Computes project-wide quality metrics and generates a 'legacy heatmap'. Scans all Fortran files in the project, aggregates lines of code, comment density, counts legacy constructs (COMMON, EQUIVALENCE, GOTO, etc.), and assigns a modernization score. |
| dependency_graphA | Computes module dependency graph and detects modules exposing mutable public state. Scans all Fortran modules in the project, identifies 'use' statements (excluding standard intrinsics), computes fan-in/fan-out metrics, and generates a Mermaid diagram representing the module hierarchy. |
| find_large_unitsA | Detects oversized procedures and modules (complexity / 'god-unit' analysis). Analyzes physical lines, actual code lines, maximum control-flow nesting depth, and SELECT CASE arity across the project. Highly useful for detecting decomposition targets. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 24 tools
Most tools have distinct purposes, but there are overlapping pairs like format_code/format_file, lint_code/lint_file, and suggest_refactoring/suggest_refactoring_file, which differ only by input (code string vs file). However, the descriptions clearly differentiate them, so ambiguity is low.
The majority of tool names follow a verb_noun pattern (e.g., analyze_pure_candidates, compile_project). A few names like dependency_graph and project_metrics are compound nouns, which deviate slightly but are still clear and readable.
With 24 tools, the server covers a broad range of Fortran development tasks (linting, formatting, modernization, testing, HPC, etc.). While slightly on the high side, each tool serves a specific purpose and the set is well-scoped for a comprehensive companion server.
The tool surface covers the main lifecycle: initialization, compilation, testing, linting, formatting, modernization, design patterns, dependency analysis, and metrics. Minor missing functionality like a direct 'run_project' tool or interactive debugging is acceptable given the server's focus on static analysis and scaffolding.