init_project_kb
Initialize a project-specific knowledge base with cloud or local storage to store debugging solutions and reusable skills as you work, enabling higher rate limits for cloud storage users.
Instructions
Initialize a project-specific knowledge base with cloud storage. Returns user_id to store for future contributions. Cloud storage users get 10x rate limits (1000/hour vs 100/hour).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Unique project identifier (e.g., 'hivemind-mcp', 'my-app') | |
| project_name | Yes | Human-readable project name | |
| storage_type | No | Storage type: 'cloud' (10x limits) or 'local' (default limits) |
Implementation Reference
- src/api.ts:290-312 (handler)The core handler function for the 'init_project_kb' tool. Makes a POST request to the backend API (/init-project) to initialize a project-specific knowledge base, handling cloud or local storage types.export async function initProjectKB( projectId: string, projectName: string, storageType: 'cloud' | 'local' = 'cloud' ): Promise<InitProjectResult> { const response = await fetch(`${API_BASE}/init-project`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ project_id: projectId, project_name: projectName, storage_type: storageType }), }); if (!response.ok) { throw new Error(`Init project failed: ${response.statusText}`); } return response.json(); }
- src/index.ts:124-147 (registration)Tool registration in ListToolsRequestHandler, defining the name, description, and input schema for 'init_project_kb'.{ name: "init_project_kb", description: "Initialize a project-specific knowledge base with cloud storage. Returns user_id to store for future contributions. Cloud storage users get 10x rate limits (1000/hour vs 100/hour).", inputSchema: { type: "object", properties: { project_id: { type: "string", description: "Unique project identifier (e.g., 'hivemind-mcp', 'my-app')", }, project_name: { type: "string", description: "Human-readable project name", }, storage_type: { type: "string", enum: ["cloud", "local"], description: "Storage type: 'cloud' (10x limits) or 'local' (default limits)", }, }, required: ["project_id", "project_name"], }, },
- src/index.ts:408-417 (handler)MCP server handler dispatch in CallToolRequestHandler switch statement. Extracts arguments and calls the initProjectKB function, returning the result as text content.case "init_project_kb": { const result = await initProjectKB( args?.project_id as string, args?.project_name as string, args?.storage_type as 'cloud' | 'local' | undefined ); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
- src/api.ts:264-272 (schema)Type definition for the return value of initProjectKB, defining the expected response structure from the backend API.interface InitProjectResult { success: boolean; user_id: string; project_id: string; project_name: string; storage_type: string; rate_limit: number; message: string; }