This guide explains how to test your MCP server to ensure it works correctly with MCP clients.
-
Build the server:
npm run build
-
Set your API key:
export SCHEMATIC_API_KEY="your-api-key-here"
Run the included test client:
npm test
# or
npm run testThis will:
- ✅ Connect to the MCP server
- ✅ List all available tools
- ✅ Validate tool schemas
- ✅ Test a tool call (if API key is valid)
You can test the MCP protocol directly using JSON-RPC messages:
# Start the server
node dist/index.js
# In another terminal, send MCP messages via stdin
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | node dist/index.jsCursor also supports MCP servers! See CURSOR_SETUP.md for detailed instructions.
Quick setup:
- Add to Cursor's MCP config (usually at
~/Library/Application Support/Cursor/User/globalStorage/mcp.jsonon macOS) - Use the same configuration format as Claude Desktop
- Restart Cursor and test
This is the most important test - it validates your server works with actual MCP clients.
-
Open or create the config file:
open ~/Library/Application\ Support/Claude/claude_desktop_config.json
-
Add your server configuration:
{ "mcpServers": { "schematic": { "command": "node", "args": ["/absolute/path/to/schematic-mcp/dist/index.js"], "env": { "SCHEMATIC_API_KEY": "your-api-key-here" } } } } -
Restart Claude Desktop
-
In Claude Desktop, you should see your tools available. Try asking:
- "What tools do you have for Schematic?"
- "List all my plans"
- "What plan is company X on?"
- Linux:
~/.config/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
You can use web-based MCP testing tools:
- MCPcat (https://mcpcat.io) - Web-based MCP server inspector
- MCP Playground - If available in the MCP ecosystem
Your server should:
- ✅ Respond to
initialize- Handled by the SDK automatically - ✅ Respond to
tools/list- Returns all available tools - ✅ Respond to
tools/call- Executes tools and returns results - ✅ Use correct JSON-RPC format - The SDK handles this
- ✅ Handle errors properly - Using
McpErrorfrom the SDK - ✅ Use stdio transport - Correct for MCP servers
Solution:
- Use absolute paths in the config file
- Ensure the path points to
dist/index.js(notsrc/index.ts) - Check that
npm run buildcompleted successfully
Solution:
- Set
SCHEMATIC_API_KEYin theenvsection of Claude Desktop config - Or use the config file at
~/.schematic-mcp/config.json
Solution:
- Check that the server started successfully (look for "Schematic MCP server running on stdio" in logs)
- Verify the tool name matches exactly (case-sensitive)
- Check Claude Desktop logs for errors
Solution:
- Verify the tool's
inputSchemamatches what you're sending - Check that required fields are provided
- Ensure data types match (string vs number, etc.)
Before deploying, verify:
- Server builds without errors (
npm run build) - Test script passes (
npm test) - All tools appear in
tools/listresponse - Tool schemas are valid JSON Schema
- Server connects to Claude Desktop
- Tools can be called from Claude Desktop
- Error handling works (test with invalid inputs)
- API key authentication works
The server logs to stderr (which is correct for MCP). To see logs:
- In Claude Desktop: Check the application logs
- Manual testing: Redirect stderr to see output:
node dist/index.js 2>&1
You can test individual tools by calling them directly:
// In test-client.ts, add:
const result = await client.callTool({
name: "get_company",
arguments: {
companyName: "Test Company"
}
});
console.log(result);Once testing passes:
- ✅ Document any tool-specific requirements
- ✅ Add error handling for edge cases
- ✅ Consider adding more tools based on feedback
- ✅ Publish to npm (if making it public)