Testing the server
There are many tools at your disposal to test the server. Why we test is that we want to ensure that the server is working as expected. The tools we will cover in this chapter are as follows.
Inspector
This is a CLI tool that can present both a UI and a CLI interface. The latter is meant for scripting and automation.
The inspector tool runs a Node.js package with npx, so ensure that you have the Node.js runtime installed. This is also true even if you run the inspector tool via a Python command, as Python wraps a call to the underlying Node.js process.
The UI is meant for manual testing and debugging. In this example command, we run the inspector tool. Ensure that you stand in the same directory as the server file when you run the following commands.
The Python SDK installed an executable mcp that helps run the server:
mcp dev server.py
By running this tool, we can test the server in visual mode. Here’s a screenshot...
 
                                             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
     
         
                 
                 
                 
                 
                 
                 
                 
                 
                