Skip to main content
Glama

get-project-config

Retrieve the currently configured project ID from the MCP server to enable authentication system integration and framework-specific client code generation.

Instructions

현재 MCP 서버에 설정된 프로젝트 ID를 확인합니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'get-project-config' tool. It loads common documentation from the repository, constructs project setup messages based on projectId, formats the content with rules and guides, and returns it as a structured text response.
      async () => {
        // Common 문서 로드
        const commonDocs = docsRepository.getCommonDocs();
    
        // 프로젝트 설정 메시지
        let setupMessage = projectId
          ? `✅ **프로젝트 설정 완료**\n\nProject ID: ${projectId}\nAPI Endpoint: https://api.aiapp.link\nCookie Domain: .aiapp.link\n\n이 ID가 모든 예제 코드에 자동으로 적용됩니다.`
          : `⚠️ **Project ID가 설정되지 않았습니다**\n\nClaude Desktop 설정 예시:\n\`\`\`json\n{\n  "mcpServers": {\n    "baas-mcp": {\n      "command": "npx",\n      "args": ["-y", "@mbaas/baas-mcp@latest", "--project-id=your-actual-project-id"]\n    }\n  }\n}\n\`\`\`\n\n환경 변수 사용:\n\`\`\`json\n{\n  "mcpServers": {\n    "baas-mcp": {\n      "command": "npx",\n      "args": ["-y", "@mbaas/baas-mcp@latest"],\n      "env": {\n        "BAAS_PROJECT_ID": "your-actual-project-id"\n      }\n    }\n  }\n}\n\`\`\``;
    
        // Common 문서 내용 구성
        let commonDocsContent = '\n\n---\n\n# 📚 필수 구현 규칙\n\n**중요**: 아래 규칙들은 모든 BaaS API 구현 시 반드시 적용되어야 합니다.\n\n';
    
        if (commonDocs.length > 0) {
          commonDocs.forEach((doc, index) => {
            const title = doc.getTitle();
            const content = doc.getContent();
    
            commonDocsContent += `\n## ${index + 1}. ${title}\n\n`;
            commonDocsContent += content + '\n\n';
            commonDocsContent += '---\n';
          });
        } else {
          commonDocsContent += '⚠️ Common 문서를 로드할 수 없습니다.\n';
        }
    
        // 사용 안내 추가
        const usageGuide = `\n\n## 🚀 다음 단계\n\n1. **기능 검색**: \`search-documents\` 도구로 구현할 기능 검색\n   - 예: search-documents({keywords: ['로그인', 'React']})\n   - 예: search-documents({keywords: ['회원가입', 'validation']})\n\n2. **구현**: 위의 필수 규칙을 반드시 적용하여 코드 생성\n   ✅ credentials: 'include' 설정\n   ✅ result: "SUCCESS"/"FAIL" 응답 형식\n   ✅ 조건부 렌더링 사용 (display: none 금지)\n   ✅ HttpOnly 쿠키 자동 관리\n\n3. **검증**: 생성된 코드가 필수 규칙을 준수하는지 확인`;
    
        return {
          content: [{
            type: "text" as const,
            text: setupMessage + commonDocsContent + usageGuide
          }]
        };
      }
    );
  • src/server.ts:95-144 (registration)
    Registers the 'get-project-config' tool on the MCP server, including name, description, empty input schema, and inline handler reference.
      server.tool(
        "get-project-config",
        `BaaS MCP 초기 설정을 확인합니다.
    
    **중요**: 모든 기능 구현 전에 먼저 이 도구를 실행하여 다음을 확인하세요:
    1. 프로젝트 ID 설정 확인
    2. 필수 구현 규칙 로드 (보안, 에러 처리, 상태 관리)
    
    이 도구가 제공하는 필수 규칙은 모든 API 구현에 반드시 적용되어야 합니다.`,
        {
          type: "object" as const,
          properties: {}
        },
        async () => {
          // Common 문서 로드
          const commonDocs = docsRepository.getCommonDocs();
    
          // 프로젝트 설정 메시지
          let setupMessage = projectId
            ? `✅ **프로젝트 설정 완료**\n\nProject ID: ${projectId}\nAPI Endpoint: https://api.aiapp.link\nCookie Domain: .aiapp.link\n\n이 ID가 모든 예제 코드에 자동으로 적용됩니다.`
            : `⚠️ **Project ID가 설정되지 않았습니다**\n\nClaude Desktop 설정 예시:\n\`\`\`json\n{\n  "mcpServers": {\n    "baas-mcp": {\n      "command": "npx",\n      "args": ["-y", "@mbaas/baas-mcp@latest", "--project-id=your-actual-project-id"]\n    }\n  }\n}\n\`\`\`\n\n환경 변수 사용:\n\`\`\`json\n{\n  "mcpServers": {\n    "baas-mcp": {\n      "command": "npx",\n      "args": ["-y", "@mbaas/baas-mcp@latest"],\n      "env": {\n        "BAAS_PROJECT_ID": "your-actual-project-id"\n      }\n    }\n  }\n}\n\`\`\``;
    
          // Common 문서 내용 구성
          let commonDocsContent = '\n\n---\n\n# 📚 필수 구현 규칙\n\n**중요**: 아래 규칙들은 모든 BaaS API 구현 시 반드시 적용되어야 합니다.\n\n';
    
          if (commonDocs.length > 0) {
            commonDocs.forEach((doc, index) => {
              const title = doc.getTitle();
              const content = doc.getContent();
    
              commonDocsContent += `\n## ${index + 1}. ${title}\n\n`;
              commonDocsContent += content + '\n\n';
              commonDocsContent += '---\n';
            });
          } else {
            commonDocsContent += '⚠️ Common 문서를 로드할 수 없습니다.\n';
          }
    
          // 사용 안내 추가
          const usageGuide = `\n\n## 🚀 다음 단계\n\n1. **기능 검색**: \`search-documents\` 도구로 구현할 기능 검색\n   - 예: search-documents({keywords: ['로그인', 'React']})\n   - 예: search-documents({keywords: ['회원가입', 'validation']})\n\n2. **구현**: 위의 필수 규칙을 반드시 적용하여 코드 생성\n   ✅ credentials: 'include' 설정\n   ✅ result: "SUCCESS"/"FAIL" 응답 형식\n   ✅ 조건부 렌더링 사용 (display: none 금지)\n   ✅ HttpOnly 쿠키 자동 관리\n\n3. **검증**: 생성된 코드가 필수 규칙을 준수하는지 확인`;
    
          return {
            content: [{
              type: "text" as const,
              text: setupMessage + commonDocsContent + usageGuide
            }]
          };
        }
      );
  • Input schema for the 'get-project-config' tool, which takes no parameters (empty properties).
    {
      type: "object" as const,
      properties: {}
    },
  • Helper function to parse project ID from command line arguments or environment variable, used in the tool handler.
    function parseProjectId(): string | null {
      // 명령줄 인자 파싱
      const args = process.argv.slice(2);
      let projectId: string | null = null;
    
      // --project-id=value 형식 확인
      const projectIdArg = args.find(arg => arg.startsWith('--project-id='));
      if (projectIdArg) {
        projectId = projectIdArg.split('=')[1];
      } else {
        // --project-id value 형식 확인 (띄어쓰기)
        const projectIdIndex = args.findIndex(arg => arg === '--project-id');
        if (projectIdIndex !== -1 && args[projectIdIndex + 1]) {
          projectId = args[projectIdIndex + 1];
        }
      }
    
      // 환경 변수 확인 (우선순위: 명령줄 인자 > 환경변수)
      projectId = projectId || process.env.BAAS_PROJECT_ID || null;
    
      return projectId;
    }

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/mbaas-inc/BaaS-MCP'

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