Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 99 additions & 6 deletions examples/usecases/mcp_financial_analyzer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ Install requirements specific to this example:
uv pip install -r requirements.txt
```

Install the g-search-mcp server (from https://github.com/jae-jae/g-search-mcp):

```bash
npm install -g g-search-mcp
```

## `2` Set up secrets and environment variables

Copy and configure your secrets:
Expand Down Expand Up @@ -96,3 +90,102 @@ Or run with a different company:
```bash
uv run main.py "Microsoft"
```

## `4` [Beta] Deploy to MCP Agent Cloud

### Prerequisites
This agent is already cloud-compatible with the `@app.tool` decorator and uses only the `fetch` server for web data collection.

### Step 1: Login to MCP Agent Cloud

```bash
uv run mcp-agent login
```

### Step 2: Deploy your agent

```bash
uv run mcp-agent deploy financial-analyzer
```

Comment on lines +94 to +110
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

🧩 Analysis chain

CLI commands may need verification

“uv run mcp-agent login|deploy …” looks plausible, but CLI subcommands/entrypoint names are brittle. Please confirm exact command names and flags.


🌐 Web query:

What are the current mcp-agent CLI subcommands for authentication and deployment, and example invocations (including SSE URL usage) as of September 2025?

💡 Result:

Short answer — common CLI subcommands (Sep 2025) and example invocations:

  1. agentauth-mcp (proxy for connecting MCP clients to remote MCP servers)
  • Subcommands: generate, connect.
  • Examples:
    • Generate local test credentials:
      agentauth-mcp generate. [1]
    • Connect an MCP client to a remote MCP URL with a custom header:
      agentauth-mcp connect https://api.example.com/mcp --header "API-Key:${API_KEY}".
    • Connect using AgentAuth token (set AGENTAUTH_TOKEN in env):
      AGENTAUTH_TOKEN=aa-... agentauth-mcp connect https://api.example.com/mcp. [1]
  1. Using an SSE MCP server URL directly from an MCP client / npx command (common pattern used by mcp-agent and related projects)
  • No special mcp-agent “auth” subcommand — you configure the MCP server entry to use an SSE URL (and headers) or run an npx wrapper that supplies the SSE URL.
  • Examples (mcp_agent.config.yaml / npx style):
    • npx/server invocation embedding SSE URL:
      command: "npx"
      args: ["-y","@modelcontextprotocol/server-sse","https://localhost:8000/sse"]
    • or with token header in config:
      mcp:
      servers:
      sse_server:
      transport: "sse"
      url: "https://localhost:8000/sse"
      headers:
      Authorization: "Bearer your-token"
    • Inline example used by some projects (Agent.ai style):
      args: ["-y","@modelcontextprotocol/server-sse","https://mcp.example.com/YOUR_API_TOKEN_HERE/sse"]. [2][3]
  1. mcp-agent (lastmile-ai) deployment / run commands (common usage patterns)
  • Install and run examples / deploy agent:
    • Install: pip install mcp-agent (or uv add "mcp-agent" / uv run main.py for example apps).
    • Run example app locally:
      uv run main.py
    • Expose an agent as an MCP server by configuring mcp_agent.config.yaml (see SSE/WebSocket/http transports above) and run the app to serve it. [2][3]

Notes / sources

  • agentauth-mcp (CLI: generate, connect; header support examples). [1]
  • mcp-agent docs (config examples showing SSE / headers / transports). [3]
  • Agent.ai / similar projects showing embedding SSE URL into npx args (common invocation pattern). [2]

If you want, I can produce exact copy-paste-ready CLI snippets and a sample mcp_agent.config.yaml that shows auth headers + SSE URL for your environment.


Replace inaccurate CLI examples with agentauth-mcp / SSE-config usage

File: examples/usecases/mcp_financial_analyzer/README.md (lines 100–116) — the shown commands uv run mcp-agent login and uv run mcp-agent deploy … are not standard. Replace with one of the common, copy-paste patterns below:

  • Auth (replace login):

  • SSE config (preferred inline example instead of a “login”): add in mcp_agent.config.yaml:
    mcp:
    servers:
    sse_server:
    transport: "sse"
    url: "https://localhost:8000/sse"
    headers:
    Authorization: "Bearer your-token"

  • Run/deploy (replace deploy): show install + run or service config, e.g.:
    pip install mcp-agent
    uv run main.py
    —or— explain how to expose the agent using the mcp_agent.config.yaml + run command.

🤖 Prompt for AI Agents
In examples/usecases/mcp_financial_analyzer/README.md around lines 100–116 the
README shows nonstandard CLI commands `uv run mcp-agent login` and `uv run
mcp-agent deploy …`; replace them with the suggested agentauth-mcp / SSE-config
patterns: remove the incorrect `uv run mcp-agent` examples, add an auth example
using either `agentauth-mcp connect https://mcp.example.com/sse --header
"Authorization: Bearer ${MCP_TOKEN}"` or an environment variant
`AGENTAUTH_TOKEN=aa-... agentauth-mcp connect https://mcp.example.com/sse`,
include the preferred inline mcp_agent.config.yaml SSE snippet (mcp -> servers
-> sse_server with transport/url/headers Authorization) and replace the `deploy`
example with explicit install + run instructions (e.g., pip install mcp-agent
and uv run main.py) or explain how to start the agent using the provided
mcp_agent.config.yaml so readers have a copy-pasteable auth and run workflow.

During deployment, you'll be prompted to configure secrets. You'll see two options for the OpenAI API key:

#### For OpenAI API Key:
```
Select secret type for 'openai.api_key'
1: Deployment Secret: The secret value will be stored securely and accessible to the deployed application runtime.
2: User Secret: No secret value will be stored. The 'configure' command must be used to create a configured application with this secret.
```
Comment on lines +114 to +118
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick

Add language to fenced code block (markdownlint MD040)

Specify a language for linting/renderers.

-```
+```text
 Select secret type for 'openai.api_key'
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

114-114: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
examples/usecases/mcp_financial_analyzer/README.md around lines 114 to 118, the
fenced code block lacks a language specifier which triggers markdownlint MD040;
update the opening fence to include a language token (for example "text" or
"console") so it becomes ```text (or ```console) and leave the block contents
unchanged to satisfy linters and improve renderer behavior.


**Recommendation:**
- Choose **Option 1** if you're deploying for personal use and want immediate functionality
- Choose **Option 2** if you're sharing this agent publicly and want users to provide their own OpenAI API keys

### Step 3: Connect to your deployed agent

Once deployed, you'll receive a deployment URL like: `https://[your-agent-server-id].deployments.mcp-agent.com`

#### Claude Desktop Integration

Configure Claude Desktop to access your agent by updating your `~/.claude-desktop/config.json`:

```json
{
"mcpServers": {
"financial-analyzer": {
"command": "/path/to/npx",
"args": [
"mcp-remote",
"https://[your-agent-server-id].deployments.mcp-agent.com/sse",
"--header",
"Authorization: Bearer ${BEARER_TOKEN}"
],
"env": {
"BEARER_TOKEN": "your-mcp-agent-cloud-api-token"
}
}
}
}
```

#### MCP Inspector

Test your deployed agent using MCP Inspector:

```bash
npx @modelcontextprotocol/inspector
```

Configure the inspector with these settings:

| Setting | Value |
|---------|-------|
| Transport Type | SSE |
| SSE URL | `https://[your-agent-server-id].deployments.mcp-agent.com/sse` |
| Header Name | Authorization |
| Bearer Token | your-mcp-agent-cloud-api-token |

**💡 Tip:** Increase the request timeout in the Configuration since LLM calls take longer than simple API calls.

### Available Tools

Once deployed, your agent will expose the `analyze_stock` tool, which:
- Takes a company name as input (e.g., "Apple", "Microsoft")
- Conducts comprehensive financial research using web search
- Performs quality evaluation and improvement loops to ensure data accuracy
- Generates professional investment analysis with bull/bear cases
- Returns a complete financial report as formatted text

Comment on lines +170 to +178
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick

Align wording: “web search” → “MCP fetch”

Prerequisites state only the fetch server is used. Adjust for consistency.

- - Conducts comprehensive financial research using web search
+ - Conducts comprehensive financial research using the MCP fetch server (HTTP retrieval)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Available Tools
Once deployed, your agent will expose the `analyze_stock` tool, which:
- Takes a company name as input (e.g., "Apple", "Microsoft")
- Conducts comprehensive financial research using web search
- Performs quality evaluation and improvement loops to ensure data accuracy
- Generates professional investment analysis with bull/bear cases
- Returns a complete financial report as formatted text
### Available Tools
Once deployed, your agent will expose the `analyze_stock` tool, which:
- Takes a company name as input (e.g., "Apple", "Microsoft")
- Conducts comprehensive financial research using the MCP fetch server (HTTP retrieval)
- Performs quality evaluation and improvement loops to ensure data accuracy
- Generates professional investment analysis with bull/bear cases
- Returns a complete financial report as formatted text
🤖 Prompt for AI Agents
In examples/usecases/mcp_financial_analyzer/README.md around lines 170 to 178,
the tool description incorrectly says it "Conducts comprehensive financial
research using web search" while the prerequisites and architecture use the MCP
fetch server; change the phrase "web search" to "MCP fetch" (or "MCP fetch
server") for consistency and, if there is a prerequisites section elsewhere,
ensure it explicitly mentions the MCP fetch server as the data source so wording
is consistent across the README.

### Example Usage

After deployment, you can use the agent through Claude Desktop or MCP Inspector:

```
Please analyze Meta's financial performance and investment outlook.
```

Comment on lines +183 to +186
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick

Add language to fenced code block (markdownlint MD040)

Mark the example as text.

-```
+```text
 Please analyze Meta's financial performance and investment outlook.
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

183-183: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In examples/usecases/mcp_financial_analyzer/README.md around lines 183 to 186
the fenced code block lacks a language specifier causing markdownlint MD040;
update the fence to include a language (e.g., "text") so it reads ```text before
the content and ``` after to mark the example as plain text.

The agent will automatically:
1. Research Tesla's current stock price, earnings, and recent news
Comment on lines +187 to +188
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an inconsistency in the example usage section. In line 184, the example shows analyzing Meta:

Please analyze Meta's financial performance and investment outlook.

But in line 188, it states the agent will research Tesla:

1. Research Tesla's current stock price, earnings, and recent news

The company name should be consistent between these lines - either both should reference Meta or both should reference Tesla.

Suggested change
The agent will automatically:
1. Research Tesla's current stock price, earnings, and recent news
The agent will automatically:
1. Research Meta's current stock price, earnings, and recent news

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

2. Evaluate data quality and improve if needed
3. Analyze the financial data for investment insights
4. Generate a comprehensive report with recommendations
Comment on lines +187 to +191
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick

Fix entity mismatch: Tesla vs Meta

The narrative should match the Meta prompt above.

-1. Research Tesla's current stock price, earnings, and recent news
+1. Research Meta's current stock price, earnings, and recent news
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The agent will automatically:
1. Research Tesla's current stock price, earnings, and recent news
2. Evaluate data quality and improve if needed
3. Analyze the financial data for investment insights
4. Generate a comprehensive report with recommendations
The agent will automatically:
1. Research Meta's current stock price, earnings, and recent news
2. Evaluate data quality and improve if needed
3. Analyze the financial data for investment insights
4. Generate a comprehensive report with recommendations
🤖 Prompt for AI Agents
In examples/usecases/mcp_financial_analyzer/README.md around lines 187 to 191,
the step list references "Tesla" but must match the Meta prompt; replace "Tesla"
with "Meta" and ensure any related phrasing (e.g., stock price, earnings, recent
news) consistently refers to Meta across the four bullets so the narrative
matches the prompt above.

Loading
Loading