Skip to main content
Glama
yywdandan

Memory Bank MCP Server

by yywdandan

create_project

Initiate and manage new projects on the Memory Bank MCP Server by defining project names and descriptions, enabling organized multi-project Markdown document handling and LLM tool integration.

Instructions

创建新项目

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNo项目描述
nameYes项目名称

Implementation Reference

  • Core handler function implementing the create_project tool logic. Validates input, creates project via storage, initializes default documents from config templates, and returns project details.
    export const createProject = async (name: string, description: string) => {
      try {
        if (!name) throw new Error('项目名称不能为空');
        
        const project = await projectStorage.create(name, description);
        
        // 为新项目创建默认文档
        const defaultDocs = [];
        for (const [type, template] of Object.entries(config.defaultDocumentTemplates)) {
          const docName = Document.getFileName(type);
          const doc = await documentStorage.create(
            project.id, 
            docName,
            template,
            type
          );
          defaultDocs.push(doc);
        }
        
        return {
          id: project.id,
          name: project.name,
          description: project.description,
          createdAt: project.createdAt,
          updatedAt: project.updatedAt,
          documents: defaultDocs.map(d => d.name)
        };
      } catch (error) {
        console.error('创建项目错误:', error);
        throw new Error('创建项目失败');
      }
    };
  • Tool registration in MCP server's listTools response, including name, description, and input schema definition.
      name: 'create_project',
      description: '创建新项目',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: '项目名称',
          },
          description: {
            type: 'string',
            description: '项目描述',
          },
        },
        required: ['name'],
      },
    },
  • Server-side dispatch handler for create_project tool calls, validates arguments and invokes the tools.createProject function.
    case 'create_project': {
      if (!args.name) {
        throw new McpError(ErrorCode.InvalidParams, '项目名称不能为空');
      }
      return this.formatResponse(await tools.createProject(
        args.name as string, 
        (args.description as string) || ''
      ));
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yywdandan/memory-bank-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server