Skip to content

Commit f00de93

Browse files
committed
updates
1 parent 153fb83 commit f00de93

File tree

3 files changed

+67
-58
lines changed

3 files changed

+67
-58
lines changed

README.md

Lines changed: 63 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,84 @@
1-
# 🤖 ADK Agent Starter
1+
# Coinbase Agent
22

3-
This is a starter template to start building your own agent with `@iqai/adk` library.
3+
A tiny proof‑of‑concept that wires Coinbase AgentKit into the IQAI ADK (adk-ts) using the Model Context Protocol (MCP). AgentKit providers are exposed as MCP SDK tools, then adapted into ADK tools so your ADK agent can call on-chain actions through Coinbase.
44

5-
## 🚀 Get Started
6-
Start by cloning the repository or clicking on use as template button on github ui.
5+
## How it works
6+
7+
- **AgentKit → MCP**: AgentKit's MCP package exposes its action providers as MCP tools plus a handler.
8+
- **MCP → ADK**: Those MCP tools are converted to ADK `BaseTool`s and attached to an `AgentBuilder`.
9+
- **Model**: Uses OpenRouter if `OPEN_ROUTER_KEY` is set; otherwise falls back to the model string configured in `LLM_MODEL`.
10+
11+
### Quick start
12+
13+
1. Install
714

815
```bash
9-
git clone https://github.com/IQAICOM/adk-agent-starter.git
16+
pnpm install
1017
```
1118

12-
📦 Install the dependencies
19+
2. Configure environment
20+
Create a `.env` with the essentials:
1321

1422
```bash
15-
pnpm install
23+
# Optional
24+
DEBUG=false
25+
OPEN_ROUTER_KEY=your_openrouter_key
26+
LLM_MODEL=gpt-4.1-mini
27+
28+
# Required for AgentKit / CDP
29+
CDP_API_KEY_ID=...
30+
CDP_API_KEY_SECRET=...
31+
CDP_WALLET_SECRET=...
32+
# Defaults to "fraxtal" if not set
33+
NETWORK_ID=fraxtal
34+
35+
# Optional: if not set, a throwaway key is generated at runtime
36+
PRIVATE_KEY=0x...
1637
```
1738

18-
▶️ Run the agent
39+
3. Run
1940

2041
```bash
2142
pnpm dev
43+
# or
44+
pnpm build && pnpm start
2245
```
2346

24-
## 📁 Folder Structure
25-
The main agent code lives in `index.ts` where the subagents live inside the `agents` folder. The agents can have tools which reside in the `tools` folder.
47+
The sample entry (`src/index.ts`) asks the agent: "Convert 100 USD to EUR." This is just a placeholder & i would rather recommend using the `adk cli` or `adk web` for better testing environment 👍.
48+
49+
### Included tools (via AgentKit)
50+
51+
- `wethActionProvider`
52+
- `pythActionProvider`
53+
- `walletActionProvider`
54+
- `erc20ActionProvider`
55+
- `cdpApiActionProvider`
56+
57+
These are automatically adapted into ADK tools; you can add or remove providers in `src/agents/coinbase/tools/agentkit.ts`. Check for more providers on the AgentKit repo if needed.
58+
59+
### Project layout
2660

2761
```
28-
├── src/
29-
│ ├── agents/
30-
│ │ └── financial-agent/
31-
│ │ ├── index.ts
32-
│ │ └── tools/
33-
│ │ └── currency-converter-tool.ts
34-
│ ├── services/
35-
│ │ └── wallet.ts
36-
│ ├── env.ts
37-
│ └── index.ts
62+
src/
63+
env.ts # env + model selection (OpenRouter optional)
64+
index.ts # simple demo prompt
65+
agents/coinbase/
66+
agent.ts # ADK agent wiring
67+
tools/
68+
agentkit.ts # AgentKit + providers setup
69+
index.ts # MCP → ADK tool adapter
3870
```
3971

40-
## ⚙️ Environment Setup
41-
Make sure to configure your environment variables:
72+
### Notes
4273

43-
```bash
44-
cp .env.example .env
45-
```
74+
- This is a PoC: minimal glue code aimed at clarity, not completeness.
75+
- Keep your CDP keys and any `PRIVATE_KEY` safe. A generated key is not persisted.
76+
77+
### References
78+
79+
- [IQAI ADK (adk-ts)](https://adk.iqai.com)
80+
- [Coinbase AgentKit](https://docs.cdp.coinbase.com/agent-kit)
81+
82+
### License
4683

47-
## 🧰 Dev Tools
48-
This starter includes:
49-
- 🐕 **Husky**: Git hooks for code quality
50-
- 🎨 **Biome**: Linting and formatting
51-
- 🚀 **GitHub Actions**: CI/CD pipeline
52-
- 📦 **PNPM**: Fast package manager
53-
54-
## 🏗️ Building Your Agent
55-
1. **Create new agents** in the `src/agents/` directory
56-
2. **Add tools** to your agents in the `tools/` subdirectory
57-
3. **Configure services** in the `src/services/` directory
58-
4. **Update environment** variables in `src/env.ts`
59-
60-
## 📚 Links
61-
- [ADK Library](https://github.com/IQAICOM/adk-ts)
62-
63-
## 🤝 Contributing
64-
1. Fork the repository
65-
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
66-
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
67-
4. Push to the branch (`git push origin feature/amazing-feature`)
68-
5. Open a Pull Request
69-
70-
## 📄 License
71-
MIT License - see the [LICENSE](LICENSE) file for details.
72-
73-
## 🆘 Support
74-
If you encounter any issues or have questions:
75-
- 📝 [Create an issue](https://github.com/IQAICOM/adk-agent-starter/issues)
84+
MIT

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "adk-agent-starter",
2+
"name": "coinbase-agent",
33
"version": "0.0.1",
4-
"description": "adk-agent-starter is a starter project for creating adk agents",
4+
"description": "Coinbase agent using agentkit and adk",
55
"main": "dist/index.js",
66
"scripts": {
77
"build": "tsc",

src/agents/coinbase/tools/agentkit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import {
77
walletActionProvider,
88
wethActionProvider,
99
} from "@coinbase/agentkit";
10-
import { env } from "process";
1110
import type { Hex } from "viem";
1211
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
12+
import { env } from "../../../env";
1313
/**
1414
* Get the AgentKit instance.
1515
*
@@ -20,7 +20,7 @@ export async function getAgentKit(): Promise<AgentKit> {
2020
let privateKey: Hex | null = null;
2121

2222
if (!privateKey) {
23-
privateKey = (env.PRIVATE_KEY || generatePrivateKey()) as Hex;
23+
privateKey = (env.CDP_WALLET_SECRET || generatePrivateKey()) as Hex;
2424
}
2525

2626
const owner = privateKeyToAccount(privateKey);

0 commit comments

Comments
 (0)