Repository navigation
[week-05] 25620024 -- lab steps 2-4: week-01 tools as an MCP server, week-01 loop as an MCP host - #1
Closed
dragonash22 wants to merge 31 commits into
Closed
dragonash22 wants to merge 31 commits into
dragonash22 wants to merge 31 commits into
Conversation
…(tools_server.py) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cp-Method or clientCapabilities gets 400 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ols(), execution via call_tool() Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ator via MCP, answer 69504 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o child, URL -> HTTP); loop untouched Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ol calls, both 69504 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…CP tools only) -- read_file then calculator, 69504 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ns read_file -> calculator -> write_note, result.md = 69504 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tted before any run Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tiation binding, turn checks, token-carried limits, injection, admin routes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a plain exception as 'Error executing tool' Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gent; auth_checks.txt re-run, all four reasons visible Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…luded) for the runner's attempted-violation audit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s bearer token; week-04 role prompts, identical across conditions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ernates host runs, audits the server record, appends results.csv, resumes; --out for smoke runs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es / 16 tool calls each, injection shown to buyer; both end open (no deal), kept out of results.csv Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…6 episodes done Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rpretation, discarded attempts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ewritten as terse bullet points Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, one point per line Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…abeled in 억 원 throughout Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…auth-check market server, not the lab server) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pt_inject attempts was the seller's (buyer-only 4 vs 3); run 2 scenario 4 buyer reached 380, not stayed below it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Closed without merging: the real submission is Q00#263. Merging this would put lab commits on the fork's main and break 'git merge --ff-only upstream/main'. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I built
The week-01 tools now run behind an MCP server, and the week-01 agent loop is now an MCP host that uses them.
lab/tools_server.py(step 2):calculatorandread_filecopied unchanged from week-01, each marked with@mcp.tool(). The hand-writtenTOOLSschema list is gone. The MCP SDK v2 (MCPServer) builds each tool's description from its docstring and itsinputSchemafrom its type hints. The server runs over stdio by default, or over Streamable HTTP athttp://127.0.0.1:8000/mcpwith--http.lab/logs/step3-curl.txt(step 3): requests sent by hand with curl.tools/listreturns 200 with both tools.Mcp-Methodheader returns 400 (-32020, header does not match the body).clientCapabilitiesin_metareturns 400 (-32602).tools/call calculator 48000+9500returns57500.lab/host.py(step 4): the week-01 loop with two changes.TOOLSnow comes fromlist_tools(), converted to the Anthropic tool format.TOOLS_IMPL[name](**args)is nowcall_tool(name, args). The tool'sis_errorflag is also passed through to the model. The rest of the loop is untouched.lab/logs/step4-run-http-*.txt: the first host run over HTTP. It calledread_file(notes.txt), thencalculator("4 + 48000 + 9500 + 12000"), and answered 69504. The model left the date2026-09-01out of "every number" on its own.What I tried and discarded
tool.inputSchema. That fails in SDK v2, where the Python attribute isinput_schema(the JSON field is stillinputSchema). The bug was in my check script, not in the server.mcp>=2replaced an existingmcp 1.25.0. Any old v1 code that importsmcp.server.fastmcp.FastMCPwould now fail to import.git checkout -bstalled for several minutes on the Google Drive-synced working copy and left a stale.git/index.lock. I stopped the process, removed the lock, and created the branch withgit branch+git symbolic-ref, which leaves the working tree untouched.How to run
Remaining
MCP_SERVER, without touching the loopwrite_noteover without touching the hostscenarios.json,results.csv,logs/,auth_checks.txt,REPORT.mdChecklist
python scripts/check_week05.py submissions/25620024/week-05passes locally. It does not yet: only the.pyparse check passes, and the other 5 fail because the assignment files do not exist.logs/(lab logs)🤖 Generated with Claude Code