PatchOps TypeScript and Python SDKs
First-party SDKs for the public OAuth-protected PatchOps MCP surface. Use them to discover the MCP endpoint, complete OAuth with PKCE, and call tools or resources over JSON-RPC without building the transport layer yourself.
For terminal workflows, install @patchops/cli from npm and authenticate directly against PatchOps with patchops login.
Current packaging
@patchops/cli.sdks/typescript.sdks/python.CLI install
@patchops/cli
Terminal
npm install -g @patchops/cli
patchops login
patchops tools listTypeScript example
OAuth + MCP quickstart
TypeScript
import {
PatchOpsOAuthClient,
PatchOpsMcpClient,
} from "@patchops/sdk";
const oauth = new PatchOpsOAuthClient({
baseUrl: "https://patchops.ai",
});
const auth = await oauth.createAuthorizationRequest({
redirectUri: "http://localhost:8787/callback",
clientName: "My PatchOps App",
});
const mcp = new PatchOpsMcpClient({
baseUrl: "https://patchops.ai",
accessToken,
});
await mcp.initialize();
const tools = await mcp.listTools();Python example
OAuth + MCP quickstart
Python
from patchops_sdk import PatchOpsOAuthClient, PatchOpsMcpClient
oauth = PatchOpsOAuthClient("https://patchops.ai")
auth = oauth.create_authorization_request(
redirect_uri="http://localhost:8787/callback",
client_name="My PatchOps App",
)
mcp = PatchOpsMcpClient(
base_url="https://patchops.ai",
access_token=access_token,
)
initialize = mcp.initialize()
tools = mcp.list_tools()OAuth flow
The SDKs handle discovery, registration, PKCE generation, authorization code exchange, and token refresh against the PatchOps OAuth endpoints.
MCP helpers
Session initialization and JSON-RPC methods are wrapped so you can focus on tools and resources instead of request shaping and session headers.
Recommended use
Use the SDKs for CLIs, local tools, MCP-aware apps, internal portals, or service-to-service workflows that need structured access to the PatchOps MCP surface.