### Build and run commands Source: https://github.com/aaronjmars/web3-research-mcp/blob/main/CLAUDE.md Install dependencies, build TypeScript to dist/, start the MCP server over stdio, and run a dev build+start. Use npm ci in CI or clean checkouts. ```bash npm ci # install (use this in CI / clean checkouts) ``` ```bash npm run build # tsc -> dist/ ``` ```bash npm start # node dist/server.js (talks MCP over stdio) ``` ```bash npm run dev # build + start ``` -------------------------------- ### coingecko-data example call and output Source: https://github.com/aaronjmars/web3-research-mcp Example invocation of `coingecko-data` with Bitcoin. Shows the expected markdown summary output, including rank, price, market cap, and resource pointer. ```TypeScript // { // "name": "coingecko-data", // "arguments": { "tokenName": "Bitcoin", "tokenTicker": "BTC" } // } // -> "# Bitcoin (BTC) — CoinGecko // Rank: #1 // // ## Market // - Price: $67234.120000 // - Market cap: $1,327,000,000,000 // ... (contracts + links sections) // // Saved as resource: research://resource/coingecko_bitcoin_1720000000000" ``` -------------------------------- ### Example call to create-research-plan Source: https://github.com/aaronjmars/web3-research-mcp Example invocation with tokenName "Uniswap" and tokenTicker "UNI". The output shows the created plan structure with a planned status. ```ts // { // "name": "create-research-plan", // "arguments": { "tokenName": "Uniswap", "tokenTicker": "UNI" } // } // -> "Created research plan for Uniswap (UNI):\n\n{ // \"projectInfo\": { \"description\": \"Gather basic information about the project\", // \"sources\": [\"Project website\", \"Documentation\", \"CoinMarketCap\"], // \"status\": \"planned\" }, ... }" ``` -------------------------------- ### Example fetch-content invocation and resource pass-through Source: https://github.com/aaronjmars/web3-research-mcp Shows an example MCP request for fetch-content with a URL and format, and a resource pass-through using a research://resource/ URI. The output echoes the first 1000 characters with a truncation note when longer. ```ts // { // "name": "fetch-content", // "arguments": { "url": "https://example.com/page", "format": "markdown" } // } // -> "Fetched content from https://example.com/page (markdown):\n\n# Title\n\nbody...\n\n[Content truncated, full version saved as resource]" // Resource pass-through: // { "name": "fetch-content", // "arguments": { "url": "research://resource/some_id", "format": "json" } } ``` -------------------------------- ### Example: using registerAllTools Source: https://github.com/aaronjmars/web3-research-mcp Shows how to instantiate an McpServer and ResearchStorage, then call registerAllTools to register all 13 tools. Subsequent registrations for other tool families can be added the same way, sharing the same storage instance. ```TypeScript import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import ResearchStorage from "./storage/researchStorage.js"; import { registerAllTools } from "./tools/index.js"; const server = new McpServer({ name: "my-server", version: "1.0.0" }); const storage = new ResearchStorage("./research_data"); // Registers all 13 research/CoinGecko/DeFiLlama tools on `server`. registerAllTools(server, storage); // Subsequent registrations for other tool families can be added // the same way, all sharing the same storage instance. ``` -------------------------------- ### Example call and output for research-with-keywords Source: https://github.com/aaronjmars/web3-research-mcp Shows an example MCP tool call with tokenName 'Aave', tokenTicker 'AAVE', and keywords ['price', 'tvl', 'docs'], followed by the expected output message including the resource pointer and highlights. ```TypeScript // { // "name": "research-with-keywords", // "arguments": { // "tokenName": "Aave", "tokenTicker": "AAVE", // "keywords": ["price", "tvl", "docs"] // } // } // -> "Completed searches for Aave with keywords: price, tvl, docs // Results saved as resource: research://resource/combined_search_aave_1720000000000 // Highlights: // - price: Aave (AAVE) price ... (https://...) // ..." ``` -------------------------------- ### Example call and output for defillama-data Source: https://github.com/aaronjmars/web3-research-mcp Shows a sample invocation with `tokenName: "Uniswap"` and `tokenTicker: "UNI"`, and the resulting markdown summary. The output includes category, primary chain, TVL details, fees, and a resource pointer. ```TypeScript // { // "name": "defillama-data", // "arguments": { "tokenName": "Uniswap", "tokenTicker": "UNI" } // } // -> "# Uniswap (UNI) — DeFiLlama // Category: DEXes // Primary chain: Ethereum // // ## TVL // - Total TVL: $4,123,456,789 // - ATH TVL: $11,500,000,000 (2021-10-26) // - From ATH: -64.13% // - 30d ago: $3,900,000,000 (change +5.73%) // ... // ## Fees // - 24h: $1,234,567 // ... // Saved as resource: research://resource/defillama_uniswap_1720000000000" ``` -------------------------------- ### Example call for list-resources Source: https://github.com/aaronjmars/web3-research-mcp Example invocation of the 'list-resources' tool, showing the expected output format. ```TypeScript // { "name": "list-resources", "arguments": {} } // -> "Available resources:\n\n[ { \"id\": \"coingecko_bitcoin_1720000000000\", ... } ]" ``` -------------------------------- ### Example defillama-search invocation and output Source: https://github.com/aaronjmars/web3-research-mcp Shows a sample MCP request for `defillama-search` with query "aave" and the resulting output format. The response lists matching protocols with name, symbol, slug, TVL, and category, and suggests using `defillama-data` for full details. ```ts // { // "name": "defillama-search", // "arguments": { "query": "aave" } // } // -> "DeFiLlama matches for \"aave\": // - Aave (AAVE) — slug: `aave` — TVL: $12,345,678,901 — Lending // - Aave V3 (AAVE) — slug: `aave-v3` — TVL: $... // ... // Use `defillama-data` with the matching name/ticker for full details." ``` -------------------------------- ### Basic usage: start, mutate, persist with ResearchStorage Source: https://github.com/aaronjmars/web3-research-mcp Creates a ResearchStorage instance, starts a new research project, updates the research plan, adds a resource, and completes the research. The completeResearch() call persists data to ./research_data/btc_*.json. ```TypeScript import ResearchStorage from "./storage/researchStorage.js"; const storage = new ResearchStorage("./research_data"); storage.startNewResearch("Bitcoin", "BTC"); storage.updateSection("researchPlan", { projectInfo: { description: "Gather basic information about the project", sources: ["Project website", "Documentation", "CoinMarketCap"], status: "planned", }, }); storage.addToSection("resources", { coingecko_bitcoin_1720000000000: { url: "https://api.coingecko.com/api/v3/coins/bitcoin", format: "markdown", content: "# Bitcoin — CoinGecko", title: "CoinGecko: Bitcoin (BTC)", source: "CoinGecko", fetchedAt: new Date().toISOString(), }, }); storage.completeResearch(); // persists to ./research_data/btc_*.json ``` -------------------------------- ### Example update-status invocations and outputs Source: https://github.com/aaronjmars/web3-research-mcp Shows example MCP invocations for the 'update-status' tool. The first updates 'marketStatus' to 'in_progress' and returns a success message. The second uses an unknown section 'nope' and returns an isError with 'Section 'nope' not found in research plan'. ```ts // { // "name": "update-status", // "arguments": { "section": "marketStatus", "status": "in_progress" } // } // -> "Updated status of 'marketStatus' to 'in_progress'" // Unknown section -> isError: // { "name": "update-status", // "arguments": { "section": "nope", "status": "completed" } } // -> "Section 'nope' not found in research plan" ``` -------------------------------- ### Example search tool invocation Source: https://github.com/aaronjmars/web3-research-mcp Example MCP client call for the 'search' tool with a news search for 'Ethereum ETF flows'. ```ts // Via an MCP client (Claude Desktop, Cursor, ...): // { // "name": "search", // "arguments": { "query": "Ethereum ETF flows", "searchType": "news" } // } ``` -------------------------------- ### fmtUsd usage examples Source: https://github.com/aaronjmars/web3-research-mcp Shows expected outputs for various inputs, including null and NaN. Demonstrates the default digits and custom digits behavior. ```ts import { fmtUsd } from "./utils/format.js"; fmtUsd(1234567.891); // "$1,234,568" fmtUsd(67234.12, 6); // "$67,234.120000" fmtUsd(0.00001234, 6); // "$0.000012" fmtUsd(null); // "n/a" fmtUsd(Number.NaN); // "n/a" ``` -------------------------------- ### Example call for research-source Source: https://github.com/aaronjmars/web3-research-mcp Example invocation of the 'research-source' tool with tokenName 'Arbitrum', tokenTicker 'ARB', and source 'IQ Wiki', showing the expected output. ```TypeScript // { // "name": "research-source", // "arguments": { "tokenName": "Arbitrum", "tokenTicker": "ARB", "source": "IQ Wiki" } // } // -> "Researched IQ Wiki for Arbitrum (ARB). // Top result: Arbitrum — IQ.wiki // Content saved as resource: research://resource/iq wiki_arbitrum_1720000000000 // All search results: [ ... ]" ``` -------------------------------- ### quoteInput usage example Source: https://github.com/aaronjmars/web3-research-mcp Shows expected outputs for short, HTML-containing, and long inputs. Demonstrates truncation and escaping behavior. ```ts import { quoteInput } from "./utils/format.js"; quoteInput("BTC"); // "BTC" (unescaped) quoteInput("