aip_register
Register a new AI agent identity with the Agent Identity Protocol by specifying platform and username to enable verification and secure communication.
Instructions
Register a new AIP identity for your agent.
Args: platform: Platform name (e.g. 'github', 'moltbook', 'discord') username: Your username on that platform
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| platform | Yes | ||
| username | Yes |
Implementation Reference
- aip_mcp_server/server.py:285-320 (handler)Implementation of the aip_register tool which registers a new identity using AIPClient and saves credentials to disk.
@mcp.tool() def aip_register(platform: str, username: str) -> dict: """Register a new AIP identity for your agent. Args: platform: Platform name (e.g. 'github', 'moltbook', 'discord') username: Your username on that platform """ from aip_identity.client import AIPClient # Check if credentials already exist existing = _find_credentials() if existing: return { "already_registered": True, "did": existing["did"], "message": "You already have an AIP identity. Use aip_whoami() to see it.", } try: client = AIPClient.register(platform, username, service_url=_SERVICE_URL) except Exception as e: return {"registered": False, "error": str(e)} # Save credentials creds_path = Path.home() / ".aip" / "credentials.json" creds_path.parent.mkdir(parents=True, exist_ok=True) client.save(str(creds_path)) creds_path.chmod(0o600) return { "registered": True, "did": client.did, "credentials_path": str(creds_path), "message": "Identity registered and credentials saved.", }