kimi-writer-mcp

fsmw/kimi-writer-mcp

3.2

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

Kimi Writer MCP Server is a comprehensive Model Context Protocol server that enables seamless integration of Kimi Writer's creative writing capabilities with other AI models.

Tools
9
Resources
0
Prompts
0

Kimi Writer MCP Server 🚀

GitHub stars GitHub forks GitHub issues License: MIT

A complete Model Context Protocol (MCP) server that exposes Kimi Writer's creative writing capabilities to other AI models. Transform your AI writing workflow with professional document generation and structured prompts.

✨ Features

🔧 Writing Tools (8 tools)

  • create_project - Create organized writing projects
  • write_file - Write markdown with create/append/overwrite modes
  • get_project_info - Get active project information
  • list_project_files - List project files with metadata
  • read_file - Read file contents from active project
  • get_file_stats - Get file statistics (size, dates, etc.)
  • create_writing_template - Generate templates for novels, short stories, books, poetry

📝 Structured Prompts (3 prompts)

  • write_novel - Complete novel writing prompts with genre-specific guidance
  • write_short_story - Short story prompts with tone and length options
  • write_nonfiction_book - Non-fiction book prompts with audience targeting

📚 Document Generation (Optional - 2 tools)

  • generate_pdf - Professional PDFs with TOC, typography, pagination
  • generate_epub - Standards-compliant EPUBs with metadata and navigation

🚀 Quick Start

1. Clone the repository

git clone https://github.com/fsmw/kimi-writer-mcp.git
cd kimi-writer-mcp

2. Install dependencies

# Install MCP dependencies
pip install -r requirements.txt

# Install Kimi Writer dependencies
cd ../kimi-writer
pip install -r requirements.txt
cd ../kimi-writer-mcp

# For PDF/EPUB generation (optional)
pip install -r requirements-extended.txt

3. Run the server

python mcp-server.py

4. Test functionality

python test-client.py

🤖 Claude Desktop Integration

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "kimi-writer": {
      "command": "python",
      "args": ["/path/to/kimi-writer-mcp/mcp-server.py"],
      "cwd": "/path/to/kimi-writer-mcp"
    }
  }
}

💻 Usage Examples

Writing a Novel with PDF Export

# Create project and write content
await session.call_tool("create_project", {"project_name": "cyberpunk_novel"})
await session.call_tool("write_file", {
    "filename": "chapter_01.md",
    "content": "# Chapter 1\n\nIn the neon-lit streets...",
    "mode": "create"
})

# Generate PDF when complete
await session.call_tool("generate_pdf", {"output_filename": "complete_novel"})

Creating a Short Story Collection

# Get structured prompt
prompt = await session.get_prompt("write_short_story", {
    "theme": "AI and consciousness",
    "length": "medium",
    "tone": "philosophical"
})

# Write stories using the prompt
# ... your AI model generates content ...

📊 Project Status

COMPLETE AND TESTED

  • ✅ All 8 MCP tools functioning correctly
  • ✅ Project creation and management working
  • ✅ File operations (read, write, append, overwrite) tested
  • ✅ Template generation for all writing types
  • ✅ Structured prompts with specific guidance
  • ✅ Professional documentation and examples
  • ✅ Cross-platform compatibility

🔧 Architecture

  • MCP Protocol Compliance - Universal AI model compatibility
  • Modular Design - Clean separation of concerns
  • Graceful Degradation - Optional features work without errors
  • Professional Code Quality - Kimi Writer standards with comprehensive docstrings
  • Unicode Support - International content handling
  • Cross-Platform - Unix/Linux/Windows compatibility

📦 Dependencies

Core (Required)

  • mcp>=1.0.0 - Model Context Protocol
  • openai>=1.0.0 - OpenAI SDK (Kimi Writer compatibility)
  • httpx>=0.24.0 - HTTP client
  • python-dotenv>=1.0.0 - Environment management
  • markdown>=3.5.1 - Markdown processing

Document Generation (Optional)

  • weasyprint>=60.0 - PDF generation
  • ebooklib>=0.18 - EPUB creation
  • beautifulsoup4>=4.12.0 - HTML parsing
  • python-frontmatter>=1.0.0 - Metadata handling

🧪 Testing

Run comprehensive test suites:

# Test all MCP features
python test-client.py

# Test document generation
python test-documents.py

# Check dependencies
python start.py --check

📚 Documentation

  • - Complete documentation
  • - Technical details
  • - Usage examples
  • - Project summary

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: python test-client.py
  5. Submit a pull request

📄 License

MIT License - see file for details.

🌟 Credits

Created by Fernando San Martin with 🧡 Crush

Transforming Kimi Writer into a powerful, reusable writing tool that can be integrated with any MCP-compatible AI system.


🚀 Ready for Claude Desktop integration!