We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/austinmoody/things-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
test-search.jsβ’2.27 KiB
#!/usr/bin/env node
/**
* Manual Test Script for Things MCP Server - Search
*
* This script demonstrates how to test the search functionality
* directly using our Things client.
*
* Run this script with: node examples/test-search.js
*/
import { ThingsClient } from '../src/things-client.js';
/**
* Test the search functionality
*/
async function testSearch() {
console.log('π§ͺ Testing Things MCP Server - Search');
console.log('=====================================');
try {
// Create a new Things client instance
console.log('π± Creating Things client...');
const thingsClient = new ThingsClient();
// Check if Things is available
console.log('π Checking if Things app is available...');
const isAvailable = thingsClient.isThingsAvailable();
if (!isAvailable) {
console.error('β Things app is not available on this system');
console.log('π‘ Make sure you are running this on macOS with Things installed');
process.exit(1);
}
console.log('β Things app appears to be available');
// Test search functionality
console.log('π Testing search command...');
const searchQuery = 'test';
const result = await thingsClient.search(searchQuery);
if (result) {
console.log('β Successfully executed search command');
console.log(`π Searched for: "${searchQuery}"`);
console.log('π± Things app should now be showing search results');
} else {
console.error('β Search command failed');
process.exit(1);
}
} catch (error) {
console.error('π₯ Test failed with error:', error.message);
console.log('\nπ§ Troubleshooting tips:');
console.log('- Make sure you are running on macOS');
console.log('- Make sure Things app is installed');
console.log('- Verify Things app can be opened manually');
console.log('- Try a different search query');
process.exit(1);
}
console.log('\nπ Test completed successfully!');
console.log('π‘ Check Things app to see the search results');
}
/**
* Run the test if this script is executed directly
*/
if (import.meta.url === `file://${process.argv[1]}`) {
testSearch().catch((error) => {
console.error('Unhandled error:', error);
process.exit(1);
});
}