Fuel Network & Sway Language MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/FuelLabs/fuel-mcp-server
cd fuel-mcp-server
bun install
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add fuel-mcp-server -- bun run "<FULL_PATH_TO_FUEL_MCP_SERVER>/dist/index.js" --transport stdio

Replace <FULL_PATH_TO_FUEL_MCP_SERVER>/dist/index.js with the actual folder you prepared in step 1.

README.md

Semantic search and interaction with Fuel Network and Sway documentation

Fuel Network & Sway Language MCP Server

This project provides a Model Context Protocol (MCP) server for the Fuel Network and Sway Language ecosystem. It allows IDEs (like Cursor) to search and interact with Fuel documentation directly within the development environment.

The server indexes Fuel and Sway documentation into a local Vectra vector database using open-source embeddings (via Transformers.js) for powerful semantic search capabilities.

Features

  • Local semantic search of docs.fuel.network content
  • No Docker dependency - runs with just Bun
  • Fast file-based vector storage with Vectra
  • Enhanced result filtering and formatting
  • Hybrid search with keyword fallback

Quick Install

# Clone the repo
git clone https://github.com/FuelLabs/fuel-mcp-server
cd fuel-mcp-server

# Install dependencies
bun install

# Index documentation
bun run src/indexer.ts ./docs

# Test search
bun run src/query.ts --run "What is FuelVM?"

# Start MCP server
bun run src/cli.ts

Usage

STDIO Transport (Default)

bun run src/cli.ts
# or explicitly
bun run src/cli.ts --transport stdio

HTTP Transport

bun run src/cli.ts --transport http --port 3500
# Server runs at http://127.0.0.1:3500/mcp
# Health check: http://127.0.0.1:3500/health

CLI Options

bun run src/cli.ts --help
bun run src/cli.ts --transport http --port 3500
bun run src/cli.ts --transport stdio

Claude/Cursor Integration

Add to your MCP config file:

{
  "mcpServers": {
    "fuel-server": {
      "command": "bun",
      "args": ["run", "/absolute/path/to/fuel-mcp-server/src/cli.ts", "--transport", "stdio"]
    }
  }
}

Project Structure

.
├── docs/                     # Markdown documentation files
├── src/
│   ├── cli.ts                # Main CLI entry point
│   ├── server.ts             # MCP server factory
│   ├── transports/
│   │   ├── stdio.ts          # STDIO transport
│   │   └── http.ts           # HTTP transport
│   ├── chunker.ts            # Markdown chunking logic
│   ├── indexer.ts            # Document indexing script
│   ├── query.ts              # Search query script
│   └── *.test.ts             # Test files
├── vectra_index/             # Local vector database (created after indexing)
├── package.json
└── README.md

Prerequisites

Usage

1. Index Documents

Place markdown files in ./docs or specify a different directory:

# Index docs in ./docs (default)
bun run src/indexer.ts

# Index custom directory
bun run src/indexer.ts /path/to/your/docs

# With custom settings
EMBEDDING_MODEL=Xenova/bge-small-en-v1.5 bun run src/indexer.ts ./docs

2. Search Documents

# Basic search
bun run src/query.ts --run "What is the FuelVM?"

# Custom number of results
NUM_RESULTS=10 bun run src/query.ts --run "smart contracts"

3. Run MCP Server

# Start MCP server (stdio-mode)
bun run src/cli.ts

# With HTTP transport
bun run src/cli.ts --transport http --port 3500

4. Run Tests

bun test

Environment Variables

Variable Default Description
VECTRA_INDEX_PATH ./vectra_index Vector database location
EMBEDDING_MODEL Xenova/all-MiniLM-L6-v2 Hugging Face model
CHUNK_SIZE 2000 Target tokens per chunk
NUM_RESULTS 5 Search results count
LOG_LEVEL Set to debug for verbose output

Implementation Details

  • Chunking: Preserves code blocks, splits by paragraphs with context awareness
  • Indexing: Generates embeddings with enhanced metadata for better search
  • Querying: Semantic search with quality filtering and keyword fallback
  • MCP Server: Exposes search as tool via stdio communication
  • Storage: File-based Vectra index (no external database required)

API

MCP Tools

searchFuelDocs

  • query (string): Search query
  • nResults (number, optional): Number of results (default: 5)
  • includeScore (boolean, optional): Include relevance scores

provideStdContext

  • Returns Sway standard library paths and types

Development

# Install dependencies
bun install

# Run tests
bun test

# Index sample docs
bun run src/indexer.ts ./docs

# Test search functionality
bun run src/query.ts --run "test query"

# Start MCP server for development (STDIO)
bun run src/cli.ts

# Start MCP server for development (HTTP)
bun run src/cli.ts --transport http --port 3500

Tools (2)

searchFuelDocsPerforms semantic search across Fuel and Sway documentation.
provideStdContextReturns Sway standard library paths and types.

Environment Variables

VECTRA_INDEX_PATHVector database location
EMBEDDING_MODELHugging Face model used for embeddings
CHUNK_SIZETarget tokens per chunk
NUM_RESULTSSearch results count
LOG_LEVELSet to debug for verbose output

Configuration

claude_desktop_config.json
{"mcpServers": {"fuel-server": {"command": "bun", "args": ["run", "/absolute/path/to/fuel-mcp-server/src/cli.ts", "--transport", "stdio"]}}}

Try it

Search the Fuel documentation for an explanation of how the FuelVM handles transaction execution.
What are the standard library types available in Sway for handling contract storage?
Find documentation on how to implement a basic smart contract in Sway.
Search for best practices regarding Fuel network security and contract development.

Frequently Asked Questions

What are the key features of Fuel Network & Sway Language?

Local semantic search of docs.fuel.network content. Fast file-based vector storage using Vectra. Hybrid search with keyword fallback. Enhanced result filtering and formatting. No Docker dependency - runs with Bun.

What can I use Fuel Network & Sway Language for?

Quickly retrieving technical documentation while writing Sway smart contracts in Cursor.. Querying FuelVM architecture details without leaving the IDE.. Accessing Sway standard library definitions during development.. Building an AI-assisted development workflow for the Fuel ecosystem..

How do I install Fuel Network & Sway Language?

Install Fuel Network & Sway Language by running: git clone https://github.com/FuelLabs/fuel-mcp-server && cd fuel-mcp-server && bun install

What MCP clients work with Fuel Network & Sway Language?

Fuel Network & Sway Language works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Fuel Network & Sway Language docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare