Skip to content

The MCP server's tools answer from the catalogue of operations - #2122

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
the-mcp-uses-the-catalogue
Oct 25, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
the-mcp-uses-the-catalogue

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #1684, the second of two PRs after #2121.

The MCP server's tools answer from the catalogue.

  • Each tool called the library's methods itself. Its answers now come from the entries of Core/Operations/Catalogue.cs: Catalogue.Solve.Ask(e, x) where it called e.Solve(x), and so on.
  • Every entry answers exactly what its method answers, so no answer changes. The 335 tests that drive the server pass as before.
  • The server's own checks of an answer stay direct calls:
    • differentiating an antiderivative back;
    • reading an input as an integer or a decimal;
    • the guard before quadrature.

What each tool offers is declared, and tested.

  • Tools.Offers names the entries each tool offers.
  • Tools.OwnComputations lists the six tools whose answer is the server's own computation, such as am_check_steps and am_eigenvalues, each with what it computes.
  • Tools.NotOffered lists the two entries no tool offers, each with the reason:
    • normalize, since am_simplify offers the whole simplification;
    • evaluate, since am_evaluate keeps exact values exact.
  • McpUnitTests/CatalogueTest checks the three lists against the tool list and the catalogue. An entry added to the catalogue fails the test until a tool offers it, or NotOffered says why none does.

amcli's commands get the same check, without calling the catalogue.

Signing.

  • The catalogue is internal, so the library names AngouriMath.Mcp in its InternalsVisibleTo.
  • A strong-named assembly may only befriend another strong-named one, so the server is signed with key.snk, as UnitTests already is. So is McpUnitTests, which the server befriends.
  • The server ships inside amcli with the library it was built against, so it never meets another version's internals.

Checked:

  • McpUnitTests: 335 passed.
  • TerminalUnitTests: 69 passed, two of them new.
  • The library builds for every target.
  • Removing a tool and an entry from the server's lists fails both of its new tests, and each names what was removed. The same holds for a command and an entry in the terminal's lists.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Part of #1684

Each tool called the library's methods itself. Its answers now come from
the entries of Core/Operations/Catalogue.cs: Catalogue.Solve.Ask(e, x)
where it called e.Solve(x), and so on. Every entry answers exactly what
its method answers, so no answer changes, and the 335 tests that drive
the server pass as they did. The server's own checks of an answer stay
direct calls: differentiating an antiderivative back, reading an input as
an integer or a decimal, and the guard before quadrature.

Tools.Offers says which entries each tool offers. Tools.OwnComputations
lists the six tools whose answer is the server's own computation, such as
am_check_steps, each with what it computes. Tools.NotOffered lists the
two entries no tool offers, normalize and evaluate, each with the reason.
The server's CatalogueTest checks the three against the tool list and
the catalogue. An entry added to the catalogue fails it until a tool
offers it or NotOffered says why none does.

amcli's one-shot commands get the same check, without calling the
catalogue: OneShot.offers names the entry each command offers,
ownCommands says what info, mcp and help do, and notOffered lists the
entries no command offers. Which commands to add is #1019 item 16's
question. OneShotTest reads the catalogue's names by reflection, since
the terminal is not one of the library's friends.

Removing one tool and one entry from the server's lists fails both of its
tests and names each, and the same for one command and one entry in the
terminal's.

The catalogue is internal, so the library names the server in its
InternalsVisibleTo. A strong-named assembly may only befriend another
one, so the server is signed with the library's key, as the unit tests
are, and so is McpUnitTests, which the server befriends. The server
ships inside amcli with the library it was built against.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Oct 25, 2026
@Rafael-SOWNet Rafael-SOWNet moved this from Todo to In review in AngouriMath Oct 25, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 24ae82f into master Oct 25, 2026
34 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant