@dwlf/mcp-server

中文文档
0.67.0发布于 2026/11/13MITTypeScriptES Module构建来源已验证近 30 天下载 3333

MCP server for DWLF market analysis platform — exposes market data, indicators, signals, strategies, backtests, portfolio, trade journal, and more as AI-accessible tools

原始使用文档
文档目录25 节
  1. Quick Start
  2. Claude Desktop
  3. Cursor
  4. VS Code
  5. Getting an API Key
  6. Option 1: Web UI (Human Users)
  7. Option 2: Programmatic Registration (AI Agents)
  8. Configuration
  9. Tool profiles
  10. Tools
  11. Market Data
  12. Technical Indicators
  13. Trade Signals
  14. Strategies
  15. Backtesting
  16. Portfolio & Trade Journal
  17. Symbol Activations
  18. Custom Events
  19. AI Summaries
  20. Academy
  21. Example Prompts
  22. Development
  23. Cookbook
  24. Open Source Libraries
  25. License

@dwlf/mcp-server

MCP server for the DWLF market analysis platform. 45+ tools that turn market noise into semantic data AI agents can reason about — candles, indicators, support/resistance, events, strategies, backtests, portfolios, trade journals, symbol activations, and more.

Works with Claude Desktop, Cursor, VS Code, and any MCP-compatible client.

🤖 AI Agents: To ensure strategies created via MCP are accessible via REST API, use the same API key for both. See Agent Onboarding Guide.

Quick Start

The fastest way to get running — no cloning needed:

npx -y @dwlf/mcp-server

Or install globally:

npm install -g @dwlf/mcp-server
dwlf-mcp-server

You'll need a DWLF_API_KEY environment variable. See Getting an API Key below.

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "dwlf": {
      "command": "npx",
      "args": ["-y", "@dwlf/mcp-server"],
      "env": {
        "DWLF_API_KEY": "dwlf_sk_your_key_here"
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "dwlf": {
      "command": "npx",
      "args": ["-y", "@dwlf/mcp-server"],
      "env": {
        "DWLF_API_KEY": "dwlf_sk_your_key_here"
      }
    }
  }
}

VS Code

Add to .vscode/mcp.json:

{
  "mcp": {
    "servers": {
      "dwlf": {
        "command": "npx",
        "args": ["-y", "@dwlf/mcp-server"],
        "env": {
          "DWLF_API_KEY": "dwlf_sk_your_key_here"
        }
      }
    }
  }
}

Getting an API Key

Option 1: Web UI (Human Users)

  1. Sign up at dwlf.co.uk
  2. Go to Settings → API Keys
  3. Create a new key — it starts with dwlf_sk_
  4. Set it as DWLF_API_KEY in your MCP client config

Option 2: Programmatic Registration (AI Agents)

AI agents can register programmatically without browser access:

curl -X POST https://api.dwlf.co.uk/v2/agent/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "agentId": "my-trading-bot",
    "purpose": "Autonomous trading"
  }'

Returns an API key immediately. Use this key for both REST API and MCP to ensure account consistency.

📖 See Agent Onboarding Guide for complete setup instructions.

Configuration

VariableRequiredDefaultDescription
DWLF_API_KEYYes—Your DWLF API key (dwlf_sk_...)
DWLF_API_URLNohttps://api.dwlf.co.ukAPI base URL
DWLF_TOOL_PROFILENofullTool set: full (every tool) or block (the Bitcoin subset for DWLF Block). The --profile <name> flag does the same and wins. An unknown name stops the server with the reason.

Tool profiles

  • full (default): every tool, as before.
  • block: about 50 tools for Bitcoin users of DWLF Block: the conditions check, on-chain event descriptions, events, custom events, strategies, backtests, alerts, the academy and quotas. The retail, portfolio, trade-journal and metals tools are hidden. A profile only hides tools: the API key's permissions and quotas are the same either way. Set-up for each client: docs/BLOCK.md.

Tools

Market Data

Get OHLCV candles, list symbols, support/resistance levels, and indicator events (crossovers, breakouts, divergences, candlestick patterns).

Technical Indicators

Daily SMA/EMA values (10–200), trendlines (daily, weekly, hourly), market regime, and indicator events: DSS, Bollinger, EMA/SMA crosses, swing structure, SMC, VWAP, cycle pivots.

Trade Signals

Active signals, signal history with P&L, and performance stats (win rate, avg return).

Strategies

Create, update, compile, and browse visual trading strategies. List public community strategies.

Backtesting

Run backtests (async), get results with Sharpe ratios, and aggregate performance summaries.

Portfolio & Trade Journal

Portfolio holdings with P&L, historical snapshots, trade logging, notes, and plan templates.

Symbol Activations

Activate symbols for event detection and strategy signal generation. Manage which symbols are actively monitored.

Custom Events

Create custom indicator-based triggers (e.g. "DSS exits oversold with bullish cross").

AI Summaries

Full account dashboard, single-symbol briefs, and strategy performance overviews — pre-aggregated for AI consumption.

Academy

Browse educational tracks, read lessons, and search academy content.

Example Prompts

"How's BTC looking right now?"
"Where is AAPL relative to its 50 and 200 day moving averages?"
"What active trade signals do we have?"
"Create a Golden Cross strategy using EMA 50/200"
"Backtest my strategy on NVDA over the last year"
"Log a long on ETH at 3,200 with stop at 3,050"
"Activate TSLA for my momentum strategy"

Development

git clone https://github.com/andywilliams/dwlf-mcp-server.git
cd dwlf-mcp-server
npm install
npm run build
DWLF_API_KEY=dwlf_sk_your_key npm run start

For hot reload during development:

DWLF_API_KEY=dwlf_sk_your_key npm run dev

Cookbook

For multi-step workflows, see docs/cookbook.md.

Open Source Libraries

Building a dashboard or visualization? Use the same libraries that power the DWLF platform:

PackageDescriptionInstall
@dwlf/indicatorsTechnical indicators (EMA, Bollinger, DSS, Fibonacci, S/R, Swing, Trendlines) — zero dependenciesnpm install @dwlf/indicators
@dwlf/chartingReact charting library with candlestick charts, 20+ annotations, pan/zoomnpm install @dwlf/charting

Fetch candles via dwlf_get_market_data, compute indicators with @dwlf/indicators, render with @dwlf/charting.

License

MIT — DWLF / Andy Williams

版本与发布记录

@dwlf/mcp-server 共发布 89 个版本,首次发布于 2026/01/31;过去 12 个月发布了 89 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.67.0latest2026/11/13今天
0.66.02026/11/13今天
0.65.02026/11/13今天
0.64.12026/11/103 天前
0.64.02026/11/094 天前
0.63.02026/11/076 天前

关于 @dwlf/mcp-server 的常见问题

@dwlf/mcp-server 是什么?

MCP server for DWLF market analysis platform — exposes market data, indicators, signals, strategies, backtests, portfolio, trade journal, and more as AI-accessible tools

如何安装 @dwlf/mcp-server?

在项目目录运行 npm install @dwlf/mcp-server,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 dwlf-mcp-server,可以用 npx dwlf-mcp-server 直接运行。

@dwlf/mcp-server 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@dwlf/mcp-server 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@dwlf/mcp-server 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@dwlf/mcp-server 可以商用吗?

@dwlf/mcp-server 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dwlf/mcp-server 的下载量有多少?

根据 npm 官方下载统计,@dwlf/mcp-server 在 2026/10/13 – 2026/11/11 这 30 天内被下载 3,333 次,日均约 111 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dwlf/mcp-server 还在维护吗?

最新版本 0.67.0 发布于 2026/11/13(今天);至今共发布 89 个版本,其中过去 12 个月发布了 89 个;首次发布于 2026/01/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。