Building a Financial Agent That Actually Works: Composio MCP + Hermes

by HarshApr 14, 20265 min read
MCPAI Use CaseAI Agents

This blog post walks through exactly how we:

  • Securely Set up Hermes Agent

  • Integrated Composio MCP for tool access (Google Sheet, Google Doc, Exa)

  • Built a functional financial analyst agent

Along the way, I’ll also share what broke, what worked, and what I’d do differently.

What is Hermes Agent

Hermes Agent an open source AI agent that can learn and evolve as you interact in real-time , something that open-claw lacked.

It does so by using a persistent cross-session memory and closed learning loop (write docs → save tools → update memory) that converts completed task into reusable skills. This allows it become more efficient over time.

The agent has following key capabilities:

  • Self Improving Loop : Unlike standard chatbot wrappers, Hermes agent refines its own skills from completed task

  • Persistent Memory: Maintains a persistent model of the user and past interactions across sessions.

  • Autonomous Agent tools: Agent offers over 40+ built in tools, support sub agent delegation and code execution

  • Multi-Platform Integration: Works from anywhere , from terminal to plethora of social media service (though little buggy)

  • Model Agnostic: Supports multiple LLM providers and LLMS including open source and closed source models.

Think of it as a programmable agent that can reason + act + self improve , not just respond.

This means its a perfect candidate for a financial analyst agent.

Securely Setup Hermes Agent

Prerequisites:

  • Docker - Install docker desktop

  • Optional- WSL2 for Windows

First install herms in docker, open terminal and run:

Image 1

Next configure the Hermes Agent, here is the setting I choose, feel free to choose your preferred:

  • Provider : OpenAI Codex. Make sure to authenticate

  • Model : GPT 5.4 / GPT 5.4 mini ( for faster inference)

  • TTS: Keep Current

  • Terminal Backend: Docker (make sure either docker is installed / docker desktop running)

  • Docker image : default

  • Max Iterations : Default. Set this to higher for complex task (cost more token)

  • Context Compression Threshold: Default. Higher threshold compresses later and lower does it faster

  • Messaging Platform (optional) : Choose Telegram and follow the instructions. Rest same , but I kept only telegram.

If done all this you will be greeted with following screen

Image 2

Now time to add Composio MCP!

Add Composio MCP

Hermes by default provide ~40 tools, which is ok for daily tasks.

But it starts feels pretty limited when you start building complex agentic workflows where you need to connect multiple third party SaaS apps (Google Doc, Sheets, Web seach tools, etc) with prod grade security and calling them at need.

Composio is the tooling layer that sits between Hermes Agent and third party applications and let you connect to 1000+ tools with secure auth and intelligent tool calling.

Installing Composio MCP is quite straightforward. Follow these steps:

Image 3
  • Head to the Install & copy the MCP Url and X-CONSUMER-API-KEY value

Image 4
  • Once done head to the terminal and type :

and at the end add these lines:

Add your own api key you copied & save the file

  • Head back to Hermes Agent and restart it using hermes, and it will detect the mcp.

Image 5
  • Now you can use Hermes Agent with MCP like any other agent, even though code runs in the sandbox:).

Alright now that we have agent & mcp in place, let’s try to see how it performs.

Add MCP using Composio CLI (Optional)

Composio also has a CLI, which let’s any agent to communicate with all the tools through commands. The CLI allows composability of workflows. The agent can chain tools and accomplish complex tasks with relatively lesser tokens than MCPs.

Using it is straight forward. Open your Hermes agent and paste the prompt mentioned on https://composio.dev/cli :

This set’s agent to use Composio cli and do all the task, rather than using direct mcp - infact this approach much simpler as no dependency is required.

Image 6

Alright now that we have agent & mcp in place, time to build the financial agent

Building Financial Analyst Agent

Head to the Hermes Agent, if not active - enable it using Hermes , ensure the MCP section have Composio and all other relevant MCP’s showing up (Gmail, Google Sheet, Google Docs , Exa Search). This is essential.

Now in the prompt box, paste the following prompt:

With this prompt:

  • You get asked 5 questions, and it builds a personal risk profile tailored to your investment style.

  • Every hour, it automatically scans NSE, BSE, Exa, Yahoo Finance, Moneycontrol and more for live Indian market data.

  • It writes a detailed investment report (what to buy, what to avoid, why) into a Google Doc - appending fresh analysis every cycle.

  • It maintains a live Google Sheet tracking top Indian stocks with sentiment, prediction, confidence, and minimum investment amount.

  • It emails you a clean market summary every hour, and fires an instant alert the moment it spots an urgent buy or sell signal.

Note: For demo i set the 1 hour duration to 5 minutes.

Now wait for execution to finish and cron job to be created. This is what my flow looked like:

Agent by default didn’t had access to Gmail, Sheet, Docs & EXA, and manually adding them was a pain (if say 20+ tools) and it bloats the context window as well.

Composio solvesbthe issue. You add it once, and it takes care of OAuth (one time link- did beforehand), calling right tool at runtime when needed, performing all the actions in sandbox and deliver the result, while Hermes Agent handled the orchestration and reasoning.

Note : If you haven’t connected any tool, while running agent, agent will ask you to connect, authenticate. Also for EXA - use a api key.


H
AuthorHarsh

Share