ampl-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| UV_INDEX | Yes | Must include https://pypi.ampl.com for resolution to succeed. | |
| AMPLKEY_UUID | No | AMPL licence UUID. Optional; without it a size-limited demo licence is used. | |
| AMPL_MCP_ALLOW_SHELL | No | Set to '1' to permit AMPL's shell and cd statements. | |
| AMPL_MCP_LICENCE_DIR | No | Override the durable licence directory. |
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": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| ampl_versionA | Report server build, AMPL versions, licence tier and installed solvers. Requires no session. Call this first when anything is unexplained: a demo licence solves small models happily and fails only on larger ones, with an error that reads like a modelling problem.
|
| ampl_init_sessionA | Start an AMPL engine. No engine exists until this is called. workdir defaults to a per-session temporary directory; pass a path to work
against a real project. Every path ARGUMENT to a tool is resolved inside
it and an escape is refused - but this is not a sandbox: AMPL expression
text is not path-guarded ( |
| ampl_list_sessionsA | List live sessions and which one is current. |
| ampl_use_sessionC | Make |
| ampl_restart_sessionB | Restart the engine, discarding all model state. The recovery path. |
| ampl_close_sessionB | Dispose the engine, removing the workdir if the server created it. |
| ampl_evalA | Run AMPL statements in order, returning per-statement output and errors. Model-mode set literals need braces:
A |
| ampl_read_filesA | Load .mod/.dat/.run files by path, resolved inside the session workdir. Each file's contents are guard-checked exactly like a statement passed to
ampl_eval before AMPL is asked to load it: a That check stops at the file it is given. If the file itself loads
another file ( On a load failure, |
| ampl_set_dataA | Assign a parameter from JSON, avoiding hand-written .dat syntax.
|
| ampl_list_entitiesA | List declared entities with their shape. The map of what has been built. Call this when unsure what exists rather than guessing at names. |
| ampl_get_dataA | Read an entity's values as records.
Reading a PARAMETER can have a side effect: an indexed
|
| ampl_displayA | Evaluate an arbitrary AMPL display expression. The reach-anything tool. A This tool evaluates AMPL, so AMPL's own output redirection ( |
| ampl_solveA | Solve the current model and summarise the outcome. Returns a bounded tail of solver output, not the whole log. Read duals and reduced costs afterwards with ampl_get_data(name, suffix="dual"|"rc").
|
| ampl_sweepA | Set a scalar parameter to each value, re-solve, and collect results. Server-side so a twenty-point study is one call rather than forty round
trips; AMPL re-presolves only what changed. Each run goes through the
same shared core as ampl_solve ( A value that fails to assign (wrong parameter name, wrong type, a value
outside a declared domain) is recorded as its own failed run ( The parameter is left at whatever the LAST swept value was; this tool
never restores the value it had before the call. A later |
| ampl_optionA | Get an AMPL option, or set it when An option name AMPL does not have is an
|
| ampl_diagnoseA | Explain the last solve: status, message, and violated constraints. Call this after an infeasible or unbounded result rather than guessing at the model. |
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 16 tools
Each tool targets a distinct aspect of the AMPL workflow: session lifecycle, code execution, data I/O, solving, options, and diagnostics. Even overlapping tools like eval/display/read_files are clearly separated by input type and purpose.
All tools share the ampl_ prefix, and most follow a verb_noun pattern (list_sessions, init_session, set_data). A few bare verbs (eval, solve, display) and nouns (version, option) deviate, but the prefix and common AMPL vocabulary keep names predictable.
At 16 tools, this is slightly above the typical 3-15 range, but the complete AMPL lifecycle justifies each tool without redundancy. The count feels appropriate for a comprehensive modeling server.
The toolset covers session management, model building (eval/read_files), data manipulation (set/get), solving (solve/sweep), options, and diagnostics. No obvious missing operations for the domain.