Content Manager MCP Server
Enables comprehensive content management through Markdown processing, HTML rendering, intelligent fuzzy search, and document analysis. Supports frontmatter parsing, tag-based filtering, table of contents generation, and directory statistics for efficient content organization and discovery.
README
Content Manager MCP Server
A comprehensive TypeScript-based Model Context Protocol (MCP) server for content management, including Markdown processing, document generation, and intelligent note searching.
🚀 Features
📝 Markdown Processing
- Render Markdown to HTML with table of contents generation
- Extract headings and create structured navigation
- Parse frontmatter from Markdown files
- HTML sanitization for safe content processing
🔍 Intelligent Search
- Fuzzy search through notes using Fuse.js
- Exact text matching with context highlighting
- Tag-based filtering using frontmatter metadata
- Date range queries for time-based content discovery
📊 Content Analysis
- Directory statistics showing file counts, sizes, and types
- File discovery with customizable extension filtering
- Content preview with metadata extraction
🛠 Tech Stack
- TypeScript - Type-safe development with latest ES2023 features
- Zod - Runtime schema validation and type inference
- tsup - Fast TypeScript bundler with ESM support
- pnpm - Efficient package management
- Fuse.js - Fuzzy search functionality
- marked - Markdown parsing and rendering
📦 Installation
Prerequisites
- Node.js >= 20.0.0
- pnpm >= 9.0.0
Setup
# Clone and install dependencies
git clone <repository-url>
cd content-manager-mcp
pnpm install
# Build the project
pnpm build
# Run in development mode
pnpm dev
🔧 Usage
As MCP Server
The server runs via stdio and implements the MCP protocol:
node dist/index.js
Available Tools
render_markdown
Converts Markdown content to HTML with optional features:
{
content: string, // Markdown content to render
generateToc?: boolean, // Generate table of contents (default: true)
sanitizeHtml?: boolean, // Sanitize output HTML (default: true)
enableCodeHighlight?: boolean // Enable syntax highlighting (default: true)
}
search_notes
Intelligent search through content files:
{
query: string, // Search query
directory?: string, // Directory to search (default: cwd)
includeContent?: boolean, // Include file content in results (default: true)
maxResults?: number, // Maximum results to return (default: 10)
fuzzy?: boolean // Use fuzzy search (default: true)
}
search_by_tags
Find files by frontmatter tags:
{
tags: string[], // Array of tags to search for
directory?: string // Directory to search (default: cwd)
}
search_by_date_range
Find files by modification date:
{
startDate: string, // ISO date string (YYYY-MM-DD)
endDate: string, // ISO date string (YYYY-MM-DD)
directory?: string // Directory to search (default: cwd)
}
generate_table_of_contents
Extract and format headings as a table of contents:
{
content: string // Markdown content to analyze
}
extract_headings
Get structured heading information:
{
content: string // Markdown content to analyze
}
extract_frontmatter
Parse YAML frontmatter from Markdown:
{
content: string // Markdown content with frontmatter
}
get_directory_stats
Analyze directory content statistics:
{
directory?: string // Directory to analyze (default: cwd)
}
find_content_files
Discover files with specific extensions:
{
directory?: string, // Directory to search (default: cwd)
extensions?: string[] // File extensions (default: ['.md', '.markdown', '.txt', '.mdx'])
}
read_content_file
Read and parse a single content file:
{
filePath: string // Path to file to read
}
🏗 Project Structure
content-manager-mcp/
├── src/
│ ├── types/ # Zod schemas and TypeScript types
│ ├── utils/ # Utility functions for file operations
│ │ ├── fileUtils.ts # File system operations
│ │ ├── markdownUtils.ts # Markdown processing
│ │ └── searchUtils.ts # Search functionality
│ ├── tools/ # MCP tool definitions and handlers
│ └── index.ts # Main server entry point
├── dist/ # Compiled output
├── tsup.config.ts # Build configuration
├── tsconfig.json # TypeScript configuration
└── package.json # Project metadata and dependencies
🧪 Development
Scripts
pnpm dev- Development mode with watchpnpm build- Build for productionpnpm start- Run built serverpnpm lint- Check code stylepnpm lint:fix- Fix code style issuespnpm type-check- TypeScript type checkingpnpm clean- Clean build artifacts
Type Safety
This project leverages Zod for runtime validation combined with TypeScript for compile-time safety. All tool arguments are validated at runtime, ensuring robust error handling and type safety.
Error Handling
- Comprehensive error catching and reporting
- Zod validation errors with descriptive messages
- File system error handling
- Graceful degradation for malformed content
📝 Example Usage
Frontmatter Format
The server recognizes YAML frontmatter in Markdown files:
---
title: My Document
tags: [typescript, mcp, documentation]
author: Your Name
date: 2024-01-15
---
# Document Content
Your markdown content here...
Search Examples
- Fuzzy search:
query: "typescript mcp"(finds related content) - Exact search:
query: "exact phrase", fuzzy: false - Tag search:
tags: ["typescript", "documentation"] - Date search:
startDate: "2024-01-01", endDate: "2024-12-31"
🤝 Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make changes and add tests
- Ensure types are correct:
pnpm type-check - Submit a pull request
📄 License
MIT License - see LICENSE file for details.
Built with ❤️ using TypeScript, Zod, and the latest modern tooling for robust content management.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器