duke-book
v0.1.3
Published
MCP server for Duke Bookmark note management.
Readme
duke-book
Expose Duke Bookmark notes, categories, and knowledge search to MCP clients such as Cursor, Claude Code, and VS Code.
Configuration
Create an API token in Duke Bookmark: API Docs / Token (/api-docs?tab=tokens).
DUKE_API_BASE_URL=http://localhost:3001
DUKE_API_TOKEN=your_api_tokenDUKE_API_BASE_URL defaults to http://localhost:3001. DUKE_API_TOKEN is required for note/category operations. duke_health_check can run without a token.
DUKE_API_TOKEN may be configured as either the raw token or Bearer <token>; the server normalizes it before calling Duke Bookmark.
Local Usage
npm install
npm run build
$env:DUKE_API_BASE_URL="http://localhost:3001"
$env:DUKE_API_TOKEN="your_api_token"
npm startAfter publishing to npm, clients can also run this server with npx -y duke-book.
Local Verification
Start Duke Bookmark first, then run:
npm run smokeThe smoke test verifies that the MCP server starts, exposes all expected tools, and can reach /api/health. If DUKE_API_TOKEN is set, it also validates token-scoped access through duke_validate_token.
To require a token during verification:
npm run smoke:tokenCursor
The project includes .cursor/mcp.json. Set DUKE_API_TOKEN in your local shell/user environment before starting Cursor:
{
"mcpServers": {
"duke-book": {
"command": "node",
"args": ["${workspaceFolder}/mcp-server/dist/index.js"],
"env": {
"DUKE_API_BASE_URL": "http://localhost:3001",
"DUKE_API_TOKEN": "${env:DUKE_API_TOKEN}"
}
}
}
}Claude Code
claude mcp add duke-book -e DUKE_API_BASE_URL=http://localhost:3001 -e DUKE_API_TOKEN=your_api_token -- node D:/duke/mcp-server/dist/index.jsVS Code
The project includes .vscode/mcp.json. VS Code prompts for the token the first time the MCP server starts:
{
"inputs": [
{
"type": "promptString",
"id": "duke-api-token",
"description": "Duke Bookmark API Token",
"password": true
}
],
"servers": {
"dukeBook": {
"type": "stdio",
"command": "node",
"args": ["${workspaceFolder}/mcp-server/dist/index.js"],
"env": {
"DUKE_API_BASE_URL": "http://localhost:3001",
"DUKE_API_TOKEN": "${input:duke-api-token}"
}
}
}
}Tools
duke_list_categoriesduke_search_notesduke_get_noteduke_create_noteduke_update_noteduke_delete_noteduke_create_categoryduke_search_knowledgeduke_validate_tokenduke_health_check
Publishing Checklist
- Run
npm run smokeandnpm run smoke:token. - Publish the package with
npm publish --access public. - Publish
server.jsonto the MCP Registry or the target marketplace.
Full release notes are documented in docs/MCP发布流程.md.
