Invite-only.
Connect

Python

Python is the fastest way to glue Dock into an existing pipeline. Two paths: hit the REST API with requests or httpx, or use the official MCP Python SDK for tool-calling.

Client
Python
Stdlib-friendly. Use requests for REST or the MCP SDK for tool-calling.
HTTP JSON-RPC (streamable-http)
Dock MCP
trydock.ai/api/mcp
37 tools · OAuth 2.1 + DCR · Bearer
Auth path
1
Mint a dk_ key in Dock Settings → API keys.
2
Paste it as Authorization: Bearer dk_… in the client config.
3
Client calls Dock MCP directly on every request.

Prerequisites

  • Python 3.10+.
  • requests or httpx for REST, mcp for tool-calling.
  • A Dock dk_ key.
requests · read + write rowspython
import os, requests

API = "https://trydock.ai/api"
H = {"Authorization": f"Bearer {os.environ['DOCK_API_KEY']}"}

# List workspaces
ws = requests.get(f"{API}/workspaces", headers=H).json()

# Append a row
r = requests.post(
    f"{API}/workspaces/content-pipeline/rows",
    headers={**H, "Content-Type": "application/json"},
    json={"data": {"title": "From Python", "status": "drafted"}},
)
r.raise_for_status()
row = r.json()

# Bulk-seal
requests.patch(
    f"{API}/workspaces/content-pipeline/rows/bulk",
    headers={**H, "Content-Type": "application/json"},
    json={"updates": [{"id": row["id"], "data": {"status": "sealed"}}]},
).raise_for_status()
httpx · SSE streampython
import os, httpx

async def stream_events():
    headers = {"Authorization": f"Bearer {os.environ['DOCK_API_KEY']}"}
    url = "https://trydock.ai/api/workspaces/content-pipeline/subscribe"
    async with httpx.AsyncClient(timeout=None) as client:
        async with client.stream("GET", url, headers=headers) as r:
            async for line in r.aiter_lines():
                if line.startswith("data: "):
                    print(line[6:])

Verify

DOCK_API_KEY=dk_live_... python -c "import os, requests; \
  print(requests.get('https://trydock.ai/api/me', \
        headers={'Authorization': f'Bearer {os.environ[\"DOCK_API_KEY\"]}'}).json())"

Troubleshooting

Symptom
Fix
SSL errors on requests
Upgrade certifi: pip install --upgrade certifi.
Wanting typed responses
Dock's OpenAPI spec lives at https://trydock.ai/openapi.json. Generate typed clients with openapi-python-client or similar.

Related