Thank you for your interest in contributing to the KeeperHub MCP Server!
- Clone the repository:
git clone https://github.com/KeeperHub/keeperhub-mcp.git
cd keeperhub-mcp- Install dependencies:
pnpm install- Create a
.envfile based on.env.example:
cp .env.example .env
# Edit .env and add your KEEPERHUB_API_KEY- Run in development mode:
pnpm devkeeperhub-mcp/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── tools/ # MCP tool implementations
│ │ ├── workflows.ts # Workflow CRUD operations
│ │ ├── executions.ts # Execution management
│ │ └── generate.ts # AI workflow generation
│ ├── resources/ # MCP resource handlers
│ │ └── workflows.ts # Workflow resources
│ ├── client/ # API client
│ │ └── keeperhub.ts # KeeperHub HTTP client
│ └── types/ # TypeScript types
│ └── index.ts # Shared type definitions
- Use strict TypeScript mode
- Define proper types for all function parameters and return values
- Use
constfor immutable values,letfor mutable - Prefer interfaces for object shapes, types for unions/intersections
- Use 2 spaces for indentation
- Use single quotes for strings
- Add semicolons at the end of statements
- Use trailing commas in multi-line objects/arrays
- Files: kebab-case (e.g.,
keeperhub-client.ts) - Classes: PascalCase (e.g.,
KeeperHubClient) - Functions: camelCase (e.g.,
handleListWorkflows) - Constants: UPPER_SNAKE_CASE (e.g.,
API_KEY) - Types/Interfaces: PascalCase (e.g.,
Workflow,WorkflowExecution)
To add a new MCP tool:
- Define the Zod schema in the appropriate file in
src/tools/ - Implement the handler function
- Export the schema and handler
- Register the tool in
src/index.ts:- Add to
ListToolsRequestSchemahandler - Add case in
CallToolRequestSchemahandler
- Add to
Example:
// src/tools/my-feature.ts
import { z } from 'zod';
import type { KeeperHubClient } from '../client/keeperhub.js';
export const myToolSchema = z.object({
param: z.string().describe('Description of parameter'),
});
export async function handleMyTool(
client: KeeperHubClient,
args: z.infer<typeof myToolSchema>
) {
const result = await client.myMethod(args.param);
return {
content: [
{
type: 'text' as const,
text: JSON.stringify(result, null, 2),
},
],
};
}To add a new MCP resource:
- Create handler in
src/resources/ - Export from
src/resources/index.ts - Register in
src/index.ts:- Add to
ListResourcesRequestSchemahandler - Add URI pattern match in
ReadResourceRequestSchemahandler
- Add to
Run type checking before committing:
pnpm type-checkBuild to ensure compilation:
pnpm buildTest with a local MCP client:
# In terminal 1
pnpm dev
# In terminal 2, use an MCP client to connectdocker build -t keeperhub-mcp .
docker run -i --rm -e KEEPERHUB_API_KEY=your_key keeperhub-mcpFollow conventional commits format:
feat:New featurefix:Bug fixdocs:Documentation changesrefactor:Code refactoringtest:Test changeschore:Maintenance tasks
Example:
feat: add workflow template listing tool
Adds list_workflow_templates tool to retrieve available workflow
templates from the KeeperHub API.
- Fork the repository
- Create a feature branch:
git checkout -b feat/my-feature - Make your changes
- Run type checking and build
- Commit with a descriptive message
- Push to your fork
- Open a Pull Request
When updating the KeeperHub API client:
- Update types in
src/types/index.ts - Add methods to
src/client/keeperhub.ts - Follow the existing pattern for error handling
- Use proper TypeScript types for all parameters and return values
For questions or discussions:
- Open an issue on GitHub
- Join the KeeperHub Discord
- Email: support@keeperhub.com
By contributing, you agree that your contributions will be licensed under the MIT License.