Fuel Network & Sway Language
Semantic search for Fuel Network and Sway Language documentation using a local vector database.
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
- Bun: Install from bun.sh
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 querynResults(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
Servidores relacionados
Dappier Search
Enable fast, free real-time web search and access premium data from trusted media brands for news, financial markets, sports, entertainment, weather, and more.
Slack Search
Search for messages and files within a Slack workspace using the Slack API.
WolframAlpha LLM
Answer math and other queries using the WolframAlpha LLM API.
Chromium CodeSearch Tools
Search Chromium source code using advanced Code Search syntax.
Perplexity MCP Server
Web search using Perplexity's API.
Aviationstack
An MCP server using the AviationStack API to fetch real-time flight data including airline flights, airport schedules, future flights and aircraft types.
EzBiz Government Contracting Intelligence
AI-powered federal contract search, agency spending analysis, competitor win tracking, and set-aside monitoring.
Docs MCP Server
Creates a personal, always-current knowledge base for AI by indexing documentation from websites, GitHub, npm, PyPI, and local files.
Crawleo MCP Server
Crawleo MCP - Web Search & Crawl for AI Enable AI assistants to access real-time web data through native tool integration. Two Powerful Tools: web.search - Real-time web search with flexible formatting Search from any country/language Device-specific results (desktop, mobile, tablet) Multiple output formats: Enhanced HTML (AI-optimized, clean) Raw HTML (original source) Markdown (formatted text) Plain Text (pure content) Auto-crawl option for full content extraction Multi-page search support web.crawl - Deep content extraction Extract clean content from any URL JavaScript rendering support Markdown conversion Screenshot capture Multi-URL support Features: ✅ Zero data retention (complete privacy) ✅ Real-time, not cached results ✅ AI-optimized with Enhanced HTML mode ✅ Global coverage (any country/language) ✅ Device-specific search (mobile/desktop/tablet) ✅ Flexible output formats (4 options) ✅ Cost-effective (5-10x cheaper than competitors) ✅ Simple Claude Desktop integration Perfect for: Research, content analysis, data extraction, AI agents, RAG pipelines, multi-device testing
Tavily
A comprehensive search API for real-time web search, data extraction, and crawling, requiring a Tavily API key.