MCPcopy Create free account
hub / github.com/agentrpc/agentrpc / __init__

Method __init__

sdk-python/src/agentrpc/http_client.py:11–36  ·  view source on GitHub ↗

Initialize the HTTP client. Args: endpoint: The API endpoint. api_secret: The API secret key.

(self, endpoint: str, api_secret: str)

Source from the content-addressed store, hash-verified

9 """HTTP client for making requests to the AgentRPC API."""
10
11 def __init__(self, endpoint: str, api_secret: str):
12 """Initialize the HTTP client.
13
14 Args:
15 endpoint: The API endpoint.
16 api_secret: The API secret key.
17 """
18 self.endpoint = endpoint.rstrip("/")
19 self.api_secret = api_secret
20 self.cluster_id = None
21 self.machine_id = None
22
23 # Get SDK version from package metadata
24 try:
25 sdk_version = version("agentrpc")
26 except PackageNotFoundError:
27 sdk_version = "unknown"
28
29 # Set standard headers
30 self.headers = {
31 "Content-Type": "application/json",
32 "Authorization": f"Bearer {api_secret}",
33 "x-machine-sdk-version": sdk_version,
34 "x-machine-sdk-language": "python",
35 "x-machine-id": "python",
36 }
37
38 def list_tools(self, params: Dict[str, Any]) -> Dict[str, Any]:
39 """List tools from the AgentRPC API.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected