Skip to content

Commit 9d8052b

Browse files
committed
feat: add example MCP configuration files and integration guide for Google ADK
- Introduced `cursor_mcp_config_simple.json` and `cursor_mcp_config.json` for simplified setup of Google ADK MCP Server. - Added `CURSOR_SETUP.md` documentation detailing integration steps, configuration options, and troubleshooting tips for using Google ADK with Cursor IDE. PiperOrigin-RevId: [insert-rev-id-here]
1 parent 48c27c8 commit 9d8052b

File tree

3 files changed

+341
-0
lines changed

3 files changed

+341
-0
lines changed

examples/CURSOR_SETUP.md

Lines changed: 317 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,317 @@
1+
# Google ADK MCP Server - Cursor Integration Guide
2+
3+
This guide shows how to integrate the Google ADK MCP Server with Cursor IDE to enable AI agent capabilities directly in your code editor.
4+
5+
## Prerequisites
6+
7+
1. **Cursor IDE installed** - Download from [cursor.sh](https://cursor.sh)
8+
2. **Google ADK MCP Server set up** - Follow the main [README.md](../README.md) setup instructions
9+
3. **Google Cloud credentials configured** - Required for agent execution
10+
11+
## Configuration
12+
13+
### Step 1: Locate Cursor Configuration
14+
15+
Cursor stores its MCP configuration in different locations depending on your operating system:
16+
17+
- **macOS**: `~/Library/Application Support/Cursor/User/globalStorage/cursor.mcp/settings.json`
18+
- **Linux**: `~/.config/Cursor/User/globalStorage/cursor.mcp/settings.json`
19+
- **Windows**: `%APPDATA%\Cursor\User\globalStorage\cursor.mcp\settings.json`
20+
21+
### Step 2: Create MCP Configuration
22+
23+
Create or edit the MCP configuration file with the following content:
24+
25+
#### Option 1: With Service Account (Recommended)
26+
27+
```json
28+
{
29+
"mcpServers": {
30+
"google-adk": {
31+
"command": "python",
32+
"args": ["/absolute/path/to/google-adk-mcp-server/mcp_server.py"],
33+
"env": {
34+
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/your/service-account-key.json",
35+
"GOOGLE_CLOUD_PROJECT": "your-project-id",
36+
"GOOGLE_CLOUD_LOCATION": "us-central1"
37+
}
38+
}
39+
}
40+
}
41+
```
42+
43+
#### Option 2: With Google AI API Key (Simpler)
44+
45+
```json
46+
{
47+
"mcpServers": {
48+
"google-adk": {
49+
"command": "python",
50+
"args": ["/absolute/path/to/google-adk-mcp-server/mcp_server.py"],
51+
"env": {
52+
"GOOGLE_AI_API_KEY": "your-google-ai-api-key"
53+
}
54+
}
55+
}
56+
}
57+
```
58+
59+
#### Option 3: Using System Environment (If already configured)
60+
61+
```json
62+
{
63+
"mcpServers": {
64+
"google-adk": {
65+
"command": "python",
66+
"args": ["/absolute/path/to/google-adk-mcp-server/mcp_server.py"]
67+
}
68+
}
69+
}
70+
```
71+
72+
### Step 3: Update Paths
73+
74+
Replace the placeholder paths with your actual paths:
75+
76+
1. **Server path**: Replace `/absolute/path/to/google-adk-mcp-server/mcp_server.py` with the full path to your server
77+
2. **Service account key**: Replace `/path/to/your/service-account-key.json` with your actual key path
78+
3. **Project ID**: Replace `your-project-id` with your Google Cloud project ID
79+
80+
#### Finding Your Server Path
81+
82+
```bash
83+
# Navigate to your server directory
84+
cd /path/to/google-adk-mcp-server
85+
86+
# Get the absolute path
87+
pwd
88+
# Example output: /Users/username/Documents/google-adk-mcp-server
89+
90+
# Your full server path would be:
91+
# /Users/username/Documents/google-adk-mcp-server/mcp_server.py
92+
```
93+
94+
### Step 4: Verify Python Command
95+
96+
Make sure the `python` command in the configuration points to the correct Python installation:
97+
98+
```bash
99+
# Check which Python Cursor should use
100+
which python
101+
# or
102+
which python3
103+
104+
# Verify it's 3.10+ and has the required packages
105+
python --version
106+
python -c "import google.adk; import mcp; print('✅ Ready!')"
107+
```
108+
109+
If you need to use a specific Python path:
110+
111+
```json
112+
{
113+
"mcpServers": {
114+
"google-adk": {
115+
"command": "/usr/local/bin/python3.11",
116+
"args": ["/absolute/path/to/google-adk-mcp-server/mcp_server.py"],
117+
"env": {
118+
"GOOGLE_AI_API_KEY": "your-api-key"
119+
}
120+
}
121+
}
122+
}
123+
```
124+
125+
## Testing the Integration
126+
127+
### Step 1: Restart Cursor
128+
129+
After updating the configuration, restart Cursor completely to load the new MCP server.
130+
131+
### Step 2: Verify Connection
132+
133+
1. Open Cursor
134+
2. Open the command palette (`Cmd+Shift+P` on macOS, `Ctrl+Shift+P` on Windows/Linux)
135+
3. Look for MCP-related commands or check if Google ADK tools are available
136+
137+
### Step 3: Test Agent Creation
138+
139+
Try creating a simple agent through Cursor's chat interface:
140+
141+
```
142+
Can you create a Google ADK agent named "code_assistant" that helps with code review and can search the web for programming best practices?
143+
```
144+
145+
If the integration is working, Cursor should be able to:
146+
- Create ADK agents
147+
- Run agents with your questions
148+
- Use Google Search and web scraping tools
149+
- Help with multi-agent systems
150+
151+
## Example Usage in Cursor
152+
153+
Once configured, you can use the Google ADK MCP server directly in Cursor:
154+
155+
### Code Review Assistant
156+
157+
```
158+
Create an ADK agent called "code_reviewer" that:
159+
1. Reviews code for best practices
160+
2. Can search for current coding standards
161+
3. Provides specific improvement suggestions
162+
163+
Then use it to review this Python function: [paste your code]
164+
```
165+
166+
### Research Assistant
167+
168+
```
169+
Create a research agent that can help me understand this new technology. Have it search for:
170+
1. Latest documentation
171+
2. Best practices
172+
3. Common implementation patterns
173+
174+
Topic: [your technology/framework]
175+
```
176+
177+
### Multi-Agent Development Team
178+
179+
```
180+
Set up a multi-agent system with:
181+
1. A coordinator that manages development tasks
182+
2. A code reviewer agent
183+
3. A documentation writer agent
184+
4. A testing specialist agent
185+
186+
Use this system to help me build a new feature for my project.
187+
```
188+
189+
## Troubleshooting
190+
191+
### Common Issues
192+
193+
#### 1. "MCP Server Not Found"
194+
195+
**Problem**: Cursor can't locate the MCP server
196+
197+
**Solutions**:
198+
- Verify the absolute path to `mcp_server.py` is correct
199+
- Check that the Python command is accessible from Cursor's environment
200+
- Ensure the virtual environment is properly configured
201+
202+
#### 2. "Google ADK Tools Not Available"
203+
204+
**Problem**: MCP server starts but Google ADK features don't work
205+
206+
**Solutions**:
207+
- Check Google Cloud credentials are properly set in the environment variables
208+
- Verify the credentials have the necessary permissions
209+
- Test credentials outside Cursor: `python -c "from google.adk.agents import LlmAgent; print('OK')"`
210+
211+
#### 3. "Python Version Issues"
212+
213+
**Problem**: Import errors or version conflicts
214+
215+
**Solutions**:
216+
- Ensure Python 3.10+ is being used
217+
- Use the full path to your Python installation in the config
218+
- Check that all dependencies are installed in the correct environment
219+
220+
#### 4. "Permission Denied"
221+
222+
**Problem**: Cursor can't execute the Python script
223+
224+
**Solutions**:
225+
- Make the script executable: `chmod +x mcp_server.py`
226+
- Check file permissions on the server directory
227+
- On Windows, ensure Python is in your PATH
228+
229+
### Debug Mode
230+
231+
Enable debug logging by modifying your configuration:
232+
233+
```json
234+
{
235+
"mcpServers": {
236+
"google-adk": {
237+
"command": "python",
238+
"args": ["-u", "/absolute/path/to/google-adk-mcp-server/mcp_server.py", "--debug"],
239+
"env": {
240+
"GOOGLE_AI_API_KEY": "your-api-key",
241+
"PYTHONUNBUFFERED": "1"
242+
}
243+
}
244+
}
245+
}
246+
```
247+
248+
### Testing Without Cursor
249+
250+
Test the MCP server independently to isolate issues:
251+
252+
```bash
253+
# Test server startup
254+
python mcp_server.py
255+
256+
# Test with the test client
257+
python examples/test_mcp_client.py
258+
259+
# Simple functionality test
260+
python simple_test.py
261+
```
262+
263+
## Advanced Configuration
264+
265+
### Multiple Environments
266+
267+
You can configure different MCP servers for different environments:
268+
269+
```json
270+
{
271+
"mcpServers": {
272+
"google-adk-dev": {
273+
"command": "python",
274+
"args": ["/path/to/dev/google-adk-mcp-server/mcp_server.py"],
275+
"env": {
276+
"GOOGLE_CLOUD_PROJECT": "my-dev-project"
277+
}
278+
},
279+
"google-adk-prod": {
280+
"command": "python",
281+
"args": ["/path/to/prod/google-adk-mcp-server/mcp_server.py"],
282+
"env": {
283+
"GOOGLE_CLOUD_PROJECT": "my-prod-project"
284+
}
285+
}
286+
}
287+
}
288+
```
289+
290+
### Custom Agent Templates
291+
292+
Create predefined agents for common development tasks by adding initialization scripts.
293+
294+
### Integration with Cursor Rules
295+
296+
You can create Cursor rules that automatically suggest using Google ADK agents for specific types of questions or tasks.
297+
298+
## Benefits in Cursor
299+
300+
With Google ADK MCP integration, Cursor gains:
301+
302+
1. **Intelligent Code Review** - AI agents that understand your codebase and current best practices
303+
2. **Research Assistance** - Agents that can search for and analyze the latest documentation
304+
3. **Multi-Agent Workflows** - Coordinate multiple AI specialists for complex development tasks
305+
4. **Web-Connected AI** - Access to real-time information and current technology trends
306+
5. **Custom Agent Creation** - Build specialized agents for your specific development needs
307+
308+
## Next Steps
309+
310+
1. **Explore Agent Templates** - Check the [USAGE.md](../USAGE.md) for pre-built agent examples
311+
2. **Build Custom Workflows** - Create multi-agent systems for your development process
312+
3. **Integrate with CI/CD** - Use ADK agents in your automated development pipelines
313+
4. **Share Configurations** - Export and share successful agent configurations with your team
314+
315+
---
316+
317+
For more examples and advanced usage, see the main [README.md](../README.md) and [USAGE.md](../USAGE.md) files.

examples/cursor_mcp_config.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"mcpServers": {
3+
"google-adk": {
4+
"command": "python",
5+
"args": ["/Users/tomtaila/Documents/Code/ai/mcp-servers/google-adk-mcp-server/mcp_server.py"],
6+
"env": {
7+
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/your/service-account-key.json",
8+
"GOOGLE_CLOUD_PROJECT": "your-project-id",
9+
"GOOGLE_CLOUD_LOCATION": "us-central1"
10+
}
11+
}
12+
}
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"mcpServers": {
3+
"google-adk": {
4+
"command": "python",
5+
"args": ["/Users/tomtaila/Documents/Code/ai/mcp-servers/google-adk-mcp-server/mcp_server.py"],
6+
"env": {
7+
"GOOGLE_AI_API_KEY": "your-google-ai-api-key-here"
8+
}
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)