MCP server for interacting with Clingo ASP solver via WebAssembly
This MCP server provides 10 tools for interacting with Clingo ASP solver and Trealla Prolog. While tool names follow verb_noun conventions and input schemas are present with Zod validation, there are significant gaps in descriptions, parameter documentation, output schema specification, and error handling. The server exhibits moderate quality issues typical of early-stage community tools. Most tools have descriptions, but they are brief and lack context on when to use them versus alternatives. Parameters are largely undocumented beyond their names. Output schemas are not formally documented. Error handling returns plain text error messages without recovery guidance or error classification.
Adds ASP facts or rules to the current in-memory program session
Clears the current in-memory program session
Returns the current in-memory ASP program
Loads Prolog program definitions that can be queried later
Loads a previously saved Prolog session
Loads a previously saved ASP program session
Executes a Trealla Prolog query against loaded definitions
Output schemas not documented. Tools return text responses via JSON.stringify() but do not formally specify the structure of returned data. LLMs cannot plan downstream operations or extract fields from results.
Parameter descriptions are missing or minimal. 'program' in solve() lacks context on ASP syntax or expected format. 'models' lacks range constraints or explanation of '0 = all'. 'code' in addToProgram() provides no guidance on ASP rule syntax. LLMs cannot infer valid input without explicit descriptions.
Duplicate tool names across namespaces. Both Clingo and Prolog servers define 'saveSession' and 'loadSession'. The tool list aggregates these without disambiguation, making it unclear which session format (Clingo or Prolog) will be used. LLMs will select the first match, risking wrong behavior.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 47 | 2026-07-28+ | v2 |
Saves the current Prolog session to a file for later loading
Saves the current ASP program session to a file for later loading
Solves an ASP (Answer Set Programming) program using Clingo and returns the answer sets. The program can include the current session program.
Error handling does not guide recovery. When clingo.run() throws an error, the response is a plain text message with no error classification (retryable vs user-fixable vs fatal). No actionable guidance for the LLM, e.g. 'Invalid ASP syntax at line 3: unexpected token. Check solve() documentation for rule format.'
No permission checks or security gates. clearProgram() and clearSession() are destructive and can be called by any client without confirmation or permission validation. No audit trail of who cleared what program and when.
Tool descriptions are generic and lack context. 'Solves an ASP program' does not explain when to call solve() vs addToProgram(). 'Adds ASP facts or rules' does not explain whether to use this for facts, rules, or both, or when to clear the session first. Descriptions should answer: what does it do, when should I use it, what do I get back?
No pagination or result limits documented. If solve() returns 1000 answer sets, the JSON response will be enormous and blow the context window. No documented limit, no pagination mechanism, no guidance for the LLM on how to constrain results.
No idempotency guarantees. addToProgram() with the same 'code' called twice will append the code twice. If an LLM retries on ambiguous failure, the program will have duplicate rules. This violates the idempotent-operation pattern.
File paths for saveSession/loadSession are not sandboxed. The SESSIONS_DIR is './clingo-sessions' relative to CWD, but no validation prevents directory traversal via '../../../etc/passwd' style filenames. Filenames are sanitized via path.join(), but an LLM could be tricked into loading/saving arbitrary files.