You're recommended to install uv but it's not a must, see instructions
python -m venv venvvenv\Scrips\activatepip install "mcp[cli]"mcp run server.pyWith the server running in one terminal, open another terminal and run the following command:
mcp dev server.pyThis should start a web server with a visual interface allowing you to test the sample.
Once the server is connected:
- try listing tools and run
add, with args 2 and 4, you should see 6 in the result. - go to resources and resource template and call get_greeting, type in a name and you should see a greeting with the name you provided.
The inspector you ran is actually a Node.js app and mcp dev is a wrapper around it.
You can launch it directly in CLI mode by running the following command:
npx @modelcontextprotocol/inspector --cli http://localhost:8000/sse --method tools/listThis will list all the tools available in the server. You should see the following output:
{
"tools": [
{
"name": "add",
"description": "Add two numbers",
"inputSchema": {
"type": "object",
"properties": {
"a": {
"title": "A",
"type": "integer"
},
"b": {
"title": "B",
"type": "integer"
}
},
"required": [
"a",
"b"
],
"title": "addArguments"
}
}
]
}
To invoke a tool type:
npx @modelcontextprotocol/inspector --cli http://localhost:8000/sse --method tools/call --tool-name add --tool-arg a=1 --tool-arg b=2You should see the following output:
{
"content": [
{
"type": "text",
"text": "3"
}
],
"isError": false
}
![!TIP] It's usually a lot faster to run the ispector in CLI mode than in the browser. Read more about the inspector here.