PortfoliosLab logoPortfoliosLab logo
...

Mcp

/

Connect PortfoliosLab MCP

Connect PortfoliosLab MCP

Set up the PortfoliosLab MCP server in your coding assistant so it can access live read-only data from your account.

Getting Started
Portfolioslab MCP
Last updated: May 31, 2026

To connect the PortfoliosLab MCP server, you need a PortfoliosLab MCP key and an MCP client that supports HTTP servers with custom headers.

The server name used in examples below is portfolioslab.


Before You Start

Create a PortfoliosLab MCP key

Generate an MCP key from your PortfoliosLab account settings. Regenerating the key invalidates the previous one immediately.

Use a supported MCP client

Examples below focus on Codex and Claude CLI style workflows because they support adding HTTP MCP servers directly.


Prompt Setup

If you want your coding assistant to perform the setup for you, give it a focused setup prompt and include your PortfoliosLab MCP key directly when asked.

Use this prompt:

You are a setup and configuration agent. Your job is to install and configure Portfolioslab MCP server in all supported coding clients on the current machine.

Your goal is to leave the machine with `portfolioslab` MCP server installed.

Target clients:

- Codex CLI
- Claude CLI

Example configuration for Codex in **config.toml**:

[mcp_servers.portfolioslab]
url = "https://portfolioslab.com/api/mcp/portfolioslab"
http_headers = { "Authorization" = "Bearer $MCP_KEY" }

Client-specific requirements:

Codex CLI and Codex desktop:

- Use the current supported Codex MCP configuration flow.
- Prefer `codex mcp add ...` when available.
- If direct file editing is required, update the shared Codex config without deleting unrelated entries.
- After setup, verify with `codex mcp list`.

Claude CLI / Claude Code:

- Use the current supported `claude mcp add ...` flow when possible.
- If direct file editing is required, update the correct Claude MCP config format without removing unrelated entries.
- After setup, verify with `claude mcp list` and inspect each server with `claude mcp get <name>` when helpful.

Configuration rules:

- **ASK** user for their PortfoliosLab $MCP_KEY and substitute it in Authorization header before making changes.
- **NEVER** create environment variables. **PUT** MCP_KEY value in configuration explicitly.

Verification requirements:

- Confirm server name appear in:
  - `codex mcp list` or the Codex-equivalent visible config
  - `claude mcp list`

Final output format:

- `Summary:` one short paragraph
- `Installed servers:` list each server and where it is now available

This approach is useful when you want the assistant to discover which supported clients are installed locally and complete the configuration for you.


Manual Setup

If you prefer to configure MCP yourself, use the ready-to-paste examples below and replace YOUR_MCP_KEY with your actual PortfoliosLab MCP key.


Codex Setup

Add the PortfoliosLab MCP server to your Codex configuration with the Authorization header set to your MCP key:

[mcp_servers.portfolioslab]
url = "https://portfolioslab.com/api/mcp/portfolioslab"
http_headers = { "Authorization" = "Bearer YOUR_MCP_KEY" }

If your Codex client supports codex mcp add, you can use that flow instead of editing the config file directly.


Claude CLI Setup

Add the server with an HTTP transport and the same bearer token header:

claude mcp add -s user --transport http --header='Authorization: Bearer YOUR_MCP_KEY' portfolioslab https://portfolioslab.com/api/mcp/portfolioslab

After setup, verify that the server is visible with claude mcp list.


First Prompts to Try

Once the server is connected, start with simple read-only prompts:

  • use mcp server named "portfolioslab" to search for ETF symbols from Vanguard with pageSize 10
  • use mcp server named "portfolioslab" to fetch symbol data for NVDA
  • use mcp server named "portfolioslab" to list my saved portfolios
  • use mcp server named "portfolioslab" to run stock comparison for a static portfolio with AAPL and MSFT

These examples match the tool surface that is currently available on the user server.


Troubleshooting

If setup succeeds but calls still fail, check the basics first:

Expired or regenerated MCP key

Create a new key and update the MCP client configuration with the fresh value.

Missing Authorization header

Confirm the MCP entry sends `Authorization: Bearer YOUR_MCP_KEY` on every request.

Wrong server URL

Use `https://portfolioslab.com/api/mcp/portfolioslab` for the user MCP server.

For a higher-level explanation of the server surface and use cases, see PortfoliosLab MCP Overview.

Was this article helpful?