Thank you for your interest in contributing to mcp-flutterwave! This document provides guidelines and information for contributors.
- Node.js (v18 or higher)
- npm or yarn
- A Flutterwave account with API access
- Basic knowledge of TypeScript and the Model Context Protocol (MCP)
-
Fork and clone the repository
git clone https://github.com/your-username/mcp-flutterwave.git cd mcp-flutterwave -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env # Add your Flutterwave secret key echo "FLW_SECRET_KEY=your_secret_key_here" >> .env
-
Build the project
npm run build
-
Test the MCP server
node build/index.js --tools=all
- Use TypeScript for all new code
- Follow the existing code style and formatting
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Ensure proper error handling
src/
├── client/ # Flutterwave API client
│ ├── http/ # HTTP client configuration
│ ├── lib/ # API endpoint implementations
│ ├── specs/ # OpenAPI specifications
│ └── types/ # Generated TypeScript types
├── config/ # Configuration files
├── tools/ # MCP tool implementations
├── types/ # Type definitions and schemas
└── server.ts # MCP server setup
-
Create the tool implementation in
src/tools/// src/tools/your-tool.ts import { server } from "../server.js"; import { z } from "zod"; export async function yourToolFunction(params: YourParams) { // Implementation return { content: [{ type: "text" as const, text: "Result" }] }; } export function registerYourTool() { server.tool( "your.tool.name", "Description of your tool", YourParamsSchema.shape, async (args) => { return await yourToolFunction(args); } ); }
-
Add the schema in
src/types/your-tool/schema.tsimport { z } from "zod"; export const YourParamsSchema = z.object({ param1: z.string().min(1, "Required parameter"), param2: z.number().optional() });
-
Register the tool in
src/registered-tools.ts -
Update documentation and tool lists in relevant files
When adding new Flutterwave API endpoints:
- Add OpenAPI spec in
src/client/specs/v3/ - Generate types using
npm run build:types - Implement client class in
src/client/lib/ - Export from main client in
src/client/index.ts
- Write unit tests for new functionality
- Test with actual Flutterwave API when possible
- Ensure error handling works correctly
- Test MCP tool integration with Claude Desktop
- Use conventional commit messages:
feat:for new featuresfix:for bug fixesdocs:for documentation changesrefactor:for code refactoringtest:for adding testschore:for maintenance tasks
Example:
feat: add subscription management tools
fix: handle null responses in checkout creation
docs: update README with new tool examples
Current tools that can be extended or improved:
- Transactions: Get transaction details, resend webhooks
- Checkout: Create payment links, disable links
- Plans: Create and retrieve subscription plans
- Refunds: Process transaction refunds
- Subscriptions: Manage customer subscriptions
- Ensure all types are properly imported
- Use
as constfor literal types in MCP responses - Check that Zod schemas match the expected API parameters
- Verify tool schemas use
.shapeproperty for registration - Ensure return objects match MCP content format
- Check that all async functions properly handle errors
- Verify OpenAPI specifications are accurate
- Regenerate types after spec changes:
npm run build:types - Check HTTP client configuration in
src/client/http/
-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes following the guidelines above
-
Test your changes
npm run build npm test # if tests are available
-
Commit your changes
git add . git commit -m "feat: describe your changes"
-
Push and create a pull request
git push origin feature/your-feature-name
-
Fill out the PR template with:
- Description of changes
- Testing performed
- Any breaking changes
- Screenshots if applicable
- All contributions require review
- Address feedback promptly
- Ensure CI checks pass
- Maintain backward compatibility when possible
- Open an issue for bugs or feature requests
- Join discussions in existing issues
- Check the MCP documentation for protocol details
- Review Flutterwave API docs for API details
By contributing, you agree that your contributions will be licensed under the same license as the project.