Skip to main content
Glama

Current operating environment

getSshPublicKey

Retrieve your SSH public key directly from the current operating environment for secure access and authentication purposes.

Instructions

获取当前用户的 SSH 公钥

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "required": [], "type": "object" }

Implementation Reference

  • Handler implementation for the getSshPublicKey tool. It reads all public key files (*.pub) from the user's ~/.ssh directory and returns their contents as a JSON array.
    case "getSshPublicKey": { const sshKeys: string[] = []; const sshDir = `${os.homedir()}/.ssh`; const keyFiles = fs.readdirSync(sshDir).filter(file => file.endsWith('.pub')); for (const keyFile of keyFiles) { const filePath = `${sshDir}/${keyFile}`; const publicKey = fs.readFileSync(filePath, 'utf8'); sshKeys.push(publicKey); } return { content: [{ type: "text", text: JSON.stringify(sshKeys, null, 2) }] }; }
  • src/index.ts:253-261 (registration)
    Registration of the getSshPublicKey tool in the listTools handler response. Includes name, description, and input schema (empty object).
    { name: "getSshPublicKey", description: "获取当前用户的 SSH 公钥", inputSchema: { type: "object", properties: {}, required: [] } },
  • Input schema definition for the getSshPublicKey tool, which requires no parameters.
    inputSchema: { type: "object", properties: {}, required: [] }

Latest Blog Posts

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/JackXuyi/env-mcp'

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