examples/mcp: add HashLock OTC remote MCP example#2932
Closed
BarisSozen wants to merge 2 commits intoopenai:mainfrom
Closed
examples/mcp: add HashLock OTC remote MCP example#2932BarisSozen wants to merge 2 commits intoopenai:mainfrom
BarisSozen wants to merge 2 commits intoopenai:mainfrom
Conversation
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.
Member
|
Thanks for sharing this. While we don't include this example in this repo, please feel fee to share it in your own repo. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ofstreamable_http_remote_exampleexamples/mcp/hashlock_example/README.md— setup + token instructionsSafety 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_TOKENset:python examples/mcp/hashlock_example/main.py # -> streams quotes from the RFQChecklist
examples/mcp/directoryopenai-agentsand stdlibHASHLOCK_ACCESS_TOKENis set