AgentFEM MCP
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.
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 |
Fail closed before a solve |
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
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
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.
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.
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, andvalidatedremain different scientific states.
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentfem_mcp-0.1.0.tar.gz.
File metadata
- Download URL: agentfem_mcp-0.1.0.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95aecfe5d784aa96c690047c34f99c1d2064eda8d05d5f85315dc8b4af2ab4f1
|
|
| MD5 |
97014a7b4c12d8e792598f1cd78313c5
|
|
| BLAKE2b-256 |
3b73403a104174bc207476f9031195b2f0fbf3ea8a06727121902ce482d4936b
|
Provenance
The following attestation bundles were made for agentfem_mcp-0.1.0.tar.gz:
Publisher:
publish.yml on haoming-luo/agentfem-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentfem_mcp-0.1.0.tar.gz -
Subject digest:
95aecfe5d784aa96c690047c34f99c1d2064eda8d05d5f85315dc8b4af2ab4f1 - Sigstore transparency entry: 2833576827
- Sigstore integration time:
-
Permalink:
haoming-luo/agentfem-mcp@add30dc0b0abcf2273df718b2978c20bb907a46f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/haoming-luo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@add30dc0b0abcf2273df718b2978c20bb907a46f -
Trigger Event:
release
-
Statement type:
File details
Details for the file agentfem_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentfem_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45e53428fd1d91e844e979fb6760000593123c3925d9ead6b48f9d0194d95ace
|
|
| MD5 |
2b87501c972edcc7ad323108c0de514f
|
|
| BLAKE2b-256 |
4ee545daee1cfee8b79638bbb4d9a1e81b765f1a472a8ddb7d29216006e04dc5
|
Provenance
The following attestation bundles were made for agentfem_mcp-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on haoming-luo/agentfem-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentfem_mcp-0.1.0-py3-none-any.whl -
Subject digest:
45e53428fd1d91e844e979fb6760000593123c3925d9ead6b48f9d0194d95ace - Sigstore transparency entry: 2833576831
- Sigstore integration time:
-
Permalink:
haoming-luo/agentfem-mcp@add30dc0b0abcf2273df718b2978c20bb907a46f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/haoming-luo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@add30dc0b0abcf2273df718b2978c20bb907a46f -
Trigger Event:
release
-
Statement type: