بنقرة واحدة
mcp-inspector
Test Model Context Protocol (MCP) servers using the MCP Inspector CLI with correct syntax
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Test Model Context Protocol (MCP) servers using the MCP Inspector CLI with correct syntax
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | mcp-inspector |
| description | Test Model Context Protocol (MCP) servers using the MCP Inspector CLI with correct syntax |
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 root