Skip to content

Commit fe8df56

Browse files
committed
first-draft-for-n8n-independent-agent
1 parent eeaa542 commit fe8df56

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

agent-test/config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
google:
2+
api_key:

agent-test/spendee_agent.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import asyncio
2+
import os
3+
4+
from mcp_agent.app import MCPApp
5+
from mcp_agent.agents.agent import Agent
6+
from mcp_agent.workflows.llm.augmented_llm_openai import GoogleAugmentedLLM
7+
8+
app = MCPApp(name="hello_world_agent")
9+
10+
async def example_usage():
11+
async with app.run() as mcp_agent_app:
12+
logger = mcp_agent_app.logger
13+
# This agent can read the filesystem or fetch URLs
14+
finder_agent = Agent(
15+
name="Lumi-test",
16+
instruction="""You are a helpful assistant""",
17+
#server_names=["fetch", "filesystem"], # MCP servers this Agent can use
18+
)
19+
20+
async with finder_agent:
21+
# Automatically initializes the MCP servers and adds their tools for LLM use
22+
#tools = await finder_agent.list_tools()
23+
#logger.info(f"Tools available:", data=tools)
24+
llm = await finder_agent.attach_llm(GoogleAugmentedLLM)
25+
26+
# This will perform a file lookup and read using the filesystem server
27+
result = await llm.generate_str(
28+
message="Why is the sky blue? Explain in two sentences."
29+
)
30+
logger.info(f"Response: {result}")
31+
32+
33+
if __name__ == "__main__":
34+
asyncio.run(example_usage())

0 commit comments

Comments
 (0)