{"_id":"@akaknele/feishu-wiki-mcp","_rev":"10-8fe961ab10cff85478a12b95fe410d91","name":"@akaknele/feishu-wiki-mcp","dist-tags":{"latest":"1.3.1"},"versions":{"1.0.2":{"name":"@akaknele/feishu-wiki-mcp","version":"1.0.2","keywords":["mcp","feishu","lark","wiki","bitable","tooling"],"author":{"name":"Your Name"},"license":"MIT","_id":"@akaknele/feishu-wiki-mcp@1.0.2","maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"bin":{"feishu-wiki-mcp":"build/index.js"},"dist":{"shasum":"d6096fb52ee0d0519cfca00af97528bff965b1d8","tarball":"https://registry.npmjs.org/@akaknele/feishu-wiki-mcp/-/feishu-wiki-mcp-1.0.2.tgz","fileCount":3,"integrity":"sha512-kUz9Q7ufBhPMRwg7FSALVXj1Gzo+yrkMU16h/mLyMF5a92aG0NHFJFgqylCCxQCkU/gtlXhKpHRsKKzT6waaHg==","signatures":[{"sig":"MEQCIAZeATMqqAwdJzy05bhiuW35zKtmPuOE1P74aQ0XlD8YAiBvMequuPKXFEIrqie7T8VwgFgZTESvD2qg7GmXITYHmA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47416},"main":"build/index.js","type":"module","engines":{"node":">=20.0.0"},"scripts":{"build":"tsc","start":"node build/index.js","prepare":"npm run build","prepublishOnly":"npm run build"},"_npmUser":{"name":"akaken","email":"akakenle@gmail.com"},"_npmVersion":"11.3.0","description":"Feishu Wiki MCP Server - 飞书知识库管理工具","directories":{},"_nodeVersion":"23.6.1","dependencies":{"zod":"^3.24.0","typescript":"^5.9.3","@types/node":"^20.19.33","@modelcontextprotocol/sdk":"^1.12.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/feishu-wiki-mcp_1.0.2_1771396709473_0.06988405809642839","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@akaknele/feishu-wiki-mcp","version":"1.0.3","keywords":["mcp","feishu","lark","wiki","bitable","tooling"],"author":{"name":"Your Name"},"license":"MIT","_id":"@akaknele/feishu-wiki-mcp@1.0.3","maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"bin":{"feishu-wiki-mcp":"build/index.js"},"dist":{"shasum":"8cf478e7700dd001120383872ee370e062fa86a3","tarball":"https://registry.npmjs.org/@akaknele/feishu-wiki-mcp/-/feishu-wiki-mcp-1.0.3.tgz","fileCount":3,"integrity":"sha512-hb+juSq9w2auhUPAcKIGbAp6Ydsi45kcFQtfLQUDUsfOryjHG/eZNOWuXb9g94OMxWvnDqJX1aonWwv+o+kEgA==","signatures":[{"sig":"MEUCIQDIZGOAO4gek+UukspE/8hl9hZcnNM6o2B6omSQpJBg+gIgbxYCyAl5IeKENvixs3Bgk0nEhPuzriQ+j9c+XlXEd/U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47416},"main":"build/index.js","type":"module","engines":{"node":">=20.0.0"},"scripts":{"build":"tsc","start":"node build/index.js","prepare":"npm run build","prepublishOnly":"npm run build"},"_npmUser":{"name":"akaken","email":"akakenle@gmail.com"},"_npmVersion":"11.3.0","description":"Feishu Wiki MCP Server - 飞书知识库管理工具","directories":{},"_nodeVersion":"23.6.1","dependencies":{"zod":"^3.24.0","typescript":"^5.9.3","@types/node":"^20.19.33","@modelcontextprotocol/sdk":"^1.12.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/feishu-wiki-mcp_1.0.3_1771397054729_0.8741346322709171","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@akaknele/feishu-wiki-mcp","version":"1.0.4","keywords":["mcp","feishu","lark","wiki","bitable","tooling"],"author":{"name":"Your Name"},"license":"MIT","_id":"@akaknele/feishu-wiki-mcp@1.0.4","maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"bin":{"feishu-wiki-mcp":"build/index.js"},"dist":{"shasum":"138b243741622a2274cc7408c2da730ef3a03940","tarball":"https://registry.npmjs.org/@akaknele/feishu-wiki-mcp/-/feishu-wiki-mcp-1.0.4.tgz","fileCount":3,"integrity":"sha512-O2U6jWQC15VrseC9AocIGBuAHbHdhUiFiYJxDYkSlUnfU298uEx0NGBMrNPP5sfWo5n7KoRdKPGhqqGwkzYHtw==","signatures":[{"sig":"MEUCIQDr/FbSZ5P0bK/ILgqJ9aolnCuzHg29k+NxtwH2H09eAgIgQ2FU9UQXV2ZMTCRK2elIHirvdVKAFjbIlXWHW+w3z4I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47416},"main":"build/index.js","type":"module","engines":{"node":">=20.0.0"},"scripts":{"build":"tsc","start":"node build/index.js","prepare":"npm run build","prepublishOnly":"npm run build"},"_npmUser":{"name":"akaken","email":"akakenle@gmail.com"},"_npmVersion":"11.3.0","description":"Feishu Wiki MCP Server - 飞书知识库管理工具","directories":{},"_nodeVersion":"23.6.1","dependencies":{"zod":"^3.24.0","typescript":"^5.9.3","@types/node":"^20.19.33","@modelcontextprotocol/sdk":"^1.12.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/feishu-wiki-mcp_1.0.4_1771397246180_0.8204010696708033","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@akaknele/feishu-wiki-mcp","version":"1.0.5","keywords":["mcp","feishu","lark","wiki","bitable","tooling"],"author":{"name":"Your Name"},"license":"MIT","_id":"@akaknele/feishu-wiki-mcp@1.0.5","maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"bin":{"feishu-wiki-mcp":"build/index.js"},"dist":{"shasum":"888c687f52f52042339bc2c139843c3a693b19f7","tarball":"https://registry.npmjs.org/@akaknele/feishu-wiki-mcp/-/feishu-wiki-mcp-1.0.5.tgz","fileCount":3,"integrity":"sha512-teB+ts7z4ujIbMvPDGcViR4mizGiSVkAOSW8yEBAuwt42Z7ld7w2SURtb7Gte4pwFkDobBmQeNqlTV7abk/t8w==","signatures":[{"sig":"MEYCIQDaXLCJqMPYbPnT/rhz1ZnpsHh0U9NjFIMJ1PcWwOmqdQIhAIznsmtPVAJb81QTI2BGn6l292nKwdqnRQ4aQVwwr7JQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48645},"main":"build/index.js","type":"module","engines":{"node":">=20.0.0"},"scripts":{"build":"tsc","start":"node build/index.js","prepare":"npm run build","prepublishOnly":"npm run build"},"_npmUser":{"name":"akaken","email":"akakenle@gmail.com"},"_npmVersion":"11.3.0","description":"Feishu Wiki MCP Server - 飞书知识库管理工具","directories":{},"_nodeVersion":"23.6.1","dependencies":{"zod":"^3.24.0","typescript":"^5.9.3","@types/node":"^20.19.33","@modelcontextprotocol/sdk":"^1.12.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/feishu-wiki-mcp_1.0.5_1771398503612_0.43524076943011436","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@akaknele/feishu-wiki-mcp","version":"1.0.6","keywords":["mcp","feishu","lark","wiki","bitable","tooling"],"author":{"name":"Your Name"},"license":"MIT","_id":"@akaknele/feishu-wiki-mcp@1.0.6","maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"bin":{"feishu-wiki-mcp":"build/index.js"},"dist":{"shasum":"979b8c9364d51a7cee3253cc5a371a85ed4ffbd1","tarball":"https://registry.npmjs.org/@akaknele/feishu-wiki-mcp/-/feishu-wiki-mcp-1.0.6.tgz","fileCount":3,"integrity":"sha512-PXTcQYT76x7mCNzxZifbVIqFFr79ZWJGdtusQghpet9zLh1Ipqjh8ty9msT8WnGC18E5rFaGH+Tnl9UE/cQCug==","signatures":[{"sig":"MEUCIQCMQ+WJfxSWsBQ6Lanxdp3Ewn8bbQKZCPXbcMttIwXUzwIgaXLzzg4yQU9DJ3eDOkS2EKyhSKZ7bsJYSAKI5B2OfEk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48645},"main":"build/index.js","type":"module","engines":{"node":">=20.0.0"},"scripts":{"build":"tsc","start":"node build/index.js","prepare":"npm run build","prepublishOnly":"npm run build"},"_npmUser":{"name":"akaken","email":"akakenle@gmail.com"},"_npmVersion":"11.3.0","description":"Feishu Wiki MCP Server - 飞书知识库管理工具","directories":{},"_nodeVersion":"23.6.1","dependencies":{"zod":"^3.24.0","typescript":"^5.9.3","@types/node":"^20.19.33","@modelcontextprotocol/sdk":"^1.12.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/feishu-wiki-mcp_1.0.6_1771399148896_0.9484080667200006","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@akaknele/feishu-wiki-mcp","version":"1.0.7","keywords":["mcp","feishu","lark","wiki","bitable","tooling"],"author":{"name":"Your Name"},"license":"MIT","_id":"@akaknele/feishu-wiki-mcp@1.0.7","maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"bin":{"feishu-wiki-mcp":"build/index.js"},"dist":{"shasum":"129d6c9c66da31b5ba90cdcde0df94ec5f16082a","tarball":"https://registry.npmjs.org/@akaknele/feishu-wiki-mcp/-/feishu-wiki-mcp-1.0.7.tgz","fileCount":3,"integrity":"sha512-laydSyykxiqel4dgxYl9EvAzYKIiN7F0cB+W3fH1RSKdQDl/D2yWbGPtG0rKxbxvBYapnoypseF9KpdpqJn91g==","signatures":[{"sig":"MEQCIBGtPqswKWzAiSxzVcNYak5XT+222IQHw2td4VE0VvP3AiANnbHFtjgkivs4bzwQygPAEANraqkpG0CjBFRxTLi+Cw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":55464},"main":"build/index.js","type":"module","engines":{"node":">=20.0.0"},"scripts":{"build":"tsc","start":"node build/index.js","prepare":"npm run build","prepublishOnly":"npm run build"},"_npmUser":{"name":"akaken","email":"akakenle@gmail.com"},"_npmVersion":"11.3.0","description":"Feishu Wiki MCP Server - 飞书知识库管理工具","directories":{},"_nodeVersion":"23.6.1","dependencies":{"zod":"^3.24.0","typescript":"^5.9.3","@types/node":"^20.19.33","@modelcontextprotocol/sdk":"^1.12.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/feishu-wiki-mcp_1.0.7_1771408598741_0.48687387400595283","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@akaknele/feishu-wiki-mcp","version":"1.1.0","keywords":["mcp","feishu","lark","wiki","bitable","tooling"],"author":{"name":"Your Name"},"license":"MIT","_id":"@akaknele/feishu-wiki-mcp@1.1.0","maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"bin":{"feishu-wiki-mcp":"build/index.js"},"dist":{"shasum":"c3db5f4bbd846e78f60862cedcbd6439858f6e50","tarball":"https://registry.npmjs.org/@akaknele/feishu-wiki-mcp/-/feishu-wiki-mcp-1.1.0.tgz","fileCount":3,"integrity":"sha512-YteoC476Oxu9KpaZ71YjwDgy/RhzIDT3GwzBJJN2S+ARwZYmGM1I4FwqXeBhPY+qXYkFy53y1yP2xRpNMzgOWQ==","signatures":[{"sig":"MEYCIQCJCQgB5w4SM+f7ZoFBRHg0GN6fYN9VGVxnj7jgiH1KSQIhAMh7rEODBjqG5+OSTG90WwbWI5zss5gFBq6n9F5vikzv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69640},"main":"build/index.js","type":"module","engines":{"node":">=20.0.0"},"scripts":{"start":"node build/index.js"},"_npmUser":{"name":"akaken","email":"akakenle@gmail.com"},"_npmVersion":"11.3.0","description":"Feishu Wiki MCP Server - 飞书知识库管理工具","directories":{},"_nodeVersion":"23.6.1","dependencies":{"zod":"^3.24.0","typescript":"^5.9.3","@types/node":"^20.19.33","@modelcontextprotocol/sdk":"^1.12.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/feishu-wiki-mcp_1.1.0_1771410421624_0.33518936943876465","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@akaknele/feishu-wiki-mcp","version":"1.2.0","keywords":["mcp","feishu","lark","wiki","bitable","tooling"],"author":{"name":"Your Name"},"license":"MIT","_id":"@akaknele/feishu-wiki-mcp@1.2.0","maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"bin":{"feishu-wiki-mcp":"build/index.js"},"dist":{"shasum":"8c3f4049201d529339a9ae4d588275eb8b6ea08e","tarball":"https://registry.npmjs.org/@akaknele/feishu-wiki-mcp/-/feishu-wiki-mcp-1.2.0.tgz","fileCount":3,"integrity":"sha512-548Uv6ToPbrl3DusQbBRkVMBfcJgUZkMU+pVTKf1xSswoxhCPw4rcPASDdotvZOynY1O86nOMzrRtp+IGc3tNQ==","signatures":[{"sig":"MEUCIEcdwUSZgkkrMCyx7UhZwZaVcV7dV1DzJNx63uvPw/Y/AiEA372BevzbLymh9NYbZC6gFSIKYCO+jKovG3w23ZO2UYo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71887},"main":"build/index.js","type":"module","engines":{"node":">=20.0.0"},"scripts":{"start":"node build/index.js"},"_npmUser":{"name":"akaken","email":"akakenle@gmail.com"},"_npmVersion":"11.3.0","description":"Feishu Wiki MCP Server - 飞书知识库管理工具","directories":{},"_nodeVersion":"23.6.1","dependencies":{"zod":"^3.24.0","typescript":"^5.9.3","@types/node":"^20.19.33","@modelcontextprotocol/sdk":"^1.12.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/feishu-wiki-mcp_1.2.0_1771412767753_0.13367319839229985","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@akaknele/feishu-wiki-mcp","version":"1.3.0","keywords":["mcp","feishu","lark","wiki","bitable","tooling"],"author":{"name":"Your Name"},"license":"MIT","_id":"@akaknele/feishu-wiki-mcp@1.3.0","maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"bin":{"feishu-wiki-mcp":"build/index.js"},"dist":{"shasum":"cb1dd10789bdf7f9d9c99f326d09702258394d99","tarball":"https://registry.npmjs.org/@akaknele/feishu-wiki-mcp/-/feishu-wiki-mcp-1.3.0.tgz","fileCount":3,"integrity":"sha512-VmqHVnqqGyKJUVT6nitME8fZITdnUOYoaBSiLSizwrpY71xwwfNwms+gHDva58MZBTejWTTdq+8aSIIBDuTL1w==","signatures":[{"sig":"MEQCIH24WOED6aLU5PkRRxnplD/CNT8E70DgO/D9FX4FVaiRAiB/GqSBJY2H+qU6B7F+tKAekJCXoK1bkCEhW6eUENje2Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":86556},"main":"build/index.js","type":"module","engines":{"node":">=20.0.0"},"scripts":{"start":"node build/index.js"},"_npmUser":{"name":"akaken","email":"akakenle@gmail.com"},"_npmVersion":"11.3.0","description":"Feishu Wiki MCP Server - 飞书知识库管理工具","directories":{},"_nodeVersion":"23.6.1","dependencies":{"zod":"^3.24.0","typescript":"^5.9.3","@types/node":"^20.19.33","@modelcontextprotocol/sdk":"^1.12.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/feishu-wiki-mcp_1.3.0_1771417323468_0.5215011094072182","host":"s3://npm-registry-packages-npm-production"}},"1.3.1":{"name":"@akaknele/feishu-wiki-mcp","version":"1.3.1","description":"Feishu Wiki MCP Server - 飞书知识库管理工具","license":"MIT","author":{"name":"Your Name"},"keywords":["mcp","feishu","lark","wiki","bitable","tooling"],"type":"module","main":"build/index.js","bin":{"feishu-wiki-mcp":"build/index.js"},"engines":{"node":">=20.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"scripts":{"start":"node build/index.js"},"dependencies":{"@modelcontextprotocol/sdk":"^1.12.1","@types/node":"^20.19.33","typescript":"^5.9.3","zod":"^3.24.0"},"_id":"@akaknele/feishu-wiki-mcp@1.3.1","_nodeVersion":"23.6.1","_npmVersion":"11.3.0","dist":{"integrity":"sha512-J+G0Z8cmAKHVlyFBQD2/0FAkNKSyTjWE4hVxYgTApua8khHTAH6xXeBZGNtkxKtfDKZ9LlNN+fBcQp9CkADP4A==","shasum":"db11b7d38ddb4b7169175a818704506b978d9448","tarball":"https://registry.npmjs.org/@akaknele/feishu-wiki-mcp/-/feishu-wiki-mcp-1.3.1.tgz","fileCount":3,"unpackedSize":90269,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCwYqf/TcUNRw0lzMXXa870uZOF09AqdwcD/X7UYW12ZgIhAPmHgVnEgl3j2Qe74UQKCoMOuHmP/aVc6KGG+oX5MKoN"}]},"_npmUser":{"name":"akaken","email":"akakenle@gmail.com"},"directories":{},"maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/feishu-wiki-mcp_1.3.1_1771431382237_0.29177354252278276"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-18T06:38:29.385Z","modified":"2026-02-18T16:16:22.554Z","1.0.2":"2026-02-18T06:38:29.598Z","1.0.3":"2026-02-18T06:44:14.964Z","1.0.4":"2026-02-18T06:47:26.319Z","1.0.5":"2026-02-18T07:08:23.815Z","1.0.6":"2026-02-18T07:19:09.077Z","1.0.7":"2026-02-18T09:56:38.874Z","1.1.0":"2026-02-18T10:27:01.782Z","1.2.0":"2026-02-18T11:06:07.934Z","1.3.0":"2026-02-18T12:22:03.622Z","1.3.1":"2026-02-18T16:16:22.385Z"},"author":{"name":"Your Name"},"license":"MIT","keywords":["mcp","feishu","lark","wiki","bitable","tooling"],"description":"Feishu Wiki MCP Server - 飞书知识库管理工具","maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"readme":"# 飞书 MCP 使用指南（feishu-wiki-mcp）\n\n本项目是**面向 MCP 客户端的飞书服务网关**，运行时通过飞书开放平台 API 提供标准化工具调用。\n\n- 运行时：Node.js >= 20 + stdio transport（`@modelcontextprotocol/sdk`）\n- 入口：`build/index.js`\n- 当前版本：`1.3.0`\n- 包名：`@akaknele/feishu-wiki-mcp`\n- 当前可用 Tool：36 个\n\n## 一、部署与启动方式\n\n### 1. 开发构建与本地运行\n\n```bash\nnpm install\nnpm run build\nnpm start -- --app-id <APP_ID> --app-secret <APP_SECRET>\n```\n\n### 2. OAuth 模式（用于用户授权）\n\n适用于需要用户级权限（`user token`）的场景：\n\n```bash\nnpm start -- --app-id <APP_ID> --app-secret <APP_SECRET> --oauth --port 3001\n```\n\n### 2b. 预置 Token 模式（无浏览器，适合第三方 MCP 客户端）\n\n当第三方应用（Claude Desktop、Cursor 等）安装 MCP 无法弹出浏览器时，可提前获取 user token 后通过参数或环境变量传入，完全跳过 OAuth 授权流程：\n\n```bash\n# 命令行参数\nfeishu-wiki-mcp --app-id <APP_ID> --app-secret <APP_SECRET> \\\n  --user-token <USER_ACCESS_TOKEN> \\\n  --refresh-token <REFRESH_TOKEN>\n\n# 或环境变量（推荐）\nFEISHU_APP_ID=cli_xxx \\\nFEISHU_APP_SECRET=secret_xxx \\\nFEISHU_USER_TOKEN=u-xxx \\\nFEISHU_REFRESH_TOKEN=ur-xxx \\\nfeishu-wiki-mcp\n```\n\nMCP 客户端配置示例：\n\n```json\n{\n  \"mcpServers\": {\n    \"feishu-wiki-mcp\": {\n      \"command\": \"feishu-wiki-mcp\",\n      \"args\": [\"--app-id\", \"<APP_ID>\", \"--app-secret\", \"<APP_SECRET>\"],\n      \"env\": {\n        \"FEISHU_USER_TOKEN\": \"<USER_ACCESS_TOKEN>\",\n        \"FEISHU_REFRESH_TOKEN\": \"<REFRESH_TOKEN>\"\n      }\n    }\n  }\n}\n```\n\n> token 过期后会自动用 `refresh_token` 刷新；refresh_token 也过期则报错，需重新获取。\n\n### 2c. 如何获取 User Token\n\n预置模式需要提前拿到 `user_access_token` 和 `refresh_token`，有以下三种方式：\n\n#### 方式一：运行一次 `--oauth`，从缓存文件提取（推荐）\n\n在**有浏览器的机器**上完成一次授权：\n\n```bash\nfeishu-wiki-mcp --app-id cli_xxx --app-secret xxx --oauth --port 3001\n```\n\n授权成功后读取缓存文件：\n\n```bash\ncat ~/.feishu-wiki-mcp-token.json\n```\n\n输出示例：\n\n```json\n{\n  \"access_token\": \"u-xxx...\",\n  \"refresh_token\": \"ur-xxx...\",\n  \"expires_at\": 1234567890000,\n  \"refresh_expires_at\": 9876543210000\n}\n```\n\n将 `access_token` 和 `refresh_token` 填入环境变量即可。`refresh_token` 有效期约 30 天，MCP 会自动续期 `access_token`，正常使用无感知。\n\n#### 方式二：飞书开放平台 API 调试台（无需写代码）\n\n1. 打开 [open.feishu.cn](https://open.feishu.cn) → 进入你的应用\n2. 左侧菜单选择 **\"开发工具 → API 调试台\"**\n3. 右上角鉴权方式选择 **\"用户身份（user_access_token）\"**，点击授权登录\n4. 授权完成后，调试台会自动填入 token，复制即可\n\n#### 方式三：手动 OAuth 换 token（Shell 脚本）\n\n适合自动化脚本场景，需要一个可访问的回调地址（本地 localhost 即可）：\n\n```bash\n# 替换为你的 App ID / Secret\nAPP_ID=\"cli_xxx\"\nAPP_SECRET=\"xxx\"\nPORT=3001\n\n# Step 1：用浏览器打开授权 URL，完成后从地址栏取 code 参数\nSCOPES=\"wiki:wiki docx:document drive:drive bitable:bitable im:message contact:user.id:readonly\"\necho \"请用浏览器访问以下地址完成授权：\"\necho \"https://open.feishu.cn/open-apis/authen/v1/index?app_id=${APP_ID}&redirect_uri=http%3A%2F%2Flocalhost%3A${PORT}%2Fcallback&scope=$(python3 -c \"import urllib.parse; print(urllib.parse.quote('${SCOPES}'))\")\"\necho \"\"\nread -p \"粘贴回调 URL 中的 code 参数值: \" CODE\n\n# Step 2：获取 app_access_token\nAPP_TOKEN=$(curl -s -X POST \"https://open.feishu.cn/open-apis/auth/v3/app_access_token/internal\" \\\n  -H \"Content-Type: application/json\" \\\n  -d \"{\\\"app_id\\\":\\\"${APP_ID}\\\",\\\"app_secret\\\":\\\"${APP_SECRET}\\\"}\" | jq -r .app_access_token)\n\n# Step 3：用 code 换 user_access_token + refresh_token\ncurl -s -X POST \"https://open.feishu.cn/open-apis/authen/v1/oidc/access_token\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer ${APP_TOKEN}\" \\\n  -d \"{\\\"grant_type\\\":\\\"authorization_code\\\",\\\"code\\\":\\\"${CODE}\\\"}\" | jq '{access_token: .data.access_token, refresh_token: .data.refresh_token}'\n```\n\n运行后输出的 `access_token` 和 `refresh_token` 即可填入环境变量。\n\n#### Token 有效期说明\n\n| Token | 有效期 | 过期行为 |\n|-------|--------|---------|\n| `user_access_token` | ~2 小时 | MCP 自动用 refresh_token 续期 |\n| `refresh_token` | ~30 天 | 需重新走上述任一方式获取 |\n\n### 3. 安装后直接运行\n\n```bash\nnpm install -g @akaknele/feishu-wiki-mcp@1.3.0\nfeishu-wiki-mcp --app-id <APP_ID> --app-secret <APP_SECRET>\n```\n\n或使用 npx：\n\n```bash\nnpx @akaknele/feishu-wiki-mcp@1.3.0 --app-id <APP_ID> --app-secret <APP_SECRET>\n```\n\n### 4. MCP 客户端接入（示例）\n\n```json\n{\n  \"mcpServers\": {\n    \"feishu-wiki-mcp\": {\n      \"command\": \"feishu-wiki-mcp\",\n      \"args\": [\"--app-id\", \"<APP_ID>\", \"--app-secret\", \"<APP_SECRET>\"]\n    }\n  }\n}\n```\n\nOAuth 模式示例：\n\n```json\n{\n  \"mcpServers\": {\n    \"feishu-wiki-mcp\": {\n      \"command\": \"feishu-wiki-mcp\",\n      \"args\": [\"--app-id\", \"<APP_ID>\", \"--app-secret\", \"<APP_SECRET>\", \"--oauth\", \"--port\", \"3001\"]\n    }\n  }\n}\n```\n\n## 二、外网网络（OAuth）要求\n\n若在企业内网/防火墙下运行，需要放行：\n\n- `https://open.feishu.cn`\n- `https://openapi.*.feishu.cn`（飞书 API 域名）\n\nOAuth 回调地址默认为：\n\n- `http://localhost:3001/callback`\n\n因此对应机器的 `3001` 端口需要可访问（对本机浏览器即可），并且回调 URL 能回传到该本机实例。\n\n## 三、核心流程\n\n1. 启动服务并通过参数选择 tenant 模式或 OAuth 模式\n2. MCP 客户端请求对应 tool\n3. 服务器内部自动获取并刷新 token（`~/.feishu-wiki-mcp-token.json`）\n4. 使用 token 调用飞书接口并返回结构化 JSON\n\n## 四、工具清单（36）\n\n### 工具清单质量说明\n\n每个工具都以 MCP tool schema 的实际参数定义为准，`返回值`默认为飞书 API 的 `JSON` 响应文本。\n\n### 知识库（Wiki）\n\n| 工具 | 用途 | 必填参数 | 可选参数 |\n| --- | --- | --- | --- |\n| `wiki_list_spaces` | 列出当前用户可见知识库 | 无 | `page_size`（1-50）, `page_token` |\n| `wiki_get_space` | 获取知识库详情 | `space_id` | 无 |\n| `wiki_list_nodes` | 列出知识库子节点（默认顶层） | `space_id` | `parent_node_token`, `page_size`（1-50）, `page_token` |\n| `wiki_get_node` | 通过 wiki token 或文档 token 获取节点 | `token` | `obj_type`（doc/docx/sheet/mindnote/bitable/file/slides/wiki） |\n| `wiki_create_node` | 创建知识库节点（文档/表格等） | `space_id`, `obj_type` | `parent_node_token`, `node_type`（origin/shortcut, 默认 origin）, `title` |\n| `wiki_move_node` | 在知识库内移动节点 | `space_id`, `node_token` | `target_parent_token`, `target_space_id` |\n| `wiki_move_docs_to_wiki` | 将云空间文档移动进知识库 | `space_id`, `obj_type`, `obj_token` | `parent_wiki_token` |\n| `wiki_update_title` | 更新节点标题 | `space_id`, `node_token`, `title` | 无 |\n| `wiki_copy_node` | 复制节点（可跨库） | `space_id`, `node_token` | `target_parent_token`, `target_space_id`, `title` |\n| `wiki_search` | 搜索知识库节点 | `query` | `space_id`, `page_size`, `page_token` |\n| `wiki_create_node_with_markdown` | **🆕** 一步创建带 Markdown 内容的 wiki 文档（上传→转换→移入知识库） | `space_id`, `markdown` | `title`（<=27 字符）, `parent_node_token` |\n\n### 文档（Docx）\n\n| 工具 | 用途 | 必填参数 | 可选参数 |\n| --- | --- | --- | --- |\n| `doc_get_raw_content` | 获取文档纯文本内容 | `document_id` | 无 |\n| `doc_search` | 搜索云文档 | `search_key` | `count`（0-50）, `offset`, `owner_ids`, `docs_types` |\n| `doc_import` | 导入 Markdown 创建飞书文档（自动上传 → 转换 docx）。**🆕 v1.3**: 可选传入 `space_id` 直接写入知识库 | `markdown` | `file_name`（<=27 字符）, `folder_token`, `space_id`（传入后自动移入知识库）, `parent_wiki_token` |\n| `doc_list_blocks` | 列出文档所有块 | `document_id` | `page_size`（1-500）, `page_token`, `document_revision_id` |\n| `doc_get_block` | 获取指定块详情 | `document_id`, `block_id` | `document_revision_id` |\n| `doc_create_blocks` | 在指定父块下插入子块。**🆕 v1.3**: 补全所有 block_type 文档 + 客户端参数校验 | `document_id`, `block_id`, `children` | `index`（插入位置，默认追加） |\n| `doc_update_block` | 更新指定块内容（PATCH） | `document_id`, `block_id`, `update` | 无 |\n| `doc_delete_blocks` | 删除父块下指定区间的子块 | `document_id`, `block_id`, `start_index`, `end_index` | 无 |\n\n### 多维表格（Bitable）\n\n| 工具 | 用途 | 必填参数 | 可选参数 |\n| --- | --- | --- | --- |\n| `bitable_create_app` | 创建多维表格应用 | 无 | `name`, `folder_token` |\n| `bitable_list_tables` | 列出应用内表 | `app_token` | `page_size`, `page_token` |\n| `bitable_create_table` | 创建数据表 | `app_token`, `name` | `default_view_name`, `fields`（字段列表） |\n| `bitable_list_fields` | 列出表字段 | `app_token`, `table_id` | `page_size`, `page_token` |\n| `bitable_search_records` | 条件筛选记录 | `app_token`, `table_id` | `field_names`, `filter`（`conjunction`+`conditions`）, `sort`, `page_size`（<=500）, `page_token` |\n| `bitable_create_record` | 新增记录 | `app_token`, `table_id`, `fields` | 无 |\n| `bitable_update_record` | 更新记录 | `app_token`, `table_id`, `record_id`, `fields` | 无 |\n\n### IM 与联系人\n\n| 工具 | 用途 | 必填参数 | 可选参数 |\n| --- | --- | --- | --- |\n| `im_send_message` | 发送消息（文本/卡片等） | `receive_id`, `receive_id_type`, `msg_type`, `content` | 无 |\n| `im_list_messages` | 获取聊天历史 | `container_id` | `container_id_type`（chat/thread，默认 chat）, `start_time`, `end_time`, `sort_type`, `page_size`, `page_token` |\n| `im_list_chats` | 获取用户/机器人群聊列表 | 无 | `page_size`, `page_token`, `sort_type` |\n| `im_create_chat` | 创建群聊 | 无 | `name`, `description`, `chat_type`（private/public）, `user_id_list`, `owner_id` |\n| `im_get_chat_members` | 获取群成员 | `chat_id` | `page_size`, `page_token` |\n| `contact_batch_get_user_id` | 批量通过邮箱/手机号查用户 ID | 无 | `emails`（每项 string, 最多 50）, `mobiles`（每项 string, 最多 50） |\n\n### 权限与删除\n\n| 工具 | 用途 | 必填参数 | 可选参数 |\n| --- | --- | --- | --- |\n| `drive_add_permission` | 为云文档添加协作者权限 | `token`, `type`, `member_id`, `member_type`, `perm` | 无 |\n| `wiki_delete_node` | 将 wiki 节点移出到云空间根目录（第一步）；之后用 `drive_delete_file` 彻底删除（飞书无公开 wiki 删除 API） | `space_id`, `node_token`（wiki node token，非 obj_token） | 无 |\n| `drive_upload_file` | **🆕** 上传文件到云空间（base64），获取 `file_token` 用于插入图片等 | `file_name`, `base64` | `parent_type`（默认 explorer）, `parent_node` |\n| `drive_delete_file` | 删除云空间文件（移至回收站） | `file_token`, `type` | 无 |\n\n### 说明\n- `fields`（Bitable 相关）通常使用字段名/系统键映射值；建议先用 `bitable_list_fields` 明确 schema 后再写入。\n- `im_send_message` 的 `content` 按对应 `msg_type` 要求传入 JSON 字符串。\n- `doc_import`：先上传 md 文件获取 `file_token`，再创建导入任务转换为 docx，轮询等待最多 30 秒。v1.3 新增 `space_id` + `parent_wiki_token` 参数，导入后可自动移入知识库。\n- `wiki_create_node_with_markdown`：一步到位创建带内容的 wiki 文档。内部自动完成：上传 Markdown → 转换为 docx → 移入知识库。适合 AI Agent 快速创建结构化文档。\n- `doc_create_blocks`：v1.3 新增客户端参数校验，block_type 与字段名不匹配时会返回明确错误提示（如 `block_type=4 需要字段 \"heading2\"`），避免飞书 API 返回笼统的 `invalid param`。支持的 block_type：2=text, 3-9=heading1-7, 11=bullet, 12=ordered, 14=code, 15=quote, 22=divider, 27=image, 31=table, 34=callout。\n- `drive_upload_file`：上传 base64 编码的文件到云空间，返回 `file_token`，可配合 `doc_create_blocks` 的 image block（block_type=27）在文档中插入图片。\n- `wiki_delete_node`：飞书无公开 wiki 删除 API。本工具将节点移出 wiki 至云空间根目录（step1），之后需通过 `drive_delete_file` 删除底层文件（step2）。需要 wiki node token，可从 `wiki_list_nodes` 返回的 `node_token` 字段获取。\n\n## 五、安全与生产部署\n\n### 最小可运行参数清单\n\n### 启动参数（必备）\n\n- `--app-id`：飞书应用 ID（必填，可用 `FEISHU_APP_ID` 环境变量代替）\n- `--app-secret`：飞书应用 Secret（必填，可用 `FEISHU_APP_SECRET` 代替）\n- `--oauth`：启动浏览器 OAuth 授权模式（可选）\n- `--port`：OAuth 回调端口（可选，默认 `3001`）\n- `--user-token`：预置用户 access token，跳过浏览器授权（可选，可用 `FEISHU_USER_TOKEN` 代替）\n- `--refresh-token`：预置 refresh token，token 过期时自动刷新（可选，可用 `FEISHU_REFRESH_TOKEN` 代替）\n\n### 推荐环境变量\n\n- `FEISHU_APP_ID`\n- `FEISHU_APP_SECRET`\n- `FEISHU_USER_TOKEN`（预置模式，无需浏览器）\n- `FEISHU_REFRESH_TOKEN`（配合 user token 自动续期）\n- `FEISHU_OAUTH=true/false`（已废弃，建议改用 user token 模式）\n\n#### 示例 `.env`\n\n```bash\nFEISHU_APP_ID=cli_xxx\nFEISHU_APP_SECRET=secret_xxx\nFEISHU_OAUTH=true\nFEISHU_MCP_PORT=3001\n```\n\n#### 示例启动脚本（避免在命令行直接暴露明文）\n\n```bash\nset -a\nsource .env\nset +a\n\nif [ \"${FEISHU_OAUTH}\" = \"true\" ]; then\n  feishu-wiki-mcp --app-id \"$FEISHU_APP_ID\" --app-secret \"$FEISHU_APP_SECRET\" --oauth --port \"${FEISHU_MCP_PORT:-3001}\"\nelse\n  feishu-wiki-mcp --app-id \"$FEISHU_APP_ID\" --app-secret \"$FEISHU_APP_SECRET\"\nfi\n```\n\n### 版本与发布一致性\n\n- 当前代码版本：`1.3.0`（`package.json` 中 `version`）\n- MCP 运行主文件：`build/index.js`\n- 发布示例（建议保持一致）：\n\n```bash\nnpm version patch                      # 或 npm version 1.0.7\nnpm run build                          # 确保生成 build/index.js\nnpm publish --access public\n\n# 标签建议与版本一致\ngit tag v1.0.7\ngit push --tags\n```\n\n### 安全与生产环境建议\n\n#### 端口访问控制\n\n- OAuth 回调默认地址固定为 `http://localhost:${port}/callback`（当前实现不支持自定义 callback host/path）。\n- 生产部署中建议只对内网开放 `3001`，并通过反向代理对外暴露时加 IP 白名单/鉴权。\n- 避免将该端口放到公开网段；如需公网访问，建议使用 VPN 或 SSH 隧道到内网服务端。\n\n#### token 文件权限\n\n- 用户 token 缓存在 `~/.feishu-wiki-mcp-token.json`。\n- 建议设置严格权限：\n\n```bash\nchmod 600 ~/.feishu-wiki-mcp-token.json\nchown \"$USER\" ~/.feishu-wiki-mcp-token.json\n```\n\n- 建议使用独立运行用户，避免多人共享 HOME 目录。\n- 需要强制重新登录时，删除该文件可清除会话缓存。\n\n#### 日志脱敏\n\n- 运行时禁止在 shell 中开启 `set -x`，避免把 `APP_SECRET` 打印到日志。\n- 当前日志仅输出错误描述，不应泄露 token 明文；如你接入统一日志系统，请开启敏感字段脱敏（如 `app_secret`、`token`）。\n\n#### 回调地址与 HTTPS 要求\n\n- 本地开发/单机场景：`http://localhost:<port>/callback` 是可用的。\n- 生产场景若通过反向代理对外网开放，建议使用 HTTPS 并把代理层回调地址映射为该本机回调，同时在飞书应用配置中放行对应可访问域名。\n- 若需自定义公网 callback（非 localhost），需修改 `doOAuthFlow` 中 `redirectUri` 逻辑并重新构建发布。\n\n## 六、发布（如需维护 npm）\n\n```bash\nnpm version patch # 或指定版本号\nnpm login --registry https://registry.npmjs.org\nnpm publish --access public\ngit tag v1.0.7\ngit push --tags\n```\n\n## 七、故障排查\n\n- `feishu-wiki-mcp` 命令未找到：先确认全局安装成功，`npm bin -g` 在 `PATH`\n- 启动报 token 错误：检查 APP_ID / APP_SECRET 是否正确、应用是否开通对应权限\n- OAuth 首次无效：检查 callback URL 是否可达、端口放行是否正常、浏览器可打开授权链接\n- Token 缓存文件：`~/.feishu-wiki-mcp-token.json`（每个用户一份，按需清理可强制重新登录）\n\n## 八、当前版本行为边界\n\n- 当前实现基于 `@modelcontextprotocol/sdk` 的 stdio transport，适配本地/远程 MCP 客户端调用\n- 已实现 36 个工具，按需在服务端扩展后可追加\n\n## 九、Changelog\n\n### v1.3.0\n- **新增 `wiki_create_node_with_markdown`**：一步到位在知识库中创建带 Markdown 内容的文档节点。内部自动完成：上传 Markdown → 转换为 docx → 移入知识库指定位置。AI Agent 只需一次调用即可完成之前需要 3 步（create_node → list_blocks → create_blocks）的操作。\n- **新增 `drive_upload_file`**：支持 base64 编码文件上传到飞书云空间，返回 `file_token`，可用于在文档中插入图片等场景。\n- **增强 `doc_import`**：新增 `space_id` + `parent_wiki_token` 可选参数，导入 Markdown 后自动将文档移入知识库，省去手动调用 `wiki_move_docs_to_wiki`。\n- **增强 `doc_create_blocks`**：\n  - 补全所有 block_type 文档：新增 11=bullet、12=ordered、15=quote、22=divider 等类型的完整 JSON 示例\n  - 新增客户端参数校验：block_type 与字段名不匹配时返回明确错误提示（如 `block_type=4 需要字段 \"heading2\"`），不再依赖飞书 API 笼统的 `invalid param` 错误\n\n### v1.2.0\n- **bugfix `doc_import`**：修复创建空文档的问题。现在正确实现三步流程：① 上传 md 文件获取 `file_token` → ② 创建导入任务（md→docx）→ ③ 轮询等待，内容完整导入。\n- **bugfix `wiki_delete_node`**：飞书无公开 wiki 删除端点（DELETE 返回 404）。改为两步删除工作流：本工具先将节点移出 wiki 至云空间根目录，再配合 `drive_delete_file` 彻底删除底层文件。\n\n### v1.1.0\n- 新增 5 个 Docx Blocks 操作工具：`doc_list_blocks`、`doc_get_block`、`doc_create_blocks`、`doc_update_block`、`doc_delete_blocks`，支持对飞书文档内容的完整 CRUD\n- 新增 `wiki_delete_node`、`drive_delete_file` 删除工具\n- OAuth 改进：支持 `--user-token` / `--refresh-token` 参数和 `FEISHU_USER_TOKEN` / `FEISHU_REFRESH_TOKEN` 环境变量，第三方 MCP 客户端无需浏览器即可授权\n- 环境变量支持 `FEISHU_APP_ID` / `FEISHU_APP_SECRET`\n\n### v1.0.7\n- 初始版本，27 个工具（Wiki、Bitable、IM、权限）\n","readmeFilename":"README.md"}