docs-mcp-server

nic01asFr/docs-mcp-server

3.2

If you are the rightful owner of docs-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Docs MCP Server is a professional server that integrates seamlessly with Claude and Docs instances using the Model Context Protocol (MCP), enabling advanced document management and AI-powered features.

Tools
5
Resources
0
Prompts
0

Docs MCP Server

๐Ÿš€ Professional MCP Server for Docs

Complete API integration with 31 tools including document content editing via Yjs

PyPI version Python Support License: MIT Code style: ruff Tests Coverage Security Type Checked

๐Ÿ“– Documentation โ€ข ๐Ÿš€ Installation โ€ข ๐Ÿ› ๏ธ Usage โ€ข โ€ข


The Docs MCP Server provides seamless integration between Claude and Docs instances through the Model Context Protocol (MCP). It enables Claude to interact with collaborative documents, manage access permissions, and leverage AI-powered features directly within the Docs ecosystem.

โœจ Key Features

๐Ÿ“ Complete Document Management

  • ๐Ÿ“„ Create, read, update, and delete documents
  • ๐ŸŒณ Navigate hierarchical document structures
  • โ†”๏ธ Move and reorganize documents in trees
  • ๐Ÿ“‹ Duplicate documents with or without permissions
  • โญ Manage favorites and restore from trashbin

โœ๏ธ Document Content Editing (NEW in v0.2.0)

  • ๐Ÿ“– Read document content as plain text
  • โœ๏ธ Update documents with text or markdown
  • ๐Ÿ”„ Apply AI transformations directly to documents
  • ๐ŸŒ Translate document content automatically
  • ๐Ÿ”ง Yjs (CRDT) format support for collaborative editing

๐Ÿ‘ฅ Advanced Access Control

  • ๐Ÿ” Grant and revoke user permissions (reader, editor, administrator, owner)
  • ๐Ÿ“ง Send email invitations to external users
  • ๐Ÿ” Search for users across the platform
  • ๐Ÿ“ฎ Manage pending invitations

๐Ÿค– AI-Powered Features

  • โœ๏ธ Text correction and grammar checking
  • ๐Ÿ”„ Content rephrasing and summarization
  • ๐ŸŒ Multi-language translation support
  • โšก Custom AI transformations

๐Ÿ“š Version History

  • ๐Ÿ“– Browse document version history
  • ๐Ÿ” Retrieve specific version content
  • ๐Ÿ“Š Track changes over time

๐Ÿ”Œ MCP Integration

  • 31 Tools: Comprehensive set of operations including content editing
  • 4 Resources: Real-time data access
  • Type Safety: Full TypeScript-style type hints
  • Error Handling: Robust error management
  • Yjs Support: Native collaborative document format

๐Ÿš€ Installation

From PyPI (Recommended)

pip install docs-mcp-server

From Source (Development)

git clone https://github.com/nic01asFr/docs-mcp-server.git
cd docs-mcp-server
pip install -e \".[dev]\"

โš™๏ธ Configuration

Environment Variables

export DOCS_BASE_URL=\"https://your-docs-instance.com\"
export DOCS_API_TOKEN=\"your-api-token\"
export DOCS_TIMEOUT=30          # Optional: request timeout in seconds  
export DOCS_MAX_RETRIES=3       # Optional: maximum retry attempts

Verify Configuration

docs-mcp-server --config-check

Output:

โœ“ Configuration loaded successfully
  Base URL: https://docs.example.com
  Token: ****-token-****-1234
  Timeout: 30s
  Max retries: 3
โœ“ API connection successful
  Authenticated as: user@example.com
  User ID: user-123

๐Ÿ› ๏ธ Usage

Command Line

# Start with environment variables
docs-mcp-server

# Start with explicit configuration  
docs-mcp-server --base-url https://docs.example.com --token your-token

# Start with custom server name
docs-mcp-server --name my-docs-server

# Start with verbose logging
docs-mcp-server --verbose

Python Module

python -m docs_mcp_server

Programmatic Usage

import asyncio
from docs_mcp_server import DocsServer

async def main():
    server = DocsServer(
        base_url=\"https://docs.example.com\",
        token=\"your-token\",
        server_name=\"my-docs-server\"
    )
    await server.run()

if __name__ == \"__main__\":
    asyncio.run(main())

๐Ÿ“‹ Available Tools

๐Ÿ“„ Document Operations (6 tools)
ToolDescription
docs_list_documentsList documents with filtering and pagination
docs_get_documentRetrieve a specific document by ID
docs_create_documentCreate new documents (root or child)
docs_update_documentUpdate document title and content
docs_delete_documentSoft delete documents
docs_restore_documentRestore deleted documents
โœ๏ธ Document Content Editing (4 tools)
ToolDescription
docs_get_content_textRead document content as plain text
docs_update_contentUpdate document with text or markdown
docs_apply_ai_transformApply AI transformation and save to document
docs_apply_ai_translateTranslate and save document content
๐ŸŒณ Tree Operations (4 tools)
ToolDescription
docs_move_documentMove documents in tree structure
docs_duplicate_documentCreate document copies
docs_get_childrenGet immediate child documents
docs_get_treeGet complete tree structure
๐Ÿ” Access Management (7 tools)
ToolDescription
docs_list_accessesList document permissions
docs_grant_accessGrant user access to documents
docs_update_accessModify existing permissions
docs_revoke_accessRemove user access
docs_invite_userSend email invitations
docs_list_invitationsList pending invitations
docs_cancel_invitationCancel invitations
๐Ÿ‘ค User & Content Management (8 tools)
ToolDescription
docs_search_usersSearch users by email
docs_get_current_userGet current user information
docs_add_favoriteAdd documents to favorites
docs_remove_favoriteRemove from favorites
docs_list_favoritesList favorite documents
docs_list_trashbinList deleted documents
docs_list_versionsList document version history
docs_get_versionGet specific version content
๐Ÿค– AI Features (2 tools)
ToolDescription
docs_ai_transformAI text transformation (correct, rephrase, summarize)
docs_ai_translateAI translation services

๐Ÿ“Š Resources

ResourceDescription
docs://documentsAll accessible documents
docs://favoritesUser's favorite documents
docs://trashbinSoft-deleted documents
docs://userCurrent user information

๐Ÿ’ก Examples

Basic Document Operations

from docs_mcp_server import create_client

async def example():
    async with create_client() as client:
        # Create a document
        doc = await client.create_document(
            title=\"Project Proposal\",
            content=\"# Project Overview\\n\\nThis is our new project...\"
        )
        
        # Grant access to a colleague
        await client.grant_access(
            document_id=doc.id,
            user_email=\"colleague@example.com\",
            role=\"editor\"
        )
        
        # Use AI to improve content
        improved = await client.ai_transform(
            document_id=doc.id,
            text=\"This text needs improvement\",
            action=\"rephrase\"
        )
        print(f\"Improved text: {improved.result}\")

MCP Server Integration

import asyncio
from docs_mcp_server import DocsServer

async def main():
    server = DocsServer(
        base_url=\"https://docs.example.com\",
        token=\"your-token\",
        server_name=\"company-docs\"
    )
    await server.run()

asyncio.run(main())

Error Handling

from docs_mcp_server import DocsAPIClient, DocsError, DocsNotFoundError

async def robust_example():
    try:
        async with DocsAPIClient() as client:
            doc = await client.get_document(\"non-existent-id\")
    except DocsNotFoundError:
        print(\"Document not found\")
    except DocsError as e:
        print(f\"API error: {e.message}\")
    except Exception as e:
        print(f\"Unexpected error: {e}\")

๐Ÿงช Development

Setup Development Environment

git clone https://github.com/nic01asFr/docs-mcp-server.git
cd docs-mcp-server
pip install -e \".[dev]\"
pre-commit install

Run Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=docs_mcp_server --cov-report=html

# Run specific test file
pytest tests/test_client.py -v

Code Quality

# Linting and formatting
ruff check src/ tests/
ruff format src/ tests/

# Type checking
mypy src/docs_mcp_server

# Security scanning
bandit -r src/
safety check

Documentation

# Serve documentation locally
mkdocs serve

# Build documentation
mkdocs build

๐Ÿญ Production Ready

โœ… Quality Assurance

  • ๐Ÿงช Comprehensive test suite with >95% coverage
  • ๐Ÿ”’ Type safety with mypy and pydantic
  • ๐Ÿงน Code quality with ruff and pre-commit hooks
  • ๐Ÿ›ก๏ธ Security scanning with bandit and safety
  • ๐Ÿ“Š Performance monitoring and optimization

๐Ÿ” Security

  • ๐Ÿ”‘ Secure API token management
  • ๐ŸŒ HTTPS-only communication
  • โœ… Input validation and sanitization
  • ๐Ÿ’พ No sensitive data storage
  • ๐Ÿ“‹ Comprehensive security documentation

๐Ÿš€ CI/CD

  • ๐Ÿ”„ Automated testing on multiple Python versions (3.10-3.12)
  • ๐Ÿ“ฆ Automated PyPI publishing on releases
  • ๐Ÿ” Security vulnerability scanning
  • ๐Ÿ“ˆ Performance regression testing

๐Ÿ“š Documentation

  • ๐Ÿ“– Comprehensive API documentation
  • ๐Ÿ’ก Usage examples and tutorials
  • ๐Ÿค Contribution guidelines
  • ๐Ÿ”’ Security policy
  • ๐Ÿ“‹ Detailed changelog

๐Ÿ”— Links

๐Ÿ“„ License

This project is licensed under the MIT License - see the file for details.

๐Ÿค Contributing

We welcome contributions! Please see our for details.

Contributors

<a href="https://github.com/nic01asFr/docs-mcp-server/graphs/contributors\"> <img src="https://contrib.rocks/image?repo=nic01asFr/docs-mcp-server\" />

๐Ÿ™ Acknowledgments


Made with โค๏ธ by Nicolas LAVAL

Enabling seamless AI integration with collaborative documentation