Cursusinhoud
Creating Custom AI Agents
Creating Custom AI Agents
Testing
Now that your MCP server is up and running, it's time to test it. Both manually and through an AI interface like Claude Desktop. In this chapter, you'll learn how to connect to your server, send structured requests, and verify that the server responds correctly.
Before anything else, make sure your server script is running. In your terminal, navigate to the folder where the server file is located (e.g., excel_mcp_server.py) and run:
terminal.h
You can test the server manually using the curl command-line tool. This simulates how Claude or another client would interact with your server.
curl.h
Make sure data.xlsx is in the same directory as the script (or update the path accordingly). You should receive a JSON response like:
response.json
If you see this, your server is working as expected. Claude Desktop uses the Model Context Protocol (MCP) to discover and call local tools. To add a custom MCP server, you must edit the Claude Desktop config file and implement the server’s JSON-RPC interface.
claude_desktop_config.json
Once you've added your server to the Claude config file and restarted Claude Desktop, it will automatically try to launch the server and connect to it via MCP. If everything is working correctly, Claude will:
Start your Python script (via the "command" and "args" values in the config);
Send a tools/list request to discover what functions your server supports;
Show your tool under the "hammer" icon in the Claude chat window.
This lets Claude know what inputs your tool expects, so it can call it when the user makes a request. If Claude decides your tool matches the user's intent, it will send something like:
request.json
Your server should handle the call and return a result. This allows the AI to interact with external applications.
Bedankt voor je feedback!