# Directory Structure ``` ├── .env.example ├── .gitignore ├── Dockerfile ├── LICENSE ├── package-lock.json ├── package.json ├── README.md ├── smithery.yaml ├── src │ ├── config.ts │ ├── index.ts │ └── tools │ └── feishu.ts └── tsconfig.json ``` # Files -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- ``` FEISHU_APPID=cli_xxxx FEISHU_APPSECRET=xxxx FEISHU_TENANTTOKEN=t-xxxx FEISHU_USERTOKEN=u-xxxx ``` -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- ```dockerfile FROM node:18-alpine WORKDIR /app # Copy package files COPY package*.json ./ # Install dependencies RUN npm install # Copy application code COPY . . # Build the application RUN npm run build # Command will be provided by smithery.yaml CMD ["node", "dist/index.js"] ``` -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- ```json { "compilerOptions": { "target": "ES2020", "module": "NodeNext", "moduleResolution": "NodeNext", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, "skipLibCheck": true, "outDir": "dist", "sourceMap": true, "declaration": true }, "ts-node": { "esm": true, "experimentalSpecifierResolution": "node" }, "include": [ "src/**/*" ], "exclude": [ "node_modules", "dist" ] } ``` -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- ```json { "name": "feishu-mcp", "version": "1.0.0", "description": "飞书MCP服务器,提供多维表格API工具", "main": "dist/index.js", "type": "module", "scripts": { "build": "tsc", "start": "node dist/index.js", "dev": "node --loader ts-node/esm src/index.ts", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ "feishu", "lark", "mcp", "model-context-protocol" ], "author": "", "license": "MIT", "dependencies": { "@larksuiteoapi/node-sdk": "^1.45.0", "@modelcontextprotocol/sdk": "^1.8.0", "axios": "^1.6.0", "dotenv": "^16.4.7", "express": "^4.18.2", "zod": "^3.22.4" }, "devDependencies": { "@types/express": "^4.17.20", "@types/node": "^20.8.10", "ts-node": "^10.9.1", "typescript": "^5.2.2" } } ``` -------------------------------------------------------------------------------- /smithery.yaml: -------------------------------------------------------------------------------- ```yaml # Smithery.ai configuration startCommand: type: stdio configSchema: # JSON Schema defining the configuration options for the MCP. type: object required: - appId - appSecret properties: appId: type: string description: "feishu appId" appSecret: type: string description: "feishu appSecret" # tenantToken: # type: string # description: "feishu tenantToken" userToken: type: string description: "feishu userToken" commandFunction: # A function that produces the CLI command to start the MCP on stdio. |- (config) => ({ "command": "node", "args": [ "dist/index.js" ], "env": { FEISHU_APPID: config.appId, FEISHU_APPSECRET: config.appSecret, // FEISHU_TENANTTOKEN: config.tenantToken FEISHU_USERTOKEN: config.userToken } }) ```