Skip to content

examples/mcp: add HashLock OTC remote MCP example#2932

Closed
BarisSozen wants to merge 2 commits intoopenai:mainfrom
BarisSozen:feat/hashlock-otc-example
Closed

examples/mcp: add HashLock OTC remote MCP example#2932
BarisSozen wants to merge 2 commits intoopenai:mainfrom
BarisSozen:feat/hashlock-otc-example

Conversation

@BarisSozen
Copy link
Copy Markdown

What

Adds a minimal, self-contained example that connects the Agents SDK to HashLock OTC's remote MCP server (https://mcp.hashlock.markets/mcp) over Streamable HTTP. The agent requests an OTC crypto quote and streams quotes back from institutional market makers.

Why

HashLock exposes atomic HTLC settlement via MCP. Including it alongside the existing HTTP examples gives developers a realistic non-toy integration to copy from.

Scope

  • examples/mcp/hashlock_example/main.py — ~55 LOC, mirrors the style of streamable_http_remote_example
  • examples/mcp/hashlock_example/README.md — setup + token instructions
  • No library code changes

Safety note

The example is explicit that on-chain HTLC writes should not be triggered from the agent loop. That matches HashLock's own design: settlement signatures happen out-of-band in the user's browser wallet.

How I tested

Locally with HASHLOCK_ACCESS_TOKEN set:

python examples/mcp/hashlock_example/main.py
# -> streams quotes from the RFQ

Checklist

  • Added to examples/mcp/ directory
  • README included
  • No new dependencies beyond openai-agents and stdlib
  • Works out of the box once HASHLOCK_ACCESS_TOKEN is set

Connects the Agents SDK to HashLock OTC's remote MCP server (mcp.hashlock.markets/mcp) over Streamable HTTP. Demonstrates passing a bearer token via headers and requesting an OTC crypto quote. On-chain HTLC writes are intentionally kept out of the agent loop.
Added a README for the HashLock OTC example, detailing setup and usage.
@seratch
Copy link
Copy Markdown
Member

seratch commented Apr 17, 2026

Thanks for sharing this. While we don't include this example in this repo, please feel fee to share it in your own repo.

@seratch seratch closed this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants