You create an MCP server, but how can you test whether it works as expected? In this blog, you will learn how you can test and debug MCP servers by using MCP Inspector. Enjoy!

1. Introduction

In a previous post, an MCP (Model Context Protocol) server was created using Spring AI. In order to test it, the IntelliJ DevoxxGenie plugin was misused for this purpose. In a follow-up post, an MCP client was created which also helped with testing the MCP server. But there is a better way in order to test the MCP server and that is by using MCP Inspector. MCP Inspector offers a web GUI in order to do so.

Sources used in this blog are available at GitHub.

2. Prerequisites

Prerequisites for reading this blog are:

3. Installation

Installation of MCP Inspector is quite easy, you can use npx for that purpose. With npx you can run an npm module without actually installing it.

npx @modelcontextprotocol/inspector

In the console output, you will see something like the following.

Starting MCP inspector...
Proxy server listening on 127.0.0.1:6277
Session token: 237c12e3d35a5ec7de779c3d5af92d2e747ebf41a01d883d16974f07113781fc
Use this token to authenticate requests or set DANGEROUSLY_OMIT_AUTH=true to disable auth

Open inspector with token pre-filled:
   http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=237c12e3d35a5ec7de779c3d5af92d2e747ebf41a01d883d16974f07113781fc

MCP Inspector is up and running at http://127.0.0.1:6274 

You notice two links, one with the MCP_PROXY_AUTH_TOKEN pre-filled, and one without. I suggest that you use the one with the pre-filled token, otherwise you will need to enter it yourself.

The page looks as follows.

4. Test MCP Server STDIO

Let’s test the MCP server created in a previous post. Clone the repository and build the jar-file.

mvn clean verify

Fill in the required arguments in MCP Inspector. Do note that you need to use full paths for the command and arguments.

  • Command: /<java installation directory>/bin/java
  • Arguments: -jar /home/<project directory>/mymcpserverplanet/server/target/mymcpserverplanet-0.0.1-SNAPSHOT.jar

Click the Connect button. The connection with the MCP server is established and several tabs become available.

Navigate to the Tools tab.

Click the List Tools button. The available tools for this MCP server are shown.

Click the get_songs tool and on the right you will see a button in order to invoke it. Only the button is shown because this tool does not have any arguments.

Click the Run Tool button. The results are shown in the right panel. Now you can verify whether this is according to your expectations.

Let’s try a tool which requires an argument. Click the search_song tool. As you can see now, this tool takes a title as an argument.

Fill in Lament as a title.

Click the Run Tool button and the result is displayed.

5. Test MCP Server SSE

The previous example used STDIO as transport type. You also have HTTP SSE as transport type, although it is at the moment of writing almost deprecated in favor of streaming HTTP.

Change the following settings:

Disconnect and Connect again. Navigate to the Tools tab and click the List Tools button. The available tools are shown, just like the MCP server with STDIO transport type.

6. Conclusion

MCP Inspector is a very convenient way in order to test MCP servers. It has an easy-to-use interface and I am definitely going to use it for testing MCP servers.


Discover more from

Subscribe to get the latest posts sent to your email.