Files
memos/server/mcp/evals/memos_eval.xml
T
boojack 619eb8d6b8 chore(mcp): expose spaces, forward the client address, re-pin evals
The MCP catalog survived the recent API changes because it is derived
from OpenAPI, but three things drifted around it, and fixing them
surfaced a fourth.

- mcp: the adapter built each in-process API request with httptest,
  whose fixed peer address (192.0.2.1) overrode the caller's resolved
  address on the client-address middleware's second pass. Every
  anonymous MCP caller shared one rate-limit bucket. The adapter now
  presents the address resolved for the /mcp request as the peer.
- mcp: the full SpaceService is curated as space_* tools. Space and
  member updates drop path-bound fields and rely on the gateway's
  update-mask inference; accepting and declining an invitation no
  longer require an empty body for a body: "*" binding whose only
  field comes from the path.
- mcp/evals: answers re-pinned to the current seed (four users,
  22 top-level memos, 35 reactions, four spaces) and extended with
  space questions.
- store/sqlite: transactions begin IMMEDIATE. Token authentication
  records the token's last-used time asynchronously on every request,
  and the space drivers read before they write in a deferred
  transaction; when the background commit landed in between, SQLite
  refused the upgrade with SQLITE_BUSY without consulting the busy
  timeout. Roughly half of space creates over MCP failed. Taking the
  write lock up front keeps the parent-delete serialization the design
  relies on, so the SQLite stale-snapshot test now asserts that a
  concurrent delete waits for the open transaction instead.
2026-09-18 07:21:38 +08:00

84 lines
3.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
Task-level evaluation for the memos MCP server.
These questions test whether an LLM can accomplish realistic tasks by
composing the curated MCP tools (memo_list_memos with CEL filters,
memo_list_memo_comments, memo_list_memo_reactions, space_list_spaces,
space_list_space_members, user_list_memo_views, auth_get_current_user, ...).
They are NOT unit tests of the server plumbing — see *_test.go for that.
Answers are pinned to the deterministic seed in
store/seed/sqlite/01__dump.sql and were verified by querying a fresh
demo-mode instance through the MCP tools. Run against a freshly seeded
instance ONLY (the public demo at demo.usememos.com is a shared, mutable
account and will not match). See README.md in this directory for how to
launch one.
Questions deliberately avoid absolute dates: the seed uses relative
timestamps (strftime('now','-N days')), so only relative ordering, counts,
and content are stable.
-->
<evaluation>
<qa_pair>
<question>Look at every memo in the instance, including comments, and add up all the emoji reactions across them. What is the total number of reactions?</question>
<answer>35</answer>
</qa_pair>
<qa_pair>
<question>How many memos are pinned?</question>
<answer>2</answer>
</qa_pair>
<qa_pair>
<question>Considering only memos written by the user johnny, one has more reactions than any other. Give that memo's resource name (memos/...).</question>
<answer>memos/johnnyshipped01</answer>
</qa_pair>
<qa_pair>
<question>Two memos are pinned. One contains a task list and the other does not. Give the single tag of the pinned memo that does NOT contain a task list.</question>
<answer>sponsors</answer>
</qa_pair>
<qa_pair>
<question>How many memos contain at least one fenced code block?</question>
<answer>4</answer>
</qa_pair>
<qa_pair>
<question>How many distinct users have authored the memos in this instance?</question>
<answer>4</answer>
</qa_pair>
<qa_pair>
<question>Find the memo that is a cheat sheet of git commands. How many comments does it have?</question>
<answer>2</answer>
</qa_pair>
<qa_pair>
<question>Find the memo containing a movie watchlist. What is the username of the user who created it?</question>
<answer>sam</answer>
</qa_pair>
<qa_pair>
<question>Exactly one memo is a travel bucket list. It names a Nordic country the author plans to visit in winter to see the Northern Lights. Which country?</question>
<answer>Iceland</answer>
</qa_pair>
<qa_pair>
<question>Using the authenticated session, what is the username (login name) of the account these memos belong to?</question>
<answer>steven</answer>
</qa_pair>
<qa_pair>
<question>How many spaces is the authenticated user a member of?</question>
<answer>4</answer>
</qa_pair>
<qa_pair>
<question>Which space has the most accepted members? Give its title.</question>
<answer>Updates</answer>
</qa_pair>
<qa_pair>
<question>Who administers the Travel space? Give that member's username.</question>
<answer>bob</answer>
</qa_pair>
<qa_pair>
<question>How many top-level memos (not comments) are placed in the Dev space?</question>
<answer>6</answer>
</qa_pair>
<qa_pair>
<question>How many top-level memos (not comments) are not placed in any space?</question>
<answer>2</answer>
</qa_pair>
</evaluation>