Skip to main content
This recipe is a minimal Python project that authenticates against the Glide MCP gateway using httpx and python-jose, calls accounts.balance, and initiates a payment. Audience: Python engineers who want a typed, runnable baseline before wiring Glide into an existing agent or automation pipeline.

Prerequisites

  • Python 3.11+.
  • pip or a virtualenv manager (uv recommended).
  • Glide running locally per the main quickstart, or access to a hosted instance.
  • MCP_TOKEN_VERIFIER_DEV_SECRET set in your shell or .env.

Steps

1. Clone the example

2. Install dependencies

requirements.txt:

3. Set environment variables

4. Review the auth module

src/auth.py mints a short-lived HS256 JWT for dev. In production, replace it with an httpx client_credentials call against your Ory Hydra endpoint.

5. Review the RPC client

src/rpc.py wraps a single synchronous httpx.post call. It raises GlideRPCError on JSON-RPC errors, preserving the code and data fields so callers can distinguish policy rejections (-32003) from 5xx errors.

6. Run the example

src/main.py checks the gateway health, calls accounts.balance, then calls payments.initiate with a $2.00 test payment:

Run it

Expected output:

Extend it

  • Wrap main.py in a FastAPI route for a payment-initiation microservice.
  • Replace the dev HMAC token with a production Ory client_credentials grant by editing src/auth.py.
  • Add pydantic models for Receipt and validate the response to catch schema drift early.
  • Wire audit.stream into a Kafka producer to feed a downstream event bus.
  • Use httpx.AsyncClient and asyncio for concurrent multi-account balance checks.

Source

github.com/darshanbathija/axtior-neobank/tree/main/examples/python-quickstart

Reading list