xiaohongshu
xiaohongshu
mcp-inspector
Test Model Context Protocol (MCP) servers using the MCP Inspector CLI with correct syntax
Full skill instructions
This skill provides comprehensive testing capabilities for Model Context Protocol (MCP) servers, particularly Julia-based servers using ModelContextProtocol.jl. It uses the correct Inspector CLI syntax verified through extensive testing.
Test MCP servers to verify:
# For Julia projects - ALWAYS run these first from project root
cd /path/to/project
julia --project -e 'using Pkg; Pkg.resolve(); Pkg.precompile()'
# If examples have separate Project.toml
cd examples && julia --project -e 'using Pkg; Pkg.resolve(); Pkg.instantiate()'
cd ..
Why: Julia manifests may be resolved with different versions, causing dependency errors (especially MbedTLS_jll).
# ✅ CORRECT - from project root
cd /path/to/project
npx @modelcontextprotocol/inspector --cli julia --project=. examples/server.jl ...
# ❌ WRONG - from subdirectory
cd examples
npx @modelcontextprotocol/inspector --cli julia --project examples/server.jl ...
# Results in "examples/examples/server.jl: No such file" error
npx @modelcontextprotocol/inspector --cli \
<server-command> <server-args> \
--method <method-name> \
[--tool-name <name>] \
[--tool-arg key=value ...] \
[--uri <uri>] \
[--prompt-name <name>] \
[--prompt-args key=value ...]
Tool Arguments:
--tool-arg key=value (can be repeated)--params '{"key":"value"}'Prompt Arguments:
--prompt-args key=value (can be repeated, note plural)--prompt-arg (singular)Resource URI:
--uri "scheme://path"List Tools:
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method tools/list
List Resources:
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method resources/list
List Prompts:
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method prompts/list
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method tools/call \
--tool-name current_time
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/multi_content_tool.jl \
--method tools/call \
--tool-name flexible_response \
--tool-arg format=text
Multiple Parameters:
--method tools/call \
--tool-name analyze \
--tool-arg param1=value1 \
--tool-arg param2=value2 \
--tool-arg param3=value3
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method resources/read \
--uri "character-info://harry-potter/birthday"
# This will fail due to server-side _meta bug
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method prompts/get \
--prompt-name movie_analysis \
--prompt-args genre="science fiction" \
--prompt-args year=1999
Note: prompts/get currently fails due to ModelContextProtocol.jl serializing _meta: null instead of omitting the field.
# Terminal 1: Start server
cd /path/to/project
julia --project=. examples/simple_http_server.jl
# Wait 5-10 seconds for Julia compilation
# Terminal 2: Test with Inspector
npx @modelcontextprotocol/inspector --cli \
npx mcp-remote http://127.0.0.1:3000 --allow-http \
--method tools/list
curl -X POST http://127.0.0.1:3000/ \
-H 'Content-Type: application/json' \
-H 'MCP-Protocol-Version: 2025-06-18' \
-H 'Accept: application/json' \
-d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2025-06-18"},"id":1}' \
| jq .
#!/bin/bash
cd /path/to/project
echo "=== SETUP ==="
julia --project -e 'using Pkg; Pkg.resolve(); Pkg.precompile()'
echo -e "\n=== TOOLS/LIST ==="
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method tools/list
echo -e "\n=== RESOURCES/LIST ==="
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method resources/list
echo -e "\n=== PROMPTS/LIST ==="
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method prompts/list
echo -e "\n=== TOOLS/CALL (no params) ==="
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method tools/call \
--tool-name current_time
echo -e "\n=== RESOURCES/READ ==="
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method resources/read \
--uri "character-info://harry-potter/birthday"
echo -e "\n=== TOOLS/CALL (with params) ==="
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/multi_content_tool.jl \
--method tools/call \
--tool-name flexible_response \
--tool-arg format=text
echo -e "\n=== TOOLS/CALL (multi-content) ==="
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/multi_content_tool.jl \
--method tools/call \
--tool-name flexible_response \
--tool-arg format=both
Symptom: prompts/get fails with validation error about _meta field
Cause: Server serializes _meta: null instead of omitting the field
Status: Server-side bug, NOT Inspector CLI issue
Workaround: None - needs fix in ModelContextProtocol.jl
Symptom: Tools returning EmbeddedResource content fail with MethodError
Cause: Server cannot convert TextResourceContents to Dict for serialization
Status: Server-side bug
Workaround: Avoid EmbeddedResource content type
Previous Issue: reg_dir.jl example returned empty tool/resource/prompt lists
Cause: Julia scoping bug with names() introspection + Julia 1.12 world age semantics
Status: ✅ FIXED - Now uses include() return value instead of module introspection
Verification:
npx @modelcontextprotocol/inspector --cli julia --project=. examples/reg_dir.jl -- --method tools/list
# Returns: 3 tools (gen_2d_array, julia_version, inspect_workspace)
Component File Requirement: Component must be the last expression in the file
See: REG_DIR_BUG_ANALYSIS_AND_FIX.md for technical details
Symptom: Package MbedTLS_jll is required but does not seem to be installed
Cause: Manifest resolved with different Julia version
Workaround: Run Pkg.resolve() before testing (see Prerequisites)
{
"content": [
{
"type": "text",
"text": "Tool result text"
}
],
"is_error": false
}
{
"content": [
{
"type": "text",
"text": "Text content"
},
{
"type": "image",
"data": "base64data",
"mimeType": "image/png"
}
],
"is_error": false
}
{
"contents": [
{
"uri": "scheme://path",
"mimeType": "application/json",
"text": "{\"data\":\"value\"}"
}
]
}
cd /home/kalidke/julia_shared_dev/ModelContextProtocol
# Setup
julia --project -e 'using Pkg; Pkg.resolve()'
# Test
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method tools/call \
--tool-name current_time
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/multi_content_tool.jl \
--method tools/call \
--tool-name flexible_response \
--tool-arg format=both
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method resources/read \
--uri "character-info://harry-potter/birthday"
# List all capabilities
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method tools/list > tools.json
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method resources/list > resources.json
# Test each tool
jq -r '.tools[].name' tools.json | while read tool; do
echo "Testing: $tool"
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method tools/call \
--tool-name "$tool"
done
# Test each resource
jq -r '.resources[].uri' resources.json | while read uri; do
echo "Testing: $uri"
npx @modelcontextprotocol/inspector --cli \
julia --project=. examples/time_server.jl \
--method resources/read \
--uri "$uri"
done
Pkg.resolve() and Pkg.precompile()--tool-arg for tool parameters (repeatable)--prompt-args for prompt parameters (plural, repeatable)--uri for resource URIs# Check dependencies
julia --project -e 'using Pkg; Pkg.status()'
# Resolve dependencies
julia --project -e 'using Pkg; Pkg.resolve()'
# Run with full error output
julia --project examples/server.jl 2>&1 | less
Check you're in the correct directory:
# Verify current directory
pwd
# Verify server file exists
ls -la examples/server.jl
# Run from project root
cd /path/to/project
npx @modelcontextprotocol/inspector --cli julia --project=. examples/server.jl ...
# Find and kill existing server
ps aux | grep "julia.*server.jl"
kill <PID>
# Or use different port in server code
Based on testing with ModelContextProtocol.jl:
Success Rate: 70% (7/10 operations working)
MCP_INSPECTOR_TESTING_REPORT.md in project rootxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience