P

PM-MCP

@surplus96/PM-MCP
0 Stars 207 次浏览 surplus96 更新于 2026-08-23

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "pm-mcp": {
      "args": [
        "-m",
        "pm_mcp"
      ],
      "command": "python",
      "env": {
        "OBSIDIAN_VAULT_PATH": "/path/to/your/vault"
      }
    }
  }
}

服务介绍

PM-MCP (Portfolio Management MCP Server)

AI MCP(Model Context Protocol) .

1. (propose_themes_tool)

   .
propose_themes_tool(
    lookback_days=7,      #   ()
    max_themes=5          #    
)

2. (explore_theme_tool)

  .
explore_theme_tool(
    theme='AI',           #  
    lookback_days=7       #   
)

3. (propose_tickers_tool)

.
propose_tickers_tool(
    theme='AI'            #  
)

4. (analyze_selection_tool)

 .
analyze_selection_tool(
    theme='AI',
    tickers=['AAPL', 'MSFT', 'NVDA']
)

5. (analyze_dip_candidates_tool)

   .
analyze_dip_candidates_tool(
    theme='AI',
    tickers_csv='AAPL,MSFT,NVDA',
    drawdown_min=0.2,     #   
    event_min=0.5,        #   
    ret10_min=0,          #  10 
    top_n=5               #  N 
)

1. (portfolio_analyze_nl_tool)

.
portfolio_analyze_nl_tool(
    holdings_text='AAPL@2024-10-01:185, LLY 2024-09-15 520, NVO',
    save=True             # Obsidian  
)

** :**

  • TICKER@: -
  • TICKER -
  • TICKER - ( )

2. (portfolio_evaluate)

.
portfolio_evaluate(
    holdings=['AAPL', 'MSFT', 'NVDA']
)

3. (portfolio_evaluate_detailed)

, , , , .

portfolio_evaluate_detailed(
    holdings=['AAPL', 'MSFT', 'NVDA']
)

** :**

  • ** **:
  • ****: /
  • ****:
  • ****:
  • ****:

1. (market_get_prices)

.
market_get_prices(
    ticker='AAPL',
    start='2024-01-01',   #  ()
    end='2024-12-31',     #  ()
    interval='1d'         # : 1d, 1wk, 1mo
)

2. (market_get_prices_paginated)

.
market_get_prices_paginated(
    ticker='AAPL',
    cursor=0,             #  
    page_size=100         #  
)

3. (market_get_prices_summary)

.

market_get_prices_summary(
    ticker='AAPL',
    period='1y',          # : 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max
    interval='1d',        # : 1d, 1wk, 1mo
    agg='W'               # : D(), W(), M()
)

4. CSV (market_write_prices_csv)

CSV .

market_write_prices_csv(
    ticker='AAPL',
    start='2024-01-01',
    end='2024-12-31'
)

 .
news_search(
    queries=['AI', 'semiconductor'],
    lookback_days=7,      #  
    max_results=10        #   
)

2. (news_search_log_tool)

.
news_search_log_tool(
    queries=['NVIDIA earnings', 'AI regulation'],
    theme='AI',           #  
    lookback_days=7,
    max_results=10
)

3. SEC (filings_fetch_recent)

SEC .

filings_fetch_recent(
    ticker='AAPL',
    forms=['10-K', '10-Q', '8-K'],  #   
    limit=10              #   
)

** :**

  • 10-K:
  • 10-Q:
  • 8-K:
  • DEF 14A:
  • S-1:

1. (present_theme)

 .
present_theme(
    theme='AI',
    tickers_csv='AAPL,MSFT,NVDA',
    chart_days=90,        #  
    with_images=False,    #   
    ma_windows=[20, 50],  # 
    colors=['blue', 'red', 'green'],
    yscale='linear'       # 'linear'  'log'
)

2. (present_portfolio)

.

present_portfolio(
    tickers_csv='AAPL,MSFT,NVDA',
    history_days=30,      #  
    with_images=False,
    ma_windows=[20, 50],
    colors=['blue', 'red', 'green'],
    yscale='linear'
)

3. (create_theme_report)

.

create_theme_report(
    theme='AI',
    tickers_csv='AAPL,MSFT,NVDA'
)

4. (create_portfolio_phase_report)

.
create_portfolio_phase_report(
    tickers_csv='AAPL,MSFT,NVDA'
)

Obsidian

1. Obsidian (obsidian_write)

Obsidian vault .

obsidian_write(
    note_path='Investments/AI_Theme_Analysis.md',
    body='#  \n...',
    front_matter={
        'tags': ['', 'AI'],
        'date': '2024-12-07'
    }
)

2. (present_theme_save)

Obsidian .

present_theme_save(
    theme='AI',
    tickers_csv='AAPL,MSFT,NVDA',
    with_images=True
)

3. (present_portfolio_save)

Obsidian .

present_portfolio_save(
    tickers_csv='AAPL,MSFT,NVDA',
    with_images=True
)

1. (analytics_rank)

.
analytics_rank(
    candidates=[
        {'ticker': 'AAPL', 'score': 85},
        {'ticker': 'MSFT', 'score': 90}
    ],
    use_dip_bonus=True,   #   
    dip_weight=0.12,      #  
    auto_hydrate=True     #   
)

2. (reports_generate)

.

reports_generate(
    payload={
        'type': 'theme_analysis',
        'theme': 'AI',
        'tickers': ['AAPL', 'MSFT', 'NVDA'],
        'options': {...}
    }
)

# 1:  
themes = propose_themes_tool(lookback_days=7, max_themes=5)

# 2:   
details = explore_theme_tool(theme='AI', lookback_days=7)

# 3:  
tickers = propose_tickers_tool(theme='AI')

# 4:   
analysis = analyze_selection_tool(
    theme='AI',
    tickers=['NVDA', 'MSFT', 'GOOGL']
)

# 5:    
dip_candidates = analyze_dip_candidates_tool(
    theme='AI',
    tickers_csv='NVDA,MSFT,GOOGL',
    top_n=3
)

# 6:  
present_theme_save(
    theme='AI',
    tickers_csv='NVDA,MSFT,GOOGL',
    with_images=True
)

# 1:   ()
portfolio_analyze_nl_tool(
    holdings_text='NVDA@2024-10-15:140, MSFT@2024-09-01:420, AAPL',
    save=True
)

# 2:  
detailed = portfolio_evaluate_detailed(
    holdings=['NVDA', 'MSFT', 'AAPL']
)

# 3:   
present_portfolio_save(
    tickers_csv='NVDA,MSFT,AAPL',
    with_images=True
)

MCP

Claude Desktop :

{
  "mcpServers": {
    "pm-mcp": {
      "command": "python",
      "args": ["-m", "pm_mcp"],
      "env": {
        "OBSIDIAN_VAULT_PATH": "/path/to/your/vault"
      }
    }
  }
}

  • OBSIDIAN_VAULT_PATH: Obsidian vault ()

  • ** **: Yahoo Finance API
  • ****: API
  • ****: SEC EDGAR API

MIT License

相关 MCP 服务