Market Inspector
Multi-asset market intelligence MCP server that monitors cryptocurrency movements, equity data, and ECB foreign-exchange reference rates to produce structured market briefs using Gemini.
README
Market Inspector
Market Inspector is a multi-asset market intelligence workflow built with Next.js 16, the Model Context Protocol (MCP), and Gemini 3.5 Flash. It monitors cryptocurrency movements, combines them with current equity data and ECB foreign-exchange reference rates, and produces structured market briefs.
The project was created for the Google × Kaggle AI Agents Intensive capstone, in the Agents for Business track.
System overview
Market Inspector exposes 11 MCP tools:
- 4 cryptocurrency tools
- 3 equity tools
- 3 foreign-exchange tools
- 1 zero-cost system status tool
Three coordinated roles divide the workflow:
| Role | Responsibility |
|---|---|
| Anomaly Detector | Scans the top cryptocurrency assets and classifies significant 24-hour movements. |
| Orchestrator | Serializes scans, stores the latest in-memory state, and publishes updates through Server-Sent Events. |
| Brief Generator | Provides Gemini with a seven-result market snapshot and eight optional MCP tools for additional context. |
Market-data fallbacks:
- Crypto price: CoinGecko → Binance when CoinGecko is rate-limited.
- Crypto global data and top movers: CoinGecko → CoinPaprika.
- Equity quotes and candles: Finnhub → Alpha Vantage → Yahoo Finance.
- Foreign exchange: Frankfurter using ECB reference rates.
Asset coverage
| Asset class | Dashboard | Automatic anomaly detection | Gemini snapshot |
|---|---|---|---|
| Cryptocurrency | Global metrics, top movers, ticker | Yes, every 60 seconds | Global market and top 10 assets |
| Equities | Six large-cap technology quotes and ticker | No | AAPL, MSFT, NVDA, GOOGL |
| Foreign exchange | Seven USD reference rates | No | USD against EUR, GBP, JPY, CHF |
Quick start
Requirements:
- Node.js 22.x
- pnpm 10.34.4
git clone https://github.com/dcosodev/market-inspector.git
cd market-inspector
corepack enable
pnpm install --frozen-lockfile
cp .env.local.example .env.local
pnpm dev
The application is available at http://localhost:3000.
Environment variables
| Variable | Purpose | Required |
|---|---|---|
GEMINI_API_KEY |
Manual AI briefs and the chat endpoint | For Gemini features |
FINNHUB_API_KEY |
Primary equity source | Recommended |
ALPHA_VANTAGE_API_KEY |
Secondary equity fallback | Optional |
LOG_LEVEL |
Structured JSON logging threshold | Optional (info) |
ENABLE_PUBLIC_CHAT |
Enables /api/chat in production when set to true |
Optional (false) |
Yahoo Finance provides the final no-key equity fallback. CoinGecko, CoinPaprika, Binance, and Frankfurter also require no key.
Main routes
| Route | Purpose |
|---|---|
/ |
Project overview |
/dashboard |
Market dashboard and architecture view |
/api/mcp |
MCP Streamable HTTP endpoint |
/api/anomalies |
Current state and manual AI scan stream |
/api/stream |
Continuous anomaly-state SSE stream |
/api/chat |
Optional Gemini chat backed by the MCP tool catalog; disabled in production unless ENABLE_PUBLIC_CHAT=true |
/api/health |
Zero-cost service health response; no external API calls |
Agent workflow
- The deterministic detector scans cryptocurrency movements without calling Gemini.
- A manual AI scan refreshes anomalies and preloads seven market-data results.
- Gemini receives the snapshot and can request one or more of eight selected MCP tools when additional context is needed.
- Execution progress, requested tools, and the final informational brief are streamed to the dashboard.
- Source-level rate limits, caching, circuit breaking, and fallbacks reduce the effect of upstream failures.
The dashboard stores a four-scan daily demonstration quota in localStorage. The server applies a matching four-scan in-memory per-client limit over a 24-hour window. Each notable-anomaly scan uses one to five Gemini requests, so the visible worst-case budget is twenty calls. This deliberately lightweight control conserves the demo allowance; it is a demo mitigation, not authentication, billing enforcement, or a hard global limit.
Generated briefs are informational only and are not personalized financial advice. Provider data, tool output, and user text are delimited as untrusted model context.
Verification
pnpm lint
pnpm typecheck
pnpm test
pnpm build
pnpm exec playwright install chromium
pnpm test:e2e
Gemini evaluation is manual and never runs in CI:
RUN_GEMINI_EVALS=1 EVAL_CASE=broad-crypto-selloff pnpm eval:gemini
Documentation
- Documentation overview
- Architecture
- Code reference
- Product specification
- BDD acceptance scenarios
- Design contract
- Repository agent rules
- Deterministic engineering protocol
- Project context skill
- Code conventions skill
- MCP tool pattern skill
- Market data API clients skill
- Gemini integration skill
- Multi-agent pattern skill
- React/Next dashboard design skill
- Code review and evaluation skill
- Manual Gemini evaluation rubric
- Code-review evaluation rubric
- Synthetic code-review calibration cases
Deployment
The repository includes a Vercel configuration for the Frankfurt region. Configure the required environment variables in the deployment platform; API keys must not be committed to the repository.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。