
ski043/nextjs-financial-agent-mcp-arcade-dev
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
An intelligent financial AI agent that analyzes your investment portfolio, fetches real-time market data, and delivers personalized insights through multiple channels, all powered by Arcade.
Обзор
An intelligent financial AI agent that analyzes your investment portfolio, fetches real-time market data, and delivers personalized insights through multiple channels, all powered by Arcade. MCPMarshal demonstrates how to build a production-ready AI agent using a that separates concerns between data sourcing, persistent memory, and multi-channel presentation. The application showcases Arcade's seamless OAuth handling for Gmail, Notion, and Google Docs integration. - : Manage multiple investment portfolios with holdings, purchase prices, and quantities - : Custom MCP server retrieves live stock prices, company fundamentals, and market news - : LLM autonomously researches your holdings, deciding what data to fetch and where to focus attention - : Publish reports to Gmail, Notion, or Google Docs with one-click OAuth - : Weekly cron jobs automatically generate and email portfolio reports - : Ask questions and watch the AI autonomously call tools to fetch the data it needs Arcade is the...
README
Показан фрагмент оригинального README. Открыть оригинал.
MCPMarshal - Financial AI Agent
An intelligent financial AI agent that analyzes your investment portfolio, fetches real-time market data, and delivers personalized insights through multiple channels, all powered by Arcade.
Overview
MCPMarshal demonstrates how to build a production-ready AI agent using a three-layer architecture that separates concerns between data sourcing, persistent memory, and multi-channel presentation. The application showcases Arcade’s seamless OAuth handling for Gmail, Notion, and Google Docs integration.
What It Does
- Tracks Your Portfolio: Manage multiple investment portfolios with holdings, purchase prices, and quantities
- Fetches Real-Time Data: Custom MCP server retrieves live stock prices, company fundamentals, and market news
- Agentic Report Generation: LLM autonomously researches your holdings, deciding what data to fetch and where to focus attention
- Delivers Anywhere: Publish reports to Gmail, Notion, or Google Docs with one-click OAuth
- Scheduled Automation: Weekly cron jobs automatically generate and email portfolio reports
- Agentic Chat: Ask questions and watch the AI autonomously call tools to fetch the data it needs
Architecture
Layer Breakdown
| Layer | Purpose | Technology |
|---|---|---|
| Data Source | Fetches real-time financial data | Custom MCP Server (Python + arcade-mcp) |
| Memory | Persists portfolios, reports, and chat history | PostgreSQL with Prisma ORM |
| Presentation | Delivers insights through multiple channels | Next.js Dashboard, Gmail, Notion, Google Docs |
Arcade Integration
Arcade is the backbone that enables seamless multi-channel publishing without the complexity of managing OAuth flows manually.
How Arcade Powers This Application
1. Tool Execution via Arcade SDK
import Arcade from "@arcadeai/arcadejs";
const arcadeClient = new Arcade({ apiKey: process.env.ARCADE_API_KEY });
// Execute any tool with automatic auth handling
const response = await arcadeClient.tools.execute({
tool_name: "Gmail.SendEmail",
input: {
subject: "Weekly Portfolio Report",
body: reportHtml,
recipient: userEmail,
content_type: "html",
},
user_id: userId,
});
2. OAuth Authorization Flow
// Check if user has authorized Gmail
const authResponse = await arcadeClient.tools.authorize({
tool_name: "Gmail.SendEmail",
user_id: userId,
});
if (authResponse.status === "pending") {
// Redirect user to Arcade's OAuth consent screen
return { authorizationUrl: authResponse.authorization_url };
}
// User is authorized, proceed with tool execution
3. Supported Integrations
| Tool | Arcade Tool Name | Use Case |
|---|---|---|
| Gmail | Gmail.SendEmail |
Send portfolio reports via email |
Установка
npx prisma db push