mirror of
https://github.com/hanzoai/mcp.git
synced 2026-10-15 12:30:12 +00:00
## Core Implementation - Unified search engine with strategy pattern for extensible search types - Full OpenAI MCP specification compliance for search and fetch tools - Multi-modal search strategies: Symbol, AST, Vector, Text, and File search - Automatic strategy selection based on query characteristics ## Security & Remote Access - Secure ngrok tunnel integration with automatic detection - Multi-method authentication (Bearer token, API keys, JWT) - Post-quantum TLS configuration support - Rate limiting and CORS protection - Access logging and monitoring - Only exposes files when ngrok credentials are present ## Testing & CI - 102 tests with 85% coverage on critical paths - GitHub Actions CI workflow for automated testing - Node.js 18.x and 20.x compatibility testing - Coverage reporting to Codecov - Security audit checks ## Documentation - Comprehensive documentation in LLM.md - Security guide in docs/SECURITY.md - .npmrc excluded from repository for security This implementation provides a production-ready search system for AI tools like ChatGPT and Claude Desktop.
75 lines
2.3 KiB
TypeScript
75 lines
2.3 KiB
TypeScript
#!/usr/bin/env ts-node
|
|
|
|
/**
|
|
* Quick Start Example - Basic MCP Test Suite Usage
|
|
*/
|
|
|
|
import { runMCPTestSuite, quickTest } from '../src/index.js';
|
|
|
|
async function main() {
|
|
console.log('š MCP Test Suite Quick Start Examples\n');
|
|
|
|
try {
|
|
// Example 1: Quick test with TypeScript implementation
|
|
console.log('1. Running quick test (core tools only)...');
|
|
const quickResults = await quickTest({
|
|
implementation: 'typescript',
|
|
categories: ['files', 'shell'],
|
|
verbose: false
|
|
});
|
|
|
|
console.log(`ā
Quick test completed: ${quickResults.passedTests}/${quickResults.totalTests} passed\n`);
|
|
|
|
// Example 2: Full test suite with custom configuration
|
|
console.log('2. Running custom test suite...');
|
|
const customResults = await runMCPTestSuite({
|
|
implementations: [
|
|
{
|
|
id: 'typescript-custom',
|
|
name: 'TypeScript Custom Test',
|
|
language: 'typescript',
|
|
command: 'node',
|
|
args: ['../dist/cli.js', 'serve'],
|
|
enabled: true,
|
|
expectedCategories: ['files', 'search', 'shell'],
|
|
expectedToolCount: 15
|
|
}
|
|
],
|
|
testTimeout: 15000,
|
|
parallel: {
|
|
maxConcurrentImplementations: 1,
|
|
maxConcurrentTestsPerImpl: 2
|
|
},
|
|
output: {
|
|
resultsDir: './example-results',
|
|
verbose: true,
|
|
generateHtmlReport: true,
|
|
generateJsonReport: true
|
|
}
|
|
});
|
|
|
|
console.log('š Custom test results:');
|
|
console.log(`Total tests: ${customResults.totalTests}`);
|
|
console.log(`Passed: ${customResults.passedTests}`);
|
|
console.log(`Failed: ${customResults.failedTests}`);
|
|
console.log(`Success rate: ${((customResults.passedTests / customResults.totalTests) * 100).toFixed(1)}%`);
|
|
|
|
// Example 3: Implementation comparison
|
|
if (customResults.implementations.length > 1) {
|
|
console.log('\nš Implementation Comparison:');
|
|
for (const impl of customResults.implementations) {
|
|
const stats = customResults.summary[impl];
|
|
const rate = ((stats.passed / stats.total) * 100).toFixed(1);
|
|
console.log(` ${impl}: ${stats.passed}/${stats.total} (${rate}%)`);
|
|
}
|
|
}
|
|
|
|
} catch (error) {
|
|
console.error('ā Test failed:', error);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
main();
|
|
} |