Skip to main content
Glama

AgentFEM MCP

CI PyPI MCP Registry AgentFEM MCP server ToolSDK MCP Registry

One finite-element platform. Any compatible agent. Evidence intact.

AgentFEM MCP gives Codex, Claude, and other MCP-compatible agents a small, stable tool surface for building and running inspectable finite-element projects. AgentFEM remains the deterministic scientific engine; the agent interprets intent and explains evidence.

Install from PyPI · Discover in the official MCP Registry · Read the AgentFEM agent guide

Already using an AI assistant in the terminal? You can use AgentFEM directly through its CLI. Choose between CLI, MCP, and skills →

For a supported desktop client on macOS or Linux, download the tiny AgentFEM-0.1.0.mcpb connection bundle from the 0.1.0 release. It installs only the interface; the AgentFEM scientific runtime remains the single source of solver capabilities, upgrades, and results.

It exposes seven tools—not hundreds of solver internals:

Tool

Purpose

describe_system

Inspect the installed runtime and a compact capability map

create_project

Start from a version-matched AgentFEM template

validate_project

Report process success and scientific acceptance separately

inspect_project

Read project and recent-run identity

submit_run

Launch an isolated serial or MPI process

get_run_status

Observe a durable background job

get_result_summary

Read a compact result and trust state; request full evidence only when needed

Bring it to life

Want to see the underlying workflow before installing?

AgentFEM must already be installed. With uvx, Codex needs one command and the adapter remains isolated from the numerical environment:

codex mcp add agentfem \
  --env AGENTFEM_MCP_ROOTS=/absolute/path/to/AgentFEMProjects \
  -- uvx --from agentfem-mcp agentfem-mcp

Or install the lightweight adapter in the active environment:

python -m pip install agentfem-mcp

The 0.1.0 lifecycle is acceptance-tested with the public AgentFEM 0.3.3 CLI contracts and the current 0.3.7 development line.

Give your agent a project root, not your whole home directory.

Codex

Codex officially supports local stdio MCP servers. Confirm the connection with codex mcp list, then begin with:

Use AgentFEM to create, validate, run, verify, and briefly explain a 2D cantilever. Keep the project and result paths visible.

Claude Desktop and compatible clients

On macOS or Linux, open the release's .mcpb file in a supporting desktop client and choose the one project folder the connection may access. AgentFEM must already be installed. Windows support currently uses the explicit WSL2 configuration from the AgentFEM guide rather than claiming a native bridge.

Claude Code:

claude mcp add agentfem --scope user \
  --env AGENTFEM_MCP_ROOTS=/absolute/path/to/AgentFEMProjects \
  -- uvx --from agentfem-mcp agentfem-mcp

Claude Desktop configuration:

{
  "mcpServers": {
    "agentfem": {
      "command": "agentfem-mcp",
      "env": {
        "AGENTFEM_MCP_ROOTS": "/absolute/path/to/AgentFEMProjects"
      }
    }
  }
}

If a desktop app cannot see the activated conda environment, set AGENTFEM_COMMAND to the absolute agentfem executable. The official macOS runtime, AgentFEM WSL2 runtime, and common agentfem-env/fenicsx-env layouts are also detected automatically.

VS Code and other models

VS Code can place the same local server in .vscode/mcp.json:

{
  "servers": {
    "agentfem": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "agentfem-mcp", "agentfem-mcp"],
      "env": {
        "AGENTFEM_MCP_ROOTS": "${workspaceFolder}"
      }
    }
  }
}

The server is model-neutral. A DeepSeek or other model can use it through any host that implements local MCP tools. ChatGPT connectors require a public HTTPS server; AgentFEM will add that route only with a real authenticated compute and artifact boundary, rather than silently uploading local models through this adapter.

Directory health image

The repository's minimal, unprivileged Dockerfile exists for MCP directory startup and tool-introspection checks. It intentionally contains the public MCP adapter, not a second AgentFEM solver distribution. Real simulations should use the installed AgentFEM runtime and an explicit local project root.

Local Codex plugin

This repository contains a portable AgentFEM workflow skill and a local Codex marketplace under .agents/plugins/. It combines scientific operating guidance with the same MCP server; it does not create a second solver interface.

Related MCP server: pyNastran MCP Server

The contract

AI agent
   │  seven typed MCP tools
   ▼
AgentFEM MCP ── process + path boundary
   │  versioned JSON contracts
   ▼
AgentFEM CLI → Study → Model → Step → SimulationResult
   ▼
FEniCSx / PETSc / MPI
  • No language model or API key is embedded in AgentFEM MCP.

  • No shell command or arbitrary Python string is accepted from a tool call.

  • All project paths must remain under explicitly approved roots.

  • Numerical runs occur in child processes, isolating PETSc/MPI lifetime from the MCP server.

  • completed, verified, and validated remain different scientific states.

  • Compact system discovery preserves AgentFEM's website, repository, citation, and its consent-first, once-per-release-series community invitation. The MCP server never performs an account action for the user.

Environment controls

Variable

Meaning

AGENTFEM_MCP_ROOTS

Approved project roots separated by the platform path separator

AGENTFEM_COMMAND

Absolute path to a specific agentfem executable

With no root configured, the server restricts access to its working directory. The default maximum is 16 MPI ranks and can only be changed by the server operator, not by an agent tool call.

Development

python -m pip install -e '.[test]'
ruff check .
pytest
python -m build

See SECURITY.md for the trust boundary and CONTRIBUTING.md for contribution expectations. The first release evidence records protocol, package, and real-solver acceptance separately.

AgentFEM MCP is Apache-2.0 licensed and maintained as an official companion to AgentFEM.

Available Tools

7 tools
create_projectCreate AgentFEM projectB

Create a new project from one version-matched official AgentFEM template inside an approved root.

Inputs: path (required), name, template. Returns: object

describe_systemDescribe AgentFEMA
Read-onlyIdempotent

Inspect the installed AgentFEM runtime and approved roots. Use summary first; request full only when selecting an advanced capability.

Inputs: detail. Returns: object

get_result_summaryGet AgentFEM result summaryA
Read-onlyIdempotent

Read the structured scientific result for a completed job or the project's latest run, including its trust state.

Inputs: path (required), detail, job_id. Returns: object

get_run_statusGet AgentFEM run statusB
Read-onlyIdempotent

Read one submitted run's status and any AgentFEM execution evidence currently available.

Inputs: path (required), job_id (required). Returns: object

inspect_projectInspect AgentFEM projectA
Read-onlyIdempotent

Read project validation and recent immutable run identities without modifying the project.

Inputs: path (required). Returns: object

submit_runSubmit AgentFEM runB

After preflight, start a finite-element run in a separate process and return a durable job identity immediately.

Inputs: path (required), name, mpi_ranks. Returns: object

validate_projectValidate AgentFEM projectA
Read-onlyIdempotent

Run fail-closed structural and compatibility checks without solving the project.

Inputs: path (required). Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool addresses a distinct phase: system description, project creation, validation, inspection, run submission, status retrieval, and result summary. No overlap in purposes, making tool selection unambiguous.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case (e.g., describe_system, create_project, submit_run). The naming convention is uniform and predictable.

    Tool Count5/5

    Seven tools is well-scoped for a finite-element analysis server, covering the essential lifecycle without redundancy or bloat. Each tool earns its place.

    Completeness4/5

    The core workflow is covered: system inspection, project creation, validation, run submission, status checking, and result retrieval. Minor gaps like project updates or deletion exist but are not critical to the main simulation flow.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to automate multiphysics simulations in COMSOL Multiphysics, covering model management, geometry building, physics configuration, and results visualization. It supports complex simulation workflows through the MCP protocol and includes integrated knowledge retrieval for documentation and troubleshooting.
      93
      959
      MIT
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      An MCP server that enables AI agents to interact with Nastran FEA models by reading, writing, and analyzing BDF and OP2 files. It provides tools for mesh quality assessment, geometric analysis, and automated report generation for structural engineering workflows.
      3
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables AI agents to automate COMSOL Multiphysics simulations, including model management, geometry building, physics configuration, meshing, solving, and results visualization through the MCP protocol.
      78
      MIT