AgentFEM MCP is the official MCP (Model Context Protocol) interface of AgentFEM, aimed at Codex, Claude, and other MCP-compatible agents, providing a small and stable tool surface for building and running inspectable finite element projects. Its core idea is: AgentFEM remains a deterministic scientific engine, and the agent is responsible for interpreting user intent and explaining the evidence.
Purpose This interface enables MCP-compatible agents to create, validate, run, inspect, and verify finite element simulations. It exposes only seven tools, rather than hundreds of solver internals, thereby reducing agent invocation complexity while maintaining the traceability of scientific computation.
Main capabilities
- Create, validate, run, inspect, and verify finite element simulation projects.
- Integrate with Codex, Claude Desktop, and other MCP-compatible clients.
- Support installation via PyPI, and can also be discovered in the official MCP Registry.
- Provide a .mcpb connection package (version 0.1.0) for macOS or Linux desktop clients; it installs only the interface, while the scientific runtime is still provided by AgentFEM.
- The repository contains portable AgentFEM workflow skills and a local Codex marketplace (located in .agents/plugins/), combining scientific operation guides with the same MCP server, without creating a second solver interface.
- Provide a minimal, unprivileged Dockerfile for MCP directory startup and tool introspection checks; the image contains only the public MCP adapter, not a second AgentFEM solver distribution.
Usage AgentFEM must already be installed before use.
- Install via uvx: Codex requires only one command, and the adapter is isolated from the numerical environment.
- Or install the lightweight adapter in the current environment.
- Codex officially supports local stdio MCP servers; use codex mcp list to confirm the connection.
- Claude Desktop and compatible clients: on macOS or Linux, open the released .mcpb file with a supported desktop client, and choose to connect to an accessible project folder. Windows currently uses the explicit WSL2 configuration in the AgentFEM guide, rather than a native bridge.
- If the desktop application cannot see the activated conda environment, AGENTFEM_COMMAND can be set to the absolute path of the agentfem executable. The official macOS runtime, the AgentFEM WSL2 runtime, and common agentfem-env / fenicsx-env layouts are also detected automatically.
- VS Code and other models: the same local server can be placed in .vscode/mcp.json. The server is model-agnostic; DeepSeek or other models can be used through any host that implements local MCP tools. The ChatGPT connector requires a public HTTPS server; AgentFEM adds this route only when there is a real authentication and artifact boundary, and does not silently upload local models through this adapter.
- It is recommended to give the agent a project root directory rather than the entire home directory.
Use cases
- Scientific research or engineering workflows that require agent-assisted creation, execution, and verification of finite element simulations.
- Scenarios where you want to keep scientific computing deterministic and evidence complete while letting the agent explain intent and evidence.
- Use clients that support local MCP tools, such as Codex, Claude Desktop, and VS Code.
- You can refer to the examples in the repository: a 3D structural design case (comparing support weight and deflection under the same load; the public browser version uses precomputed candidates), a simulation-to-surrogate-model mini lab (ten real FEM outputs, a small NumPy model, and an interactive notebook), and an AI-assisted cantilever beam quick start (create a readable project, run it, and inspect the numerical results).
Limitations
- AgentFEM must already be installed; the MCP interface itself does not include a solver.
- No language model or API key is embedded.
- Shell commands or arbitrary Python strings from tool calls are not accepted.
- All project paths must be under an explicitly approved root directory.
- Numerical runs are performed in subprocesses to isolate the PETSc/MPI lifecycle from the MCP server.
- completed, verified, and validated are different scientific states.
- When no root directory is configured, the server is limited to accessing its working directory. The default maximum number of MPI processes is 16, and it can only be changed by the server operator; agent tool calls cannot change it.
- The 0.1.0 lifecycle has been acceptance-tested against the public AgentFEM 0.3.3 CLI contract and the current 0.3.7 developmentline.
- Native Windows support is not yet available; currently a WSL2 configuration is used.
- The public HTTPS server route required by the ChatGPT connector is not yet available.
- Licensed under Apache-2.0, maintained as the official companion project of AgentFEM.