Thank you for your interest in contributing to the Google Research MCP Server. This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Making Changes
- Testing
- Submitting Changes
- Code Style Guidelines
- Reporting Issues
By participating in this project, you agree to maintain a professional and respectful environment for all contributors.
- Fork the repository
- Clone your fork locally
- Create a new branch for your feature or fix
- Make your changes
- Test thoroughly
- Submit a pull request
- Node.js 18 or higher
- npm or yarn package manager
- Google Cloud Platform account with Custom Search API access
- Text editor or IDE (VS Code recommended)
# Clone your fork
git clone https://github.com/YOUR_USERNAME/Google-Research-MCP.git
cd Google-Research-MCP
# Install dependencies
npm install
# Create .env file
cp .env.example .env
# Add your credentials to .env
# GOOGLE_API_KEY=your_google_api_key
# GOOGLE_SEARCH_ENGINE_ID=your_search_engine_id
# Build the project
npm run build
# Run the server
npm run start:v3After running npm run start:v3, you should see:
============================================================
Google Research MCP Server v3.0.0 (Enhanced)
============================================================
Source quality assessment
Deduplication
AI synthesis: AGENT MODE (Claude will launch agents)
Focus area analysis
Enhanced error handling
Cache metadata
============================================================
Server running on STDIO
src/
├── google-search-v3.ts # Main MCP server
├── services/
│ ├── google-search.service.ts # Google API integration
│ ├── content-extractor.service.ts # Web content extraction
│ ├── source-quality.service.ts # Source ranking
│ ├── deduplication.service.ts # Duplicate detection
│ └── research-synthesis.service.ts # Agent-based synthesis
├── types.ts # TypeScript interfaces
└── utils/ # Utility functions
Use descriptive branch names:
feature/add-new-tool- For new featuresfix/search-bug- For bug fixesdocs/update-readme- For documentation updatesrefactor/improve-dedup- For code refactoring
Write clear, descriptive commit messages:
feat: add support for image search filtering
fix: resolve deduplication edge case for Reddit URLs
docs: update AGENT-MODE.md with troubleshooting section
refactor: extract URL normalization to utility function
Format:
feat:- New featurefix:- Bug fixdocs:- Documentation changesrefactor:- Code refactoringtest:- Test additions or modificationschore:- Maintenance tasks
Before submitting changes, test all affected functionality:
// Test basic search
google_search({
query: "test query",
num_results: 5
})
// Test research with agent mode
research_topic({
topic: "test topic",
depth: "intermediate"
})
// Test content extraction
extract_webpage_content({
url: "https://example.com"
})- Server starts without errors
- All tools execute successfully
- Agent mode synthesis works correctly
- Quality scores appear in search results
- Deduplication functions properly
- Error handling provides helpful messages
- TypeScript compiles without errors
- No console warnings or errors
# Clean build
rm -rf dist/
npm run build
# Check for TypeScript errors
npx tsc --noEmit-
Update Documentation
- Update README.md if adding features
- Update relevant .md files in docs
- Add JSDoc comments to new functions
-
Test Thoroughly
- Run the testing checklist above
- Test edge cases
- Verify no regressions
-
Create Pull Request
- Provide clear description of changes
- Reference related issues
- Include testing performed
- Add screenshots if UI-related
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing Performed
- Describe testing done
- List test cases covered
## Checklist
- [ ] Code follows project style guidelines
- [ ] Documentation updated
- [ ] TypeScript compiles without errors
- [ ] All tests pass
- [ ] No console warnings- Use TypeScript strict mode
- Define interfaces for all data structures
- Avoid
anytype when possible - Use descriptive variable and function names
- Add JSDoc comments for public APIs
/**
* Assesses the quality of a source based on URL and content.
* @param url - The source URL
* @param content - Optional webpage content
* @returns Source quality assessment
*/
assessSource(url: string, content?: WebpageContent): SourceQuality {
// Implementation
}- Use 2 spaces for indentation
- Max line length: 100 characters
- Use single quotes for strings
- Add trailing commas in multi-line objects/arrays
const config = {
option1: 'value1',
option2: 'value2',
option3: 'value3',
};Always provide helpful error messages:
throw new Error(
`Failed to extract content from ${url}. ` +
`Ensure the URL is accessible and returns valid HTML.`
);Follow existing service patterns:
export class NewService {
private config: Config;
constructor(config?: Partial<Config>) {
this.config = { ...DEFAULT_CONFIG, ...config };
}
public async performAction(params: Params): Promise<Result> {
// Implementation
}
private helperMethod(): void {
// Helper implementation
}
}Include:
- Description - Clear description of the bug
- Steps to Reproduce - Exact steps to trigger the bug
- Expected Behavior - What should happen
- Actual Behavior - What actually happens
- Environment
- Node.js version
- Operating system
- MCP client (Claude Code, Claude Desktop, etc.)
- Error Messages - Complete error output
- Additional Context - Screenshots, logs, etc.
Include:
- Problem Description - What problem does this solve?
- Proposed Solution - How should it work?
- Alternatives Considered - Other approaches considered
- Use Cases - Real-world usage scenarios
- Additional Context - Examples, mockups, etc.
- Additional source quality heuristics
- Performance optimizations
- Enhanced deduplication algorithms
- Additional output formats
- Improved error recovery
- Additional search filters
- Content extraction improvements
- Cache management
- Rate limiting enhancements
- Additional usage examples
- API documentation
- Troubleshooting guides
- Video tutorials
If you have questions about contributing:
- Check existing documentation
- Search existing issues
- Open a new issue with the question label
Thank you for contributing to Google Research MCP Server!