Repository navigation
Chinese deep-dive: FastMCP 4.1.6 — turning a 2,400-row ledger into MCP tools #6348
LAIguapi
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi! I wrote a detailed Chinese-language deep-dive on FastMCP (4.1.6) after actually building something with it, not just reading the README. Sharing the parts that might be useful here.
What I built: a local MCP server exposing 4 tools over an 8-month, 2,400-row personal ledger CSV, so a model could query it instead of being handed the whole file every time.
Things worth knowing from the test:
uv pip install fastmcptook 4.7s; the server itself is 86 lines with no hand-written JSON Schema.monthly_summaryresult is 271 tokens — so the crossover is around 31 rows. At 2,400 rows, pasting the whole table costs ~75x the tool path's fixed cost.is_error=Truewith readable text (bad month, unknown category with the valid list), which lets the model self-correct instead of silently getting an empty result.list_tools()returnsinput_schema(snake_case), not theinputSchemaused in older examples.Contextinjection is signature-based and backed by aContextVar; calling such a function outside a request raisesRuntimeError, so unit tests need an explicit context.MCPServerwere both 11 lines. The framework's value shows up later (clients, proxying, OpenAPI, auth), not in the hello world.Full review is in Chinese, with screenshots, timings and the error output. Happy to answer questions in English or Chinese.
All reactions