Skip to main content
Fibrous documentation is AI-agent ready. AI coding assistants can search the docs in real time, understand the API structure, and help you build swap integrations faster. This works through three mechanisms: an MCP server for direct doc access, llms.txt for structured indexing, and skill.md for agent capability discovery.

What AI Tools Can Do with Fibrous

Search Docs

AI tools search Fibrous docs in real time via MCP, getting accurate API specs instead of stale web results.

Generate Code

Ask your AI assistant to build a swap integration using the Fibrous V2 API or SDK with correct parameters and types.

Debug Integrations

AI tools can look up error codes, rate limits, slippage guidance, and contract addresses directly from the docs.

Connect the Fibrous MCP Server

Fibrous hosts an MCP server at https://docs.fibrous.finance/mcp. When connected, AI tools can search Fibrous documentation directly during conversations instead of relying on web search.
You can also connect from any docs page using the contextual menu (top-right). Options include Copy MCP server URL, Connect to Cursor, and Connect to VS Code.
Run the following command to add the Fibrous MCP server:
claude mcp add --transport http Fibrous https://docs.fibrous.finance/mcp
Verify the connection:
claude mcp list
After adding, Claude Code can search Fibrous docs during any coding session. Try asking: “Using the Fibrous API, how do I find the best route for swapping ETH to USDC on Base?”

llms.txt

Fibrous hosts an AI-friendly documentation index at docs.fibrous.finance/llms.txt. This file lists every documentation page with descriptions, acting as a sitemap for AI tools. A full-content version is available at docs.fibrous.finance/llms-full.txt, containing the complete text of all pages in a single file.
Paste the llms.txt URL into any AI chat to give it an overview of all Fibrous documentation pages. This works with any LLM, no MCP required.

skill.md

Fibrous hosts a capability descriptor at docs.fibrous.finance/skill.md. This file tells AI agents what they can accomplish with Fibrous: find swap routes, generate calldata, check supported tokens and chains, and more. Agents that support skills (like Claude) can use this to understand Fibrous capabilities upfront, enabling them to proactively search the right documentation when helping you build integrations.
The skill.md is automatically generated from your documentation and stays up to date on every deploy.

Example: Build a Swap Integration with AI

Here’s a practical walkthrough of using an AI assistant with the Fibrous MCP server connected to build a complete swap integration.
1

Find the best route

Ask your AI assistant:
Using the Fibrous V2 API, write a function that finds the best route to swap 1 ETH for USDC on Base network.
The AI will search Fibrous docs and produce something like:
async function findRoute() {
  const params = new URLSearchParams({
    amount: '1000000000000000000', // 1 ETH in wei
    tokenInAddress: '0x0000000000000000000000000000000000000000',
    tokenOutAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
  });

  const response = await fetch(
    `https://api.fibrous.finance/base/v2/route?${params}`
  );
  return response.json();
}
2

Generate calldata and execute

Follow up with:
Now get the route and calldata in a single call with 0.5% slippage and show me how to execute it with ethers.js.
The AI will use the routeAndCallData V2 endpoint:
async function executeSwap(signer) {
  const params = new URLSearchParams({
    amount: '1000000000000000000',
    tokenInAddress: '0x0000000000000000000000000000000000000000',
    tokenOutAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
    slippage: '0.5',
    destination: await signer.getAddress(),
  });

  const response = await fetch(
    `https://api.fibrous.finance/base/v2/routeAndCallData?${params}`
  );
  const data = await response.json();

  const tx = await signer.sendTransaction({
    to: data.router_address,
    data: data.calldata,
    value: data.calldata.route.swap_type === 0 ? data.calldata.route.amount_in : '0',
  });

  return tx.wait();
}
3

Add error handling

Ask:
Add token approval checking, rate limit handling, and error handling following Fibrous best practices.
With MCP connected, the AI will pull recommendations from the Integration Guide — slippage tables, error codes, rate limit backoff, and token approval patterns.
4

Use the SDK instead

Try:
Rewrite this using the @fibrous/router SDK instead of raw API calls.
The AI will reference the SDK documentation and produce a cleaner integration using the TypeScript SDK.

Tips for Best Results

  • Be specific about the network — Always mention the target chain (Base, Monad, Starknet, etc.) since each has different token addresses and contract formats.
  • Specify V1 or V2 — Tell the AI whether to use V2 endpoints (recommended for new integrations) or V1 for backward compatibility. Both are actively supported.
  • Use the SDK for Starknet — Starknet uses a different transaction model (Cairo). The @fibrous/router SDK abstracts this, so direct the AI to use it for Starknet integrations.
  • Ask about integrator features — If you want to monetize your integration, tell the AI to include integratorAddress and integratorFeePercentageBps parameters with API key authentication.