# 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:
--------------------------------------------------------------------------------
```
1 | FEISHU_APPID=cli_xxxx
2 | FEISHU_APPSECRET=xxxx
3 | FEISHU_TENANTTOKEN=t-xxxx
4 | FEISHU_USERTOKEN=u-xxxx
5 |
```
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
```dockerfile
1 | FROM node:18-alpine
2 |
3 | WORKDIR /app
4 |
5 | # Copy package files
6 | COPY package*.json ./
7 |
8 | # Install dependencies
9 | RUN npm install
10 |
11 | # Copy application code
12 | COPY . .
13 |
14 | # Build the application
15 | RUN npm run build
16 |
17 | # Command will be provided by smithery.yaml
18 | CMD ["node", "dist/index.js"]
```
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
```json
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "module": "NodeNext",
5 | "moduleResolution": "NodeNext",
6 | "esModuleInterop": true,
7 | "forceConsistentCasingInFileNames": true,
8 | "strict": true,
9 | "skipLibCheck": true,
10 | "outDir": "dist",
11 | "sourceMap": true,
12 | "declaration": true
13 | },
14 | "ts-node": {
15 | "esm": true,
16 | "experimentalSpecifierResolution": "node"
17 | },
18 | "include": [
19 | "src/**/*"
20 | ],
21 | "exclude": [
22 | "node_modules",
23 | "dist"
24 | ]
25 | }
```
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
```json
1 | {
2 | "name": "feishu-mcp",
3 | "version": "1.0.0",
4 | "description": "飞书MCP服务器,提供多维表格API工具",
5 | "main": "dist/index.js",
6 | "type": "module",
7 | "scripts": {
8 | "build": "tsc",
9 | "start": "node dist/index.js",
10 | "dev": "node --loader ts-node/esm src/index.ts",
11 | "test": "echo \"Error: no test specified\" && exit 1"
12 | },
13 | "keywords": [
14 | "feishu",
15 | "lark",
16 | "mcp",
17 | "model-context-protocol"
18 | ],
19 | "author": "",
20 | "license": "MIT",
21 | "dependencies": {
22 | "@larksuiteoapi/node-sdk": "^1.45.0",
23 | "@modelcontextprotocol/sdk": "^1.8.0",
24 | "axios": "^1.6.0",
25 | "dotenv": "^16.4.7",
26 | "express": "^4.18.2",
27 | "zod": "^3.22.4"
28 | },
29 | "devDependencies": {
30 | "@types/express": "^4.17.20",
31 | "@types/node": "^20.8.10",
32 | "ts-node": "^10.9.1",
33 | "typescript": "^5.2.2"
34 | }
35 | }
36 |
```
--------------------------------------------------------------------------------
/smithery.yaml:
--------------------------------------------------------------------------------
```yaml
1 | # Smithery.ai configuration
2 | startCommand:
3 | type: stdio
4 | configSchema:
5 | # JSON Schema defining the configuration options for the MCP.
6 | type: object
7 | required:
8 | - appId
9 | - appSecret
10 | properties:
11 | appId:
12 | type: string
13 | description: "feishu appId"
14 | appSecret:
15 | type: string
16 | description: "feishu appSecret"
17 | # tenantToken:
18 | # type: string
19 | # description: "feishu tenantToken"
20 | userToken:
21 | type: string
22 | description: "feishu userToken"
23 |
24 | commandFunction:
25 | # A function that produces the CLI command to start the MCP on stdio.
26 | |-
27 | (config) => ({
28 | "command": "node",
29 | "args": [
30 | "dist/index.js"
31 | ],
32 | "env": {
33 | FEISHU_APPID: config.appId,
34 | FEISHU_APPSECRET: config.appSecret,
35 | // FEISHU_TENANTTOKEN: config.tenantToken
36 | FEISHU_USERTOKEN: config.userToken
37 | }
38 | })
39 |
```