Testing Integration
Verify that your MCP server works correctly with Claude Desktop.
Verifying Server Connection
After configuring your server and restarting Claude Desktop, you should verify that the connection is working properly.
Check Server Status
To verify your MCP server is connected, open Claude Desktop's settings and look for the MCP or Developer section. You should see your configured servers listed with their connection status.
The easiest way to verify your server is working: just ask Claude to use one of your tools! If the server is connected, Claude will be able to call the tool. If not, Claude will tell you it doesn't have access to that capability.
View Available Tools
When your MCP server is connected, Claude can see and use your tools. You can ask Claude "What tools do you have available?" to see a list:
Available Tools:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
mcp-server
├── echo
│ └── Echo back a message
├── get_time
│ └── Get current server time
└── add_numbers
└── Add two numbers
Test with a Simple Query
Ask Claude something that requires using your tool. Claude will automatically decide when to use MCP tools:
You: "What's 125 plus 375?"
[Claude thinks: This is a calculation. I have an 'add_numbers'
tool from my MCP server. Let me use it.]
Claude: I'll calculate that for you.
[Tool call: add_numbers]
[Arguments: {"a": 125, "b": 375}]
[Result: "125 + 375 = 500"]
Claude: 125 plus 375 equals 500.
Test Multiple Tools
If your server provides multiple tools, test each one:
# Tool 1: add_numbers
You: "What's 42 times 3? Oh wait, can you add 99 and 1?"
# Tool 2: echo
You: "Can you echo 'Hello, MCP!' back to me?"
# Tool 3: get_time
You: "What time is it on the server?"
Test Resources (If Available)
If your server exposes resources, Claude can read them when relevant:
You: "Can you read the project README?"
Claude: Let me check the available resources from the file server.
[Resource read: file://readme]
Claude: Here's what the README contains:
# My MCP Project
This is an example MCP server built following the MCP Learning Guide...
Test Prompts (If Available)
If your server provides prompts, you can ask Claude to use them:
You: "Use the code-review prompt for this Python function"
[Prompt: code-review]
[Arguments: {"code": "def add(a, b): return a + b", "language": "python"}]
Claude: [Generates code review based on prompt template]
Expected Behavior
Here's what successful integration looks like:
| Scenario | Expected Behavior |
|---|---|
| Claude Desktop starts | Server process is launched, handshake completes |
| Query needs tool | Claude automatically calls the appropriate tool |
| Tool succeeds | Result incorporated into Claude's response |
| Tool fails | Error message shown, Claude explains the issue |
| Claude Desktop closes | Server process is terminated cleanly |
Common Test Scenarios
Run through these scenarios to fully test your integration:
Test Checklist:
□ Basic tool call
"What's 15 plus 27?"
□ Tool with multiple parameters
"Add 100 and 250 together"
□ Different tools
"Echo 'Hello world' and then tell me the time"
□ Invalid input handling
"Add the number five to banana" (should handle gracefully)
□ Multiple sequential calls
"Add 1+2, then 3+4, then 5+6"
□ Error recovery
[Stop your server, try a query, restart, try again]
□ Long conversation with tools
[Have a 10+ message conversation using tools]
Claude doesn't always show which tool it's using in the chat. This is by design for a natural conversation experience. However, you can ask "What tools did you use?" and Claude will explain.
Monitoring Tool Usage
Add logging to your server to monitor tool calls:
import sys
import json
from datetime import datetime
def log(message: str):
"""Log to stderr (doesn't interfere with STDIO protocol)."""
timestamp = datetime.now().isoformat()
print(f"[{timestamp}] {message}", file=sys.stderr)
def handle_tool_call(name: str, arguments: dict):
"""Handle a tool call with logging."""
log(f"Tool called: {name}")
log(f"Arguments: {json.dumps(arguments)}")
# Your tool implementation
result = execute_tool(name, arguments)
log(f"Result: {json.dumps(result)[:100]}...")
return result
View logs by running your server manually in a terminal while Claude Desktop is also running (though they'll conflict - this is better for debugging specific issues).
Success Criteria
Your integration is working correctly when:
- Your server appears in Claude Desktop settings as connected
- Claude can list your tools when asked
- Claude uses your tools when appropriate
- Tool results are incorporated into responses
- Errors are handled gracefully
- The server stays running throughout the session
If you've made it this far, you have successfully integrated your MCP server with Claude Desktop. Your custom tools are now available to Claude!
What's Next?
Things don't always work perfectly the first time. In the next step, we'll cover common issues and debugging techniques for when things go wrong.