Skip to content

Repository files navigation

FirstOps Python SDK

Secure MCP proxy sidecar with DPoP authentication for AI agents.

FirstOps secures agent-to-tool connections. This SDK runs a lightweight local proxy that transparently adds DPoP-signed authentication headers to every MCP request your agent makes — no changes to your agent code required.

Install

pip install firstops

Quick Start

importfirstops# Start the proxy sidecar (runs in background thread)firstops.init(
agent_id="your-agent-id",
private_key_pem=open("agent-key.pem").read(),
)
# Point your MCP client at localhost:9322 instead of the remote server.# The proxy handles auth transparently — DPoP proofs, bearer tokens, SSE streaming.# When done:firstops.shutdown()

What happens

  1. firstops.init() starts a local HTTP proxy on 127.0.0.1:9322
  2. Your MCP client sends requests to localhost:9322/mcp/...
  3. The proxy signs each request with a DPoP proof (RFC 9449, ES256)
  4. The signed request is forwarded to the FirstOps gateway
  5. SSE streaming responses are proxied back with URLs rewritten to localhost

Configuration

ParameterDefaultDescription
agent_idrequiredYour agent's principal ID
private_key_pemrequiredEC P-256 private key (PEM format)
port9322Local proxy port
gateway_urlhttps://api.firstops.aiFirstOps gateway URL

Requirements

  • Python 3.10+
  • Dependencies: cryptography, httpx

Development

git clone https://github.com/firstops-dev/firstops-python.git
cd firstops-python
python -m venv .venv &&source .venv/bin/activate
pip install -e ".[dev]"
pytest

License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages