Thank you for your interest in contributing to the Openprovider MCP Server! This document provides guidelines and instructions for contributing to this project.
Please be respectful and considerate of others when contributing to this project. We aim to foster an inclusive and welcoming community.
There are many ways to contribute to this project:
-
Reporting Bugs: If you find a bug, please create an issue with a detailed description of the problem, steps to reproduce it, and your environment details.
-
Suggesting Enhancements: If you have ideas for new features or improvements, please create an issue describing your suggestion.
-
Code Contributions: If you want to contribute code, please follow the process below.
-
Fork the Repository: Start by forking the repository to your GitHub account.
-
Clone Your Fork: Clone your fork to your local machine.
git clone git@github.com:your-username/openprovider-mcp.git cd openprovider-mcp -
Install Dependencies: Install the project dependencies.
npm install -
Create a Branch: Create a new branch for your changes.
git checkout -b feature/your-feature-name -
Make Your Changes: Implement your changes, following the coding standards and guidelines.
-
Test Your Changes: Make sure your changes work as expected and don't break existing functionality.
npm test -
Commit Your Changes: Commit your changes with a clear and descriptive commit message.
git commit -m "Add feature: your feature description" -
Push to Your Fork: Push your changes to your fork on GitHub.
git push origin feature/your-feature-name -
Create a Pull Request: Create a pull request from your fork to the main repository.
Please follow these coding standards when contributing to the project:
- TypeScript: Use TypeScript for all new code.
- Formatting: Use consistent formatting. We recommend using Prettier.
- Comments: Add comments to explain complex logic or non-obvious behavior.
- Error Handling: Properly handle errors and edge cases.
- Testing: Add tests for new functionality.
If you want to add a new tool to the MCP server, follow these steps:
-
Define the Tool: Create a new method in the
MCPServerclass insrc/server.ts. -
Define the Input Schema: Define the input schema for the tool using JSON Schema.
-
Implement the Tool: Implement the tool functionality, making API calls to Openprovider as needed.
-
Register the Tool: Register the tool in the
registerToolsmethod. -
Document the Tool: Add documentation for the tool in
docs/tools.md. -
Test the Tool: Add tests for the tool.
Example of adding a new tool:
// Define the tool method
private async renewDomain(args: any): Promise<any> {
// Validate the input
if (!args.domain_id) {
throw new Error('Domain ID is required');
}
// Make the API call
const response = await this.makeRequest('POST', '/domains/renew', {
id: args.domain_id,
period: args.period || 1
});
return response.data;
}
// Register the tool
private registerTools(): void {
// ... existing tools ...
// Register the new tool
this.tools.set('renew_domain', {
handler: this.renewDomain.bind(this),
description: 'Renew a domain registration',
inputSchema: {
type: 'object',
properties: {
domain_id: {
type: 'number',
description: 'Domain ID'
},
period: {
type: 'number',
description: 'Renewal period in years',
default: 1
}
},
required: ['domain_id']
}
});
}- Update Documentation: Update the documentation to reflect your changes.
- Add Tests: Add tests for your changes if applicable.
- Update the README: Update the README.md if necessary.
- Create a Pull Request: Create a pull request with a clear description of your changes.
By contributing to this project, you agree that your contributions will be licensed under the project's license.
If you have any questions or need help, please create an issue or contact the project maintainers.
Thank you for contributing to the Openprovider MCP Server!