Build server → test end-to-end qua chatbot = slow loop:
- Start MCP Inspector để test server
- Verify tools, prompts, resources qua UI
- Development workflow hiệu quả
Mở đầu: Test server không cần chatbot
- Edit server
- Restart app
- Chat với Claude
- Observe behavior
Inspector = web UI test server directly, skip Claude layer.
Start Inspector
mcp dev mcp_server.py
Output:
MCP Inspector starting on http://localhost:6277
Connected to mcp_server.py
Open browser → see dashboard.
Interface
┌────────────────────────────────────────────────┐
│ MCP Inspector │
│ │
│ Server: mcp_server.py [Connected ✓] │
│ │
│ ┌──────────────────────────────────────────┐ │
│ │ Tabs: │ │
│ │ [Resources] [Prompts] [Tools] [Logs] │ │
│ └──────────────────────────────────────────┘ │
│ │
│ Tools: │
│ - hello │
│ - read_doc_contents │
│ - edit_document │
│ │
│ Click tool → see schema, test with params │
│ │
└────────────────────────────────────────────────┘
Test tool
- Click Tools tab
- Click List Tools (refresh)
- Select tool, e.g.,
read_doc_contents - Enter params:
doc_id: "report.pdf" - Click Run Tool
- See result
Result:
[TextContent type="text" text="This report describes Q3 performance..."]
Duration: 25ms
Rapid iteration.
Test prompts
Similar flow trong Prompts tab:
- Select prompt
- Fill params (e.g.,
doc_id: "report.pdf") - View generated messages
Verify interpolation correct.
Test resources
Resources tab:
- Click List Resources
- See resource URIs
- Click resource → read content
Logs
Logs tab:
- Shows server log output
- Debug errors
Helpful when tool fails — see exception trace.
Dev workflow
1. Edit mcp_server.py
2. Save (auto-reload if supported)
3. Refresh Inspector → List Tools
4. Test tool qua Inspector
5. Check log for errors
6. Iterate
Much faster than full chatbot loop.
Testing complex scenarios
Sequence
Test tool chaining:
edit_document(doc_id="report.pdf", old_str="Q3", new_str="Q4")read_doc_contents(doc_id="report.pdf")— verify change applied
Inspector show both results → confirm end-to-end.
Edge cases
- Empty string input
- Very long input
- Invalid doc_id → verify error handling
Inspector catch these without chatbot complexity.
When NOT to use Inspector
Real agent behavior
Inspector is manual. To test "Claude uses tools correctly" — need chatbot.
Inspector = unit test. Chatbot = integration test.
Multi-tool chains
Claude decides dispatch. Inspector sequential manual. Chatbot shows emergent behavior.
Inspector caveat: UI changes
MCP Inspector under active dev. UI may differ screenshots. Core functionality (list/call) stable.
Anti-patterns
Only test via chatbot
Slow feedback loop.
Fix: Inspector first cho unit tests.
Inspector only
Miss emergent agent behavior (Claude choice of tools).
Fix: Both. Inspector + real chatbot.
Not checking logs
Tool fail silently, Inspector show "undefined behavior".
Fix: Check Logs tab when issue arise.
Áp dụng ngay
Bài tập: Test toàn bộ server (15 phút)
Start Inspector. For each tool bạn đã define:
- List tools — verify name, description
- Run tool với normal params
- Run tool với edge case (empty, invalid)
- Check Logs for any error
Goal: confident server robust trước khi integrate.
Tóm tắt bài học
- Inspector = browser UI test MCP server standalone.
mcp dev server.pyto start.- Tabs: Tools, Prompts, Resources, Logs.
- Fast dev loop: edit → reload → test in seconds.
- Complement chatbot testing, không thay thế.