Skip to content

Agent Skill · version 0.1.0

Download Fensory LangChain MCP Agent Skill

Connect LangChain to the Fensory MCP server with browser OAuth, verify the current tool catalogue and begin with read-only account checks.

Download and review

Download the public file, review every instruction, then place it in the skills directory documented by the compatible client you use. Client-specific paths are omitted until each workflow is verified.

Download
curl -fsSL https://fensory.com/skills/langchain-trading-agent/SKILL.md -o SKILL.md
Install in Hermes
hermes skills install https://fensory.com/skills/langchain-trading-agent/SKILL.md --name fensory-langchain-mcp

What the skill instructs

  • Read the account and instrument before preparing an action.
  • Keep the proposal inside the user's ceiling and the account's per-order cap.
  • Show the exact symbol, side, order type and size before a write call. Include the limit price for a limit order, or the current quote and expected execution conditions for a market order, then ask for confirmation.
  • Report a prepared order, submitted order and fill as three different states.

SKILL.md

---
name: fensory-langchain-mcp
description: Connect LangChain to the Fensory MCP server with browser OAuth, verify the current tool catalogue and begin with read-only account checks.
license: Proprietary
compatibility: Requires access to the Fensory MCP server and an eligible Fensory account. Fensory is not available to US persons.
metadata:
  author: Fensory AG
  version: "0.1.0"
  source: "https://fensory.com/skills/langchain-trading-agent"
---

# Connect a LangChain trading agent to Fensory

## When to use

This guide is for a Python developer or technical operator connecting a LangChain agent to an eligible Fensory account through the remote MCP endpoint.

It is not a hosted agent, an unattended trading loop or a CrewAI setup guide. It does not require a copied bearer token and it does not place an order during connection verification.

## Operating rules

- Start with read tools and identify the signed-in account, market, venue and instrument before preparing an action.
- Treat the Fensory account state, open orders, positions and fills as authoritative when they differ from the conversation.
- Fensory enforces four controls on the account: a kill-switch, an access expiry, a market allow-list and a per-order cap. Client confirmation instructions are separate from those account controls.
- Never describe a perpetual future as a share or tokenized equity. State the instrument and its risks before discussing an order.
- Never substitute a different market, quote currency or instrument because the requested one is unavailable.
- Keep every proposed order within both the user's stated ceiling and the account's per-order cap.
- Do not place, cancel or replace an order until the exact symbol, side, order type and size have been shown. For a limit order, show the limit price. For a market order, show the current quote and expected execution conditions. The user must confirm that exact action.
- Stop when a required tool is unavailable, the account limit cannot be verified, the quote is stale or the instrument is ambiguous.

## Risk and scope

This file is operational guidance, not financial advice. Trading can lose the full amount committed. Perpetual futures use margin and can be liquidated. Spot assets can lose value. Stop if the instrument, current quote or account controls cannot be verified.

## Procedure

1. **Install and pin the MCP dependency.** Install the LangChain MCP extra in an isolated environment and record the resolved LangChain and FastMCP versions. The integration is beta, so an unpinned upgrade can change the adapter or authentication behavior.
2. **Configure browser OAuth explicitly.** Create a FastMCP Client for the Fensory endpoint with auth set to oauth, then pass that client to MCPAdapter. Passing only the URL does not start the required browser authorization flow.
3. **Discover the current tools.** Call list_tools inside the adapter context and print the returned count. Read the live list rather than hard-coding a count because the MCP surface can change independently of this guide.
4. **Verify account and market reads.** Run read tools before attaching a model to any write-capable workflow. Confirm the signed-in account, trading readiness, visible spot markets and fee state. A visible write tool is not proof that the account will permit an order. Tools: `get-my-wallets`, `get_perps_status`, `get_spot_metadata`, `get_user_fees`.
5. **Attach tools to the agent last.** After the connection and account checks pass, provide the discovered tools to the LangChain agent and begin with the read-only prompt on this page. Add write behavior only with explicit account limits, action previews and confirmation rules.

## Request template

Use the connected Fensory tools in read-only mode. First confirm the current tool catalogue and identify the signed-in account. Call get-my-wallets, get_perps_status, get_spot_metadata and get_user_fees.

Report which account is connected, whether perpetual-futures trading is ready, which Hyperliquid spot markets are visible and what fee information the account returns. Separate tool availability from account permission and market availability.

Do not place, modify, cancel or close an order. Do not change leverage or margin. Do not infer that trading is enabled because a write tool appears in the catalogue. If authentication, account identity or a required read fails, report the exact failed step and stop.

## Failure handling

- **The browser never opens:** Check that the FastMCP Client was created with auth set to oauth. A URL passed directly to MCPAdapter does not configure the browser flow for this protected endpoint.
- **The callback does not complete:** Keep the Python process running, allow the temporary localhost callback and finish authorization in the same browser session. Restart the process if its callback has already closed.
- **The wrong Fensory account is authorized:** OAuth follows the Fensory session active in the browser. Stop and sign into the intended account before authorizing if the consent screen shows a different identity.
- **Tool discovery is treated as trading access:** The catalogue describes what the server can expose. Market availability, account status, allow-lists, access expiry and order caps still determine whether an action can proceed.
- **CrewAI is assumed to use the same login path:** It does not today. CrewAI 1.15.28 supports Streamable HTTP with supplied authorization headers, but its native client did not launch Fensory browser OAuth and returned 401 in the live test. Do not copy tokens into a workaround.
- **A dependency upgrade changes the beta API:** Re-run the discovery script after changing LangChain or FastMCP. Keep the last verified versions and date with the deployment so a connection failure can be separated from a Fensory account issue.

## Response contract

Report the account used, the exact instrument, the tools called, the controls that applied and the current order or position state. Separate a prepared order from a submitted order, and a submitted order from a fill. If no action was taken, say so directly.

## Sources

- [LangChain MCP documentation](https://docs.langchain.com/oss/python/langchain/mcp)
- [FastMCP OAuth documentation](https://gofastmcp.com/clients/auth/oauth)
- [CrewAI MCP documentation](https://docs.crewai.com/en/mcp/overview)
- [Fensory MCP server](https://fensory.com/mcp)

Product behavior and client permissions verified 2026-10-19.

Questions people ask

What does the Fensory LangChain MCP Agent Skill install?
It downloads one SKILL.md file containing operating instructions, risk boundaries, the tool sequence and a response contract. It does not install the Fensory MCP server or create an account.