get_server_info
Retrieve server information and available tools from the My First MCP tutorial server for basic utility operations.
Instructions
이 MCP 서버의 정보와 사용 가능한 Tool 목록을 반환합니다.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:161-174 (handler)Core handler function implementing the get_server_info tool logic. Returns a ServerInfo object containing server name, version, description, and list of available tools.export function getServerInfo(): ServerInfo { return { name: "my-first-mcp", version: "1.0.0", description: "MCP 서버 개발 튜토리얼 - 첫 번째 MCP 서버", tools: [ "get_current_time - 현재 시간 조회", "calculate - 사칙연산 계산기", "get_random_number - 랜덤 숫자 생성", "reverse_string - 문자열 뒤집기", "get_server_info - 서버 정보 조회", ], }; }
- src/tools.ts:154-159 (schema)Type definition (schema) for the ServerInfo output returned by the get_server_info handler.export interface ServerInfo { name: string; version: string; description: string; tools: string[]; }
- src/index.ts:244-272 (registration)Registration of the get_server_info tool in the MCP server. Includes empty input schema ({}), description, and thin wrapper handler that formats the output from getServerInfo() as MCP text content response.server.tool( "get_server_info", "이 MCP 서버의 정보와 사용 가능한 Tool 목록을 반환합니다.", {}, async () => { const info = getServerInfo(); const infoText = ` === ${info.name} 서버 정보 === 버전: ${info.version} 설명: ${info.description} 사용 가능한 Tool: ${info.tools.map((t, i) => `${i + 1}. ${t}`).join("\n")} GitHub: https://github.com/dh1789/my-first-mcp `.trim(); return { content: [ { type: "text", text: infoText, }, ], }; } );