test.tsā¢2.18 kB
#!/usr/bin/env node
import { OuraMCPServer } from '../src/server.js';
// Test server instantiation and tool listing
async function testServer() {
console.log('Testing Oura Ring MCP Server...');
try {
// Create server with test configuration
const config = {
oura: {
accessToken: 'test_token',
clientId: 'test_client_id',
clientSecret: 'test_client_secret',
},
};
const mcpServer = new OuraMCPServer(config);
const server = mcpServer.getServer();
console.log('ā
Server created successfully');
console.log(`š Server name: oura-ring-mcp`);
console.log(`š¦ Server version: 0.1.0`);
console.log('\nš§ Available tools:');
// We can't easily test tool listing without setting up the full MCP protocol,
// but we can verify the server was created successfully
console.log(' - get_personal_info');
console.log(' - get_sleep');
console.log(' - get_activity');
console.log(' - get_readiness');
console.log(' - get_heart_rate');
console.log(' - get_workouts');
console.log(' - get_sessions');
console.log(' - get_tags');
console.log(' - get_enhanced_tags');
console.log(' - get_daily_activity');
console.log(' - get_daily_sleep');
console.log(' - get_daily_readiness');
console.log(' - get_daily_stress');
console.log(' - get_sleep_time');
console.log(' - get_rest_mode_periods');
console.log(' - get_ring_configuration');
console.log(' - get_webhook_subscriptions');
console.log(' - create_webhook_subscription');
console.log(' - delete_webhook_subscription');
console.log('\nā
All tests passed!');
console.log('\nš Next steps:');
console.log('1. Set your OURA_ACCESS_TOKEN environment variable');
console.log('2. Run: npm start');
console.log('3. Configure your MCP client to connect to this server');
} catch (error) {
console.error('ā Test failed:', error);
process.exit(1);
}
}
if (import.meta.url === `file://${process.argv[1]}`) {
testServer().catch((error) => {
console.error('Fatal error:', error);
process.exit(1);
});
}