MCP Protocol in Practice: Building an AI Investment Analysis Agent with TradingView + Notion

Building a multi-MCP investment analysis Agent by integrating TradingView and Notion via MCP protocol.
This article explains the core difference between MCP protocol and Skills—universality and composability—with MCP standardizing AI-to-tool interactions via JSON RPC. It covers MCP's layered configuration (local/user/project) and two communication methods (HTTP for remote services, stdio for local processes), then demonstrates multi-MCP value through a hands-on case of building an investment analysis Agent by integrating TradingView and Notion MCPs. Finally, it identifies the current AI Agent bottleneck as instruction-following reliability, proposing multi-Agent Harness mechanisms as the solution.
The Fundamental Difference Between MCP Protocol and Skills
Many developers are confused when they first encounter Claude's MCP protocol: how is this different from Skills? Both can call external tools and fetch external data, but the core difference lies in invocation methods and processing logic.
MCP uses JSON RPC format to make requests, with parameters and invocation methods that are strictly fixed; Skills, on the other hand, have flexible and variable input parameters with more complex processing logic that may involve multiple external calls. JSON RPC is a lightweight remote procedure call protocol that uses JSON as its data format. The request body contains three fixed fields: method (method name), params (parameters), and id (request identifier). This strict format constraint is precisely why MCP chose it as its communication protocol—any language, any platform that can parse JSON can implement an MCP client or server, dramatically lowering the barrier to interoperability.
So where does MCP's advantage lie? The answer is universality and composability. MCP is like middleware such as Redis—it executes fixed calls, returns fixed results, and works on any machine. This analogy reveals an important architectural design philosophy: decoupling. Redis, as a caching middleware, interacts through a unified command protocol (like GET, SET) regardless of whether the upper layer is a Python, Java, or Go application. MCP works the same way—it standardizes the interaction between AI Agents and external tools, so tool providers only need to implement the MCP interface once to be callable by any AI system that supports the MCP protocol, avoiding the repetitive work of developing separate adapters for each AI platform. Integrating different MCPs is very easy, while integrating different Skills may require rewriting.

MCP Installation and Scope Configuration
Add MCPs via the claude mcp add command. The scope parameter determines the scope of effect:
- local (default): Added to
.claude.json, effective only for the current project - user: Globally effective, detectable by all Claude Code projects
- project: Added to the
.mcp.jsonfile in the current directory
This layered configuration design draws from Git's configuration management approach (local/global/system), allowing developers to precisely control tool visibility. For example, a general-purpose file search MCP is suitable for user-level global availability, while a project-specific database query MCP should be restricted to local scope to avoid accidental triggering in unrelated projects.

Two MCP Communication Methods: HTTP and stdio
MCP supports three communication formats, with two commonly used in practice:
HTTP Mode (Remote Service)
Suitable for remote MCP servers. Configuration requires specifying type: http and url fields. Once the server starts, Claude automatically sends a session request upon connection and lists available tools. Typical use cases for HTTP mode include: team-shared MCP services (such as internal company knowledge base queries), services requiring persistent state (such as database connection pools), and third-party API gateways deployed in the cloud. It supports SSE (Server-Sent Events) for server-initiated push, making it suitable for long-running tasks that need streaming results.
stdio Mode (Local Process)
No need to start a standalone service—it runs as a local script. Configuration specifies command and args parameters. For example, an image processing MCP can directly perform grayscale conversion, scaling, and other operations through process communication.
stdio (standard input/output) is the most fundamental inter-process communication method in operating systems. In MCP's stdio mode, Claude Code starts a subprocess to run the specified script, sends JSON RPC requests via stdin, and reads responses from stdout. The advantages of this approach are zero network overhead, no port management needed, and minimal deployment—it's essentially just a command-line program. For lightweight tools that don't need persistent execution (like file processing, format conversion), stdio mode is more efficient and secure than starting an HTTP service, since communication happens entirely between local processes without exposing any network ports.
Hands-On: Building a TradingView + Notion Investment Analysis Agent
Integrate two MCPs to build an investment analysis brain:
- TradingView MCP: Provides 27 tools including market snapshots, smart money tracking, single-asset analysis, backtesting strategies, etc.
- Notion MCP: Automatically pushes generated analysis reports to a Notion database
This multi-MCP composition architecture embodies the core value of the MCP protocol: each MCP focuses on capability output in a single domain, with the AI Agent serving as the orchestration layer to chain them into a complete workflow. Developers don't need to write any glue code to connect TradingView and Notion—the Agent automatically determines the call sequence and data passing method based on task requirements.

Complete Agent Workflow
- Market Scanning: Retrieve real-time trading information, news, and social media sentiment
- Asset Screening: Comprehensive scoring based on price trends, volume, and technical indicators (MACD, RSI, Bollinger Bands)
- Strategy Generation: Allocate positions based on risk preference (conservative/balanced/aggressive)
- Historical Backtesting: Validate strategy returns, maximum drawdown, Sharpe ratio, and win rate
- Report Output: Generate Markdown-format reports and push to Notion
The three core technical indicators used in the asset screening phase each have different focuses: MACD (Moving Average Convergence Divergence) determines trend direction and momentum strength by calculating the difference between short-term and long-term exponential moving averages; RSI (Relative Strength Index) measures the speed and magnitude of price changes, with values above 70 typically considered overbought and below 30 oversold; Bollinger Bands consist of a middle band (20-day moving average) and upper and lower standard deviation bands—price touching the upper band may indicate a pullback, while touching the lower band may signal a bounce. These three indicators provide trading signals from three dimensions—trend, momentum, and volatility—and using them in combination can significantly improve judgment accuracy.
In the historical backtesting phase, several key evaluation metrics are worth understanding: the Sharpe Ratio measures the excess return earned per unit of risk taken—the higher the value, the better the risk-adjusted return. Generally, above 1 is considered acceptable, and above 2 is excellent. Maximum Drawdown refers to the largest peak-to-trough decline, reflecting the worst-case scenario an investor might face. Win rate is the proportion of profitable trades to total trades. These three metrics together form the core framework for quantitative strategy evaluation—looking at returns alone while ignoring risk metrics is the most common cognitive bias in investment analysis.

Actual Output Example
Using $15,000 as an example, the Agent recommends: Coherent Corp 30% ($4,500), IonQ 20% ($3,000), Bitcoin 20% ($3,000), S&P 500 20% ($3,000), with $1,500 reserved. Backtesting shows COHR returns of 115.79%, IONQ at +6.02%, and BTC at -6.28%.
This combination reflects classic asset allocation theory—reducing overall portfolio volatility through diversified investment across asset classes with different correlations (individual stocks, cryptocurrency, index funds). Reserving 10% in cash is a typical risk management technique for buying opportunities during sudden market drops.
Current Limitations and Improvement Directions
Although Claude Opus has strong reasoning capabilities, single-Agent execution of complex tasks still has issues:
- Selectively ignoring instructions in prompts (e.g., not generating reports in Chinese as requested)
- Not executing in expected steps
- Insufficient stability of free APIs
These issues are classified in academia as "Instruction Following" challenges. Even the most advanced large language models experience attention dispersion leading to instruction omission when facing long contexts and multiple constraints. This isn't because the model "isn't smart enough"—it's an inherent limitation of the current Transformer architecture when processing complex constraint combinations.
The solution is to introduce a Harness (multi-validation) mechanism that ensures outputs meet expectations through multi-Agent cross-verification. The Harness mechanism borrows from the testing framework philosophy in software engineering: in a multi-Agent architecture, one Agent is responsible for task execution, another for verifying whether the output meets expected format and content requirements, and possibly a third for correction and retry when validation fails. This pattern is similar to multi-pass scanning in compilers, where each pass handles different levels of issues. The industry calls this approach "engineering practice for AI alignment"—rather than relying on perfect output from a single model, it ensures final result reliability through system architecture.
The core bottleneck of AI is no longer reasoning capability, but rather how to constrain it to reliably execute according to established processes. This realization is driving the industry from "pursuing stronger single models" toward "building more reliable multi-Agent systems." Engineering capability rather than model capability is becoming the key differentiating factor for AI application deployment.
Key Takeaways
- The core difference between MCP and Skills lies in universality and composability—MCP works like middleware that can be reused across environments
- MCP supports HTTP and stdio communication methods, suitable for remote services and local script scenarios respectively
- By integrating TradingView and Notion MCPs, you can quickly build an investment Agent with market analysis, backtesting, and report generation
- The main challenge for current AI Agents isn't reasoning capability, but ensuring reliable execution according to established processes
Related articles
TutorialsCursor + Codex Dual-IDE Collaboration: A Practical Methodology for Open-Source Project Customization
A complete methodology for open-source project customization based on real-world experience, detailing the Cursor+Codex dual-IDE workflow, seven-stage process, MVP validation, and AI source code reading techniques.
TutorialsCursor Multi-Agent in Practice: Building a Full-Stack Next.js Blog in 50 Minutes
Build a full-stack blog in 50 minutes using Cursor IDE's multi-Agent mode with Next.js, Clerk auth, and Supabase. Learn the 4-phase AI Agent workflow and key integration pitfalls.
TutorialsBuilding an AI Software Factory from Scratch: A Cursor Engineer's Hands-On Experience with Multi-Agent Collaboration
Cursor engineer Eric shares practical insights on building an AI software factory: automation levels, guardrail design, parallel Agent management, and scaling to 1000+ Agents for 24/7 development.