Agent SDK
Programmatic access to Pharos for agent creators.
Enable agents to search, install, manage MCP servers, and even publish on the user's behalf. The Agent SDK gives your agent a typed, security-checked path into the Pharos registry with no CLI in the loop. Available in Python and TypeScript, the SDK shares one API surface so your integration code reads the same on either side.
Key features
Search & Discovery
The search() method queries the registry with text, filters, and a configurable limit. Results are ranked and ready to connect.
client.search("filesystem")Connect & Approve
connect_and_approve() handles the full approval flow: transport setup, capability negotiation, and explicit user consent in one call.
client.connect_and_approve(server, capabilities=["tools"])Consent Management
revoke() and check_scope() give you granular control over what an agent may do on the user's behalf, per server.
client.check_scope("filesystem", "read")Security Layer
Blocklist checking, key pinning, and risk assessment run automatically before any connection. High-risk operations require explicit approval.
client.revoke("untrusted-server")Dual Language
The Python SDK (pharos_discovery) and the TypeScript SDK (packages/typescript/) share one API surface. Pick the one that fits your stack.
pip install pharos_discoveryOAuth Handler
Full OAuth flow support for remote MCP servers. The SDK opens the browser, polls for the callback, and stores the token for you.
client.connect_and_approve(remote_server)Quick example
from pharos_discovery import PharosClient
client = PharosClient()
results = client.search("filesystem")
server = results[0]
client.connect_and_approve(server, capabilities=["tools"])import { PharosClient } from "@pharos/sdk";
const client = new PharosClient();
const results = await client.search("filesystem");
const server = results[0];
await client.connectAndApprove(server, { capabilities: ["tools"] });Built on the SDK
The Pharos MCP Server is itself built on the Agent SDK, proving the SDK is production-ready. If it runs the hub, it runs your agent.
See the Pharos MCP Server