Skip to main content
Glama
JackXuyi

Current operating environment

getSshPublicKey

Retrieve the SSH public key for the current user to configure secure remote access and authentication.

Instructions

获取当前用户的 SSH 公钥

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler implementation for the getSshPublicKey tool. It lists all .pub files in the user's ~/.ssh directory, reads their contents, and returns the public keys 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 list of available tools, including its name, description, and empty input schema.
    { name: "getSshPublicKey", description: "获取当前用户的 SSH 公钥", inputSchema: { type: "object", properties: {}, required: [] } },
  • Input schema for the getSshPublicKey tool, which expects no parameters (empty object).
    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