@mauro.pelizzari-doki/doki-mcp-client
v1.0.2
Published
MCP Server for Doki - Document Intelligence Platform. Integrates Claude Desktop/Code with Doki for document management.
Maintainers
Readme
Doki MCP Server
MCP (Model Context Protocol) server for integrating Claude Desktop/Code with Doki.
Version 2.0 - Now uses JSON-RPC transport for full MCP protocol compliance.
Features
- 67+ tools dynamically loaded from the Doki server
- JSON-RPC transport via
/mcpendpoint - OAuth 2.0 authentication with PKCE (recommended)
- PAT authentication for API access
- Auto token refresh for seamless experience
Installation
From npm (Recommended)
npm install -g @mauro.pelizzari-doki/doki-mcp-clientFrom source
git clone https://github.com/doki-app/doki.git
cd doki/mcp-client
npm installSetup
Configure Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Option A: OAuth Authentication (Recommended)
Using npx (no global install needed):
{
"mcpServers": {
"doki": {
"command": "npx",
"args": ["-y", "@mauro.pelizzari-doki/doki-mcp-client"],
"env": {
"DOKI_URL": "https://doki-app.duckdns.org"
}
}
}
}Using global install:
{
"mcpServers": {
"doki": {
"command": "doki-mcp",
"env": {
"DOKI_URL": "https://doki-app.duckdns.org"
}
}
}
}Using local source:
{
"mcpServers": {
"doki": {
"command": "node",
"args": ["/FULL/PATH/TO/doki/mcp-client/src/index.js"],
"env": {
"DOKI_URL": "https://doki-app.duckdns.org"
}
}
}
}When you first use a Doki tool, a browser window will open for Keycloak login. After authentication, the tokens are saved locally and refreshed automatically.
Option B: PAT Authentication
- Create a PAT in Doki (Settings > API Tokens)
- Configure Claude Desktop:
{
"mcpServers": {
"doki": {
"command": "npx",
"args": ["-y", "@mauro.pelizzari-doki/doki-mcp-client"],
"env": {
"DOKI_URL": "https://doki-app.duckdns.org",
"DOKI_API_TOKEN": "doki_pat_YOUR_TOKEN_HERE"
}
}
}
}Configure Claude Code
Add to your Claude Code MCP settings (~/.claude/claude_code_mcp_settings.json):
{
"mcpServers": {
"doki": {
"command": "npx",
"args": ["-y", "@mauro.pelizzari-doki/doki-mcp-client"],
"env": {
"DOKI_URL": "https://doki-app.duckdns.org"
}
}
}
}Or with PAT authentication:
{
"mcpServers": {
"doki": {
"command": "npx",
"args": ["-y", "@mauro.pelizzari-doki/doki-mcp-client"],
"env": {
"DOKI_URL": "https://doki-app.duckdns.org",
"DOKI_API_TOKEN": "doki_pat_YOUR_TOKEN_HERE"
}
}
}
}Restart Claude
Close and reopen Claude Desktop/Code after configuration changes.
Architecture
┌─────────────────────────────────────────────────────────────┐
│ Claude Desktop / Claude Code │
└────────────────────────┬────────────────────────────────────┘
│ stdio (MCP SDK)
▼
┌─────────────────────────────────────────────────────────────┐
│ doki-mcp-client (this package) │
│ - Proxies tool calls to Doki │
│ - Handles OAuth/PAT authentication │
│ - Dynamically fetches available tools │
└────────────────────────┬────────────────────────────────────┘
│ JSON-RPC over HTTP
▼
┌─────────────────────────────────────────────────────────────┐
│ Doki Server (/mcp endpoint) │
│ - McpServer (JSON-RPC handler) │
│ - McpTools (67+ tool implementations) │
└─────────────────────────────────────────────────────────────┘How OAuth Works
- When you first call a Doki tool (e.g., "list my Doki projects")
- The MCP server starts a local callback server on port 9876
- A browser opens with the Keycloak login page
- After you authenticate, Keycloak redirects to
localhost:9876/callback - The MCP server exchanges the code for tokens
- Tokens are saved to
~/.doki-mcp/tokens.json - Subsequent calls use the saved token (auto-refreshed when expired)
To re-authenticate, delete ~/.doki-mcp/tokens.json and restart Claude.
Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| DOKI_URL | Doki server URL | https://doki-app.duckdns.org |
| DOKI_API_TOKEN | PAT token (enables PAT mode) | - |
| AUTH_MODE | Force auth mode: oauth or pat | Auto-detect |
| OAUTH_CLIENT_ID | Keycloak client ID | doki-mcp |
| OAUTH_CALLBACK_PORT | Local callback port | 9876 |
Available Tools
Tools are dynamically loaded from the server. Currently available:
Projects
list_projects- List all projects in the organizationget_project- Get project detailscreate_project- Create a new projectupdate_project- Update project detailsdelete_project- Delete a project
Artifacts
list_artifacts- List artifacts in a projectget_artifact- Get artifact with full contentcreate_artifact- Create new artifact from templateupdate_artifact_content- Update a section's contentupdate_artifact_name- Update artifact nameupdate_artifact_status- Change artifact statusdelete_artifact- Delete an artifactexport_artifact_docx- Get DOCX download URLlist_available_sections- List optional sectionsadd_artifact_section- Add a section to artifactremove_artifact_section- Remove a section
Paragraphs
list_paragraphs- List paragraphs in an artifactcreate_paragraph- Create a new paragraphupdate_paragraph- Update paragraph contentreorder_paragraphs- Reorder paragraphsdelete_paragraph- Delete a paragraph
Questions
list_artifact_questions- List questions for an artifactget_artifact_question- Get question detailscreate_artifact_question- Create a questionupdate_artifact_question- Update/answer a questiondelete_artifact_question- Delete a question
Tasks
list_artifact_tasks- List tasks for an artifactget_artifact_task- Get task detailscreate_artifact_task- Create a taskupdate_artifact_task- Update a taskdelete_artifact_task- Delete a task
Knowledge Sources
list_knowledge_sources- List uploaded documentsget_knowledge_source- Get document contentget_ingestion_status- Check processing statusupdate_knowledge_source- Update metadatadelete_knowledge_source- Delete a sourceretry_knowledge_processing- Retry failed processingdownload_knowledge_source- Get download URL
Templates
list_templates- List available templatesget_template- Get template with sectionscreate_template- Create a new templateupdate_template- Update templatedelete_template- Delete a templatelist_template_sections- (via get_template)create_template_section- Add a sectionupdate_template_section- Update a sectiondelete_template_section- Delete a sectionlist_template_versions- List version historyrestore_template_version- Restore a version
Clients
list_clients- List all clientscreate_client- Create a new client
Project Members
list_project_members- List project membersadd_project_member- Add a memberupdate_project_member- Update member roleremove_project_member- Remove a member
Dashboard
get_my_tasks- Get tasks assigned to youget_recent_activities- Get recent activities
Activities
list_artifact_activities- Get activity log
Organization
get_organization- Get organization infoget_organization_members- List members
Settings
get_llm_settings- Get LLM configurationupdate_llm_settings- Update LLM settingsget_pdf_styles- Get PDF export stylesupdate_pdf_styles- Update PDF styles
Utilities
list_doki_roles- List available doki roleslist_template_icons- List available iconslist_template_groups- List template groupscreate_template_group- Create a group
Troubleshooting
OAuth flow doesn't start
- Check that port 9876 is not in use
- Try setting a different port:
OAUTH_CALLBACK_PORT=9999
"Authentication failed"
- Delete
~/.doki-mcp/tokens.jsonand retry - Check that
DOKI_URLis correct and reachable
Browser doesn't open
- Manually open the URL shown in stderr
- On Linux, ensure
xdg-openis installed
Tools not loading
- Check server logs for connection errors
- Verify the Doki server is running and accessible
Testing
# Test with OAuth (will open browser)
DOKI_URL=https://doki-app.duckdns.org node src/index.js
# Test with PAT
DOKI_API_TOKEN=doki_pat_xxx node src/index.jsChangelog
v2.0.0
- Migrated from REST API to JSON-RPC transport
- Dynamic tool loading from server (no more hardcoded tools)
- Full MCP protocol compliance
- 67+ tools available
v1.0.0
- Initial release with REST API backend
- 20 hardcoded tools
