register
Connect this Claude AI instance to the IPC communication system by providing a unique identifier for inter-process messaging and coordination.
Instructions
Register this Claude instance with the IPC system
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instance_id | Yes | Unique identifier for this instance (e.g., 'wsl1', 'wsl2') |
Implementation Reference
- src/claude_ipc_server.py:1084-1105 (handler)The handler for the 'register' tool in the MCP call_tool function. It computes an auth token if a shared secret is set, sends a registration request to the internal MessageBroker via BrokerClient, stores the returned session token globally for subsequent tool calls, and returns the broker's response.# Calculate auth token instance_id = arguments["instance_id"] shared_secret = os.environ.get("IPC_SHARED_SECRET", "") auth_token = "" if shared_secret: import hashlib auth_token = hashlib.sha256(f"{instance_id}:{shared_secret}".encode()).hexdigest() response = BrokerClient.send_request({ "action": "register", "instance_id": instance_id, "auth_token": auth_token }) # Store session token for this MCP instance if response.get("status") == "ok" and response.get("session_token"): # Store in a global variable for this MCP session global current_session_token, current_instance_id current_session_token = response["session_token"] current_instance_id = instance_id return [TextContent(type="text", text=json.dumps(response, indent=2))]
- src/claude_ipc_server.py:909-922 (schema)The JSON schema definition for the 'register' tool's input parameters, specifying that 'instance_id' is a required string.Tool( name="register", description="Register this Claude instance with the IPC system", inputSchema={ "type": "object", "properties": { "instance_id": { "type": "string", "description": "Unique identifier for this instance (e.g., 'wsl1', 'wsl2')" } }, "required": ["instance_id"] } ),
- src/claude_ipc_server.py:906-1078 (registration)The MCP tool registration for 'register' occurs in the list_tools() function, which returns a list of Tool objects including the 'register' tool to the MCP protocol.async def list_tools() -> List[Tool]: """List available tools""" return [ Tool( name="register", description="Register this Claude instance with the IPC system", inputSchema={ "type": "object", "properties": { "instance_id": { "type": "string", "description": "Unique identifier for this instance (e.g., 'wsl1', 'wsl2')" } }, "required": ["instance_id"] } ), Tool( name="send", description="Send a message to another Claude instance", inputSchema={ "type": "object", "properties": { "from_id": { "type": "string", "description": "Your instance ID" }, "to_id": { "type": "string", "description": "Target instance ID" }, "content": { "type": "string", "description": "Message content" }, "data": { "type": "object", "description": "Optional structured data to send" } }, "required": ["from_id", "to_id", "content"] } ), Tool( name="broadcast", description="Broadcast a message to all other Claude instances", inputSchema={ "type": "object", "properties": { "from_id": { "type": "string", "description": "Your instance ID" }, "content": { "type": "string", "description": "Message content" }, "data": { "type": "object", "description": "Optional structured data" } }, "required": ["from_id", "content"] } ), Tool( name="check", description="Check for new messages", inputSchema={ "type": "object", "properties": { "instance_id": { "type": "string", "description": "Your instance ID" } }, "required": ["instance_id"] } ), Tool( name="list_instances", description="List all active Claude instances", inputSchema={ "type": "object", "properties": {} } ), Tool( name="share_file", description="Share file content with another instance", inputSchema={ "type": "object", "properties": { "from_id": { "type": "string", "description": "Your instance ID" }, "to_id": { "type": "string", "description": "Target instance ID" }, "filepath": { "type": "string", "description": "Path to file to share" }, "description": { "type": "string", "description": "Description of the file" } }, "required": ["from_id", "to_id", "filepath"] } ), Tool( name="share_command", description="Execute a command and share output with another instance", inputSchema={ "type": "object", "properties": { "from_id": { "type": "string", "description": "Your instance ID" }, "to_id": { "type": "string", "description": "Target instance ID" }, "command": { "type": "string", "description": "Command to execute" }, "description": { "type": "string", "description": "Description of what this command does" } }, "required": ["from_id", "to_id", "command"] } ), Tool( name="rename", description="Rename your instance ID (rate limited to once per hour)", inputSchema={ "type": "object", "properties": { "old_id": { "type": "string", "description": "Your current instance ID" }, "new_id": { "type": "string", "description": "The new instance ID you want" } }, "required": ["old_id", "new_id"] } ), Tool( name="auto_process", description="Automatically check and process IPC messages (for use with auto-check feature)", inputSchema={ "type": "object", "properties": { "instance_id": { "type": "string", "description": "Your instance ID" } }, "required": ["instance_id"] } ) ]