M2M MCP SSH Key Server

Key Management API

This service provides an API for SSH key registration and management between M2M MCP clients and servers. Use these endpoints to register client keys and retrieve the server's public key.

API Endpoints

POST /register

Register a client public SSH key with the server to allow future SSH connections.

Request

Content-Type: application/json

{
    "client_pub_key": "ssh-rsa AAAAB3NzaC1yc2E... client-name"
}

Response

Success:

{
    "status": "success"
}

Error:

{
    "error": "Failed to register key"
}

Status Codes

200 Success
400 Bad Request - Invalid key format or missing field
415 Unsupported Media Type - Content-Type must be application/json
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error

GET /server_pub_key

Retrieve the server's public SSH key to set up trusted connections.

Response

{
    "server_pub_key": "ssh-rsa AAAAB3NzaC1yc2E... server@hostname"
}

Status Codes

200 Success
429 Too Many Requests - Rate limit exceeded

GET /health

Check the health status of the API server.

Response

{
    "status": "healthy"
}

Status Codes

200 Success
429 Too Many Requests - Rate limit exceeded