Skip to main content
Glama

MCP Gemini Server

by bsmi021
createServer.ts1.23 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { registerTools } from "./tools/index.js"; import { logger } from "./utils/index.js"; import { McpClientService } from "./services/mcp/McpClientService.js"; /** * Result object containing the created server and client service instances */ export interface ServerCreationResult { server: McpServer; mcpClientService: McpClientService; } /** * Creates and configures an MCP server instance. * This is the central function for server creation and tool registration. * Note: ConfigurationManager is imported directly by services as needed. * @returns {ServerCreationResult} Object containing the configured MCP server and client service instances */ export function createServer(): ServerCreationResult { logger.info("Creating MCP server instance..."); // Initialize the server const server = new McpServer({ name: "mcp-server", version: "1.0.0", description: "MCP Server based on recommended practices", }); // Register all tools and get the McpClientService instance const mcpClientService = registerTools(server); logger.info("MCP server instance created successfully."); return { server, mcpClientService }; }

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/bsmi021/mcp-gemini-server'

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