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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ For production or clean local environments, use Docker.
- **Tools**: Add functions to `agents/<your_agent>/tools/`
- **Main Logic**: Edit `agents/<your_agent>/agent.py`

## Available Agents

- **GitHub Wizard** (`agents/github_wizard`): An agent equipped with GitHub MCP tools to assist with repository tasks. Requires `GITHUB_TOKEN`.

## Why not `adk web --session_service_uri ...`?

ADK’s CLI defaults to local SQLite session storage unless you pass
Expand Down
23 changes: 23 additions & 0 deletions agents/github_wizard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# GitHub Wizard Agent

The **GitHub Wizard** is a specialized agent designed to assist with GitHub-related tasks using the Model Context Protocol (MCP).

## Features

- **GitHub Integration**: Connects to GitHub using the GitHub Copilot MCP server.
- **Task Assistance**: Helps answer questions and perform actions related to GitHub repositories, issues, and pull requests.

## Configuration

To use this agent, you must provide a valid GitHub token.

1. Obtain a GitHub Personal Access Token (PAT) with appropriate permissions.
2. Set the `GITHUB_TOKEN` environment variable in your `.env` file or environment.

```env
GITHUB_TOKEN=your_github_token_here
```

## Tools

- **GitHub MCP Tools**: Automatically loaded if `GITHUB_TOKEN` is present.
File renamed without changes.
23 changes: 23 additions & 0 deletions agents/github_wizard/agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
from google.adk.agents.llm_agent import Agent
from google.adk.models.lite_llm import LiteLlm

# Import tools
from .tools.github_mcp import github_mcp_tools

api_base_url = "https://openrouter.ai/api/v1"

Choose a reason for hiding this comment

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

medium

The api_base_url is hardcoded. It's better to make this configurable via an environment variable, with the current value as a default. This improves flexibility for different environments (e.g., testing, staging) and aligns with how OPENROUTER_API_KEY is handled.

Suggested change
api_base_url = "https://openrouter.ai/api/v1"
api_base_url = os.getenv("OPENROUTER_API_BASE", "https://openrouter.ai/api/v1")


root_agent = Agent(
model=LiteLlm(
model="openrouter/openai/gpt-oss-120b",
api_base=api_base_url,
api_key=os.getenv("OPENROUTER_API_KEY"),
),
name="github_wizard",
description="A helpful assistant for GitHub related tasks.",
instruction="""
Answer user questions to the best of your knowledge using the provided GitHub tools.
""",
# Give the agent tools to do its job
tools=github_mcp_tools,
)
20 changes: 20 additions & 0 deletions agents/github_wizard/tools/github_mcp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import os
from google.adk.tools.mcp_tool.mcp_toolset import McpToolset, StreamableHTTPConnectionParams

def _get_github_mcp_tools():
github_token = os.getenv("GITHUB_TOKEN")
tools = []
if github_token:
tools = [
McpToolset(
connection_params=StreamableHTTPConnectionParams(
url="https://api.githubcopilot.com/mcp/",
headers={"Authorization": f"Bearer {github_token}"}
)
)
]
else:
print("Warning: GITHUB_TOKEN not found. GitHub MCP tools will not be available.")
return tools
Comment on lines +1 to +18

Choose a reason for hiding this comment

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

medium

This file can be improved in a few ways for better maintainability and adherence to best practices:

  1. Use logging for warnings: Instead of print, the logging module should be used for warnings. This provides more control over log levels and output.
  2. Use a constant for the URL: The hardcoded URL should be extracted into a module-level constant for better readability and easier maintenance.
  3. Simplify logic: The function _get_github_mcp_tools can be simplified by using an early return (guard clause) for the case where GITHUB_TOKEN is not set.

The suggested code applies these improvements.

Suggested change
import os
from google.adk.tools.mcp_tool.mcp_toolset import McpToolset, StreamableHTTPConnectionParams
def _get_github_mcp_tools():
github_token = os.getenv("GITHUB_TOKEN")
tools = []
if github_token:
tools = [
McpToolset(
connection_params=StreamableHTTPConnectionParams(
url="https://api.githubcopilot.com/mcp/",
headers={"Authorization": f"Bearer {github_token}"}
)
)
]
else:
print("Warning: GITHUB_TOKEN not found. GitHub MCP tools will not be available.")
return tools
import os
import logging
from google.adk.tools.mcp_tool.mcp_toolset import McpToolset, StreamableHTTPConnectionParams
GITHUB_MCP_URL = "https://api.githubcopilot.com/mcp/"
def _get_github_mcp_tools():
github_token = os.getenv("GITHUB_TOKEN")
if not github_token:
logging.warning("GITHUB_TOKEN not found. GitHub MCP tools will not be available.")
return []
return [
McpToolset(
connection_params=StreamableHTTPConnectionParams(
url=GITHUB_MCP_URL,
headers={"Authorization": f"Bearer {github_token}"},
)
)
]


github_mcp_tools = _get_github_mcp_tools()
28 changes: 0 additions & 28 deletions agents/jarvis/agent.py

This file was deleted.

22 changes: 0 additions & 22 deletions agents/jarvis/sub_agents/researcher.py

This file was deleted.

13 changes: 0 additions & 13 deletions agents/jarvis/tools/calculator.py

This file was deleted.