Thank you for your interest in contributing to the ShopSavvy Data API MCP Server! This document provides guidelines for contributing to this open-source project.
- Node.js 18 or higher
- Bun (recommended) or npm
- A ShopSavvy Data API key (get one at https://shopsavvy.com/data)
-
Clone the repository
git clone https://github.com/shopsavvy/shopsavvy-mcp-server cd shopsavvy-mcp-server -
Install dependencies
bun install # or npm install -
Set up environment
export SHOPSAVVY_API_KEY="your_api_key_here"
-
Test the server
bun run dev # or npm run dev
# Test with MCP CLI
bun run dev
# Inspect with MCP Inspector
bun run inspectbun run build- Use TypeScript for all code
- Follow existing code formatting
- Use meaningful variable and function names
- Add JSDoc comments for public functions
- Use Zod for input validation
src/
├── index.ts # Main server implementation
├── types.ts # Type definitions (future)
├── utils.ts # Utility functions (future)
└── tools/ # Individual tool implementations (future)
├── products.ts
├── pricing.ts
└── scheduling.ts
When adding new MCP tools:
- Follow the naming convention: Use descriptive names like
product_lookup,price_history - Add proper validation: Use Zod schemas for parameter validation
- Include error handling: Wrap API calls in try-catch blocks
- Add logging: Use the provided
logcontext for debugging - Format responses: Return human-readable, well-formatted responses
- Update documentation: Add examples to the README and usage examples
server.addTool({
name: "tool_name",
description: "Clear description of what this tool does",
parameters: z.object({
param1: z.string().describe("Description of parameter"),
param2: z.string().optional().describe("Optional parameter")
}),
execute: async ({ param1, param2 }, { log }) => {
log.info(`Tool execution started`, { param1, param2 })
try {
const result = await apiRequest("/endpoint", { param1, param2 })
// Format and return response
return formatResponse(result)
} catch (error) {
log.error("Tool execution failed", { error: error.message })
return `❌ Error: ${error.message}`
}
}
})- Be mindful of API rate limits
- Include usage information in responses
- Handle rate limit errors gracefully
- Always wrap API calls in try-catch blocks
- Provide user-friendly error messages
- Log errors with context for debugging
- Use consistent formatting (markdown for rich text)
- Include usage statistics when available
- Provide actionable information to users
- Test all tools with various inputs
- Verify error handling with invalid inputs
- Test with both live and test API keys
- Test with Claude Desktop
- Verify all tools work in real scenarios
- Test error conditions
- Update examples when adding new features
- Keep API documentation current
- Update installation instructions if needed
- Document complex logic
- Explain API interactions
- Include examples in JSDoc
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name
- Make your changes
- Test thoroughly
- Update documentation
- Submit a pull request
- Clear title: Describe what the PR does
- Detailed description: Explain the changes and why they're needed
- Test results: Include testing information
- Screenshots: If applicable, include screenshots of the changes
All pull requests will be reviewed for:
- Code quality and style
- Functionality and testing
- Documentation completeness
- API integration best practices
- Issues: Report bugs and request features via GitHub Issues
- Discussions: Use GitHub Discussions for questions and ideas
- Documentation: Check the README and examples first
By contributing to this project, you agree that your contributions will be licensed under the MIT License.
Thank you for helping make the ShopSavvy Data API MCP Server better for everyone! 🛍️