Skip to content

MCP Server ​

The @richview/mcp-server package exposes RichView functionality as Model Context Protocol tools, resources, and prompts for AI agent integration.

Setup ​

Claude Desktop (stdio transport) ​

Add to your Claude Desktop configuration (claude_desktop_config.json):

json
{
  "mcpServers": {
    "richview": {
      "command": "npx",
      "args": ["@richview/mcp-server"]
    }
  }
}

HTTP transport ​

For remote clients, start the server in HTTP mode:

bash
npx @richview/mcp-server --http
npx @richview/mcp-server --http --port 3001

Endpoints:

  • POST /mcp -- MCP Streamable HTTP endpoint
  • GET /health -- Health check
  • GET /debug -- Server capability catalog

Tools ​

All tools use the richview.* namespace.

ToolDescription
richview.generate-reportGenerate an HTML report from a report schema
richview.verify-reportRun verification assertions against a report
richview.validate-schemaValidate a JSON object against the report schema
richview.add-sectionAdd a new section to an existing report
richview.update-sectionUpdate an existing section by ID
richview.remove-sectionRemove a section by ID
richview.reorder-sectionsReorder sections by providing a new ID list
richview.describe-reportGenerate a text description for self-verification
richview.diff-reportCompare two report versions
richview.lint-reportCheck for quality issues and best practices
richview.stats-reportGet comprehensive report statistics
richview.merge-reportsCombine multiple reports into one
richview.template-reportCreate a report from a built-in template
richview.transform-reportApply transformations (filter, slice, strip, anonymize)
richview.summary-reportGenerate a compact text summary
richview.inspect-reportDeep introspection: data profiling, coverage
richview.extract-dataExtract structured data from report sections
richview.fetch-stockFetch stock price data from Yahoo Finance
richview.fetch-cryptoFetch cryptocurrency price data from CoinGecko
richview.fetch-weatherFetch weather forecast data from Open-Meteo
richview.fetch-fxFetch forex exchange rates from Frankfurter (ECB)
richview.screenshot-reportGenerate a PNG screenshot of a rendered report

Resources ​

URIDescription
richview://schemas/reportComplete JSON Schema for a RichView report
richview://themes/default-darkDark mode design tokens
richview://themes/default-lightLight mode design tokens
richview://guideComprehensive agent guide for creating reports
richview://examples/{name}Example report schemas (parameterized)

Prompts ​

Prompt templates for common report types:

PromptDescription
richview.analysis-reportData analysis report
richview.executive-summaryExecutive summary
richview.portfolio-reportInvestment or portfolio report
richview.competitive-analysisCompetitive landscape report
richview.incident-postmortemIncident postmortem
richview.data-quality-reportData quality assessment
richview.sales-reportSales performance report
richview.technical-specTechnical specification

Data Tools ​

The MCP server includes built-in data fetching tools that require no API keys.

richview.fetch-stock ​

Fetch stock price data from Yahoo Finance. Returns current price, daily change, and up to 20 days of OHLCV history. Supports any ticker symbol. Use exchange suffixes for non-US stocks (e.g., HSBA.L for London).

Input: { symbol: "AAPL" }

richview.fetch-crypto ​

Fetch cryptocurrency price data from CoinGecko. Returns current USD price, 24h change, market cap, and trading volume. Supports common symbols (BTC, ETH, SOL, ADA, DOT, AVAX, MATIC, LINK, DOGE, XRP, BNB, LTC) and CoinGecko IDs.

Input: { symbol: "BTC" }

richview.fetch-weather ​

Fetch current weather conditions from Open-Meteo. Geocodes the location name, then returns temperature (Celsius), humidity, wind speed, and weather description.

Input: { location: "London" }

richview.fetch-fx ​

Fetch forex exchange rates from the Frankfurter API (ECB reference data). Returns the rate between two ISO 4217 currency codes.

Input: { from: "USD", to: "EUR" }

richview.screenshot-report ​

Render a report to HTML and capture a PNG screenshot using headless Chrome. Returns a base64-encoded image. Requires Chrome or Chromium installed on the system.

Input: { report: "<json string>", width?: 1280, height?: 900, theme?: "light" | "dark" }

Environment Variables ​

VariableDefaultDescription
RICHVIEW_OUTPUT_DIR./reportsDirectory for generated report files
RICHVIEW_PUBLISH_URLhttps://richview.ukServer URL for publishing reports

Programmatic usage ​

typescript
import { createServer } from "@richview/mcp-server";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

const server = createServer();
const transport = new StdioServerTransport();
await server.connect(transport);

For HTTP transport:

typescript
import { startHttpServer } from "@richview/mcp-server";

const { url, close } = await startHttpServer({ port: 3001 });
console.log(`MCP server at ${url}/mcp`);

Released under the Elastic License 2.0 (ELv2).