Skip to main content
Glama

Brave Search MCP Server

server.ts2.31 kB
/** * Forensics Connection MCP Server implementation */ import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js'; import { AnalyzeConnectionsTool } from './tools/index.js'; import { AnalysisRequest } from './types.js'; import { Config } from './config.js'; /** * Forensics Connection MCP Server */ export class ForensicsServer { private server: Server; private analyzeConnectionsTool: AnalyzeConnectionsTool; private config: Config; constructor(config: Config) { this.config = config; this.server = new Server( { name: 'forensics-connections', version: '0.1.0', }, { capabilities: { tools: {}, }, } ); this.analyzeConnectionsTool = new AnalyzeConnectionsTool(config); this.setupToolHandlers(); } /** * Get the underlying MCP Server instance */ getServer(): Server { return this.server; } /** * Setup tool request handlers */ private setupToolHandlers(): void { // List available tools this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ this.analyzeConnectionsTool.getDefinition(), ], })); // Handle tool calls this.server.setRequestHandler(CallToolRequestSchema, async (request) => { switch (request.params.name) { case 'analyze_connections': return this.analyzeConnectionsTool.execute( request.params.arguments as unknown as AnalysisRequest ); default: throw new Error(`Unknown tool: ${request.params.name}`); } }); } /** * Test server health */ async healthCheck(): Promise<boolean> { try { // Test OpenAI connection through the tool const testRequest: AnalysisRequest = { evidence: 'Test evidence with John Smith and Jane Doe mentioned together.', options: { includeVisualization: false, minimumConnectionStrength: 1, } }; const result = await this.analyzeConnectionsTool.execute(testRequest); return !result.isError; } catch (error) { console.error('Health check failed:', error); return false; } } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/YC-Agents-Hackathon/mcp-forensics'

If you have feedback or need assistance with the MCP directory API, please join our Discord server