Article Manager MCP Server
Enables AI agents to save, search, and manage markdown-based research articles through a complete CRUD interface. Supports creating, reading, updating, and deleting articles with frontmatter metadata in a self-hosted file-based system.
README
Article Manager
A complete full-stack TypeScript monolithic article management system designed for AI agents to save and manage research content. This self-hosted single-user POC system handles hundreds of markdown articles with multiple interfaces: Web UI, REST API, and MCP server.
Features
- š Markdown-based articles with frontmatter support
- š Search functionality with partial title matching
- šØ Dark/Light theme toggle
- š± Mobile-first responsive design
- š Bearer token authentication for all interfaces
- š REST API for programmatic access
- š¤ MCP server integration for AI agent access
- š³ Docker support with multi-stage builds and non-root user
- ā” Bun runtime for fast TypeScript execution
- š Request logging for monitoring and debugging
Architecture
Monolithic Structure
/src
/backend
/routes - REST API endpoints
/mcp - MCP server tools
/services - Shared business logic (articles CRUD)
/middleware - Auth, error handling
server.ts - Main server (API + MCP + static serving)
/frontend
/components - React components
/pages - Page components
/styles - CSS files
App.tsx
Technology Stack
- Runtime: Bun (fast TypeScript execution)
- Backend: TypeScript, @modelcontextprotocol/sdk
- Frontend: React, react-markdown
- Storage: File-based markdown with frontmatter
- Deployment: Docker with oven/bun base image
Quick Start
Prerequisites
- Bun installed (v1.0+)
- Docker and Docker Compose (for containerized deployment)
Development Setup
1. Clone and install dependencies
cd article_manager
bun install
2. Configure environment
cp .env.example .env
# Edit .env and set your AUTH_TOKEN
3. Run development servers
Terminal 1 (Backend):
bun run dev:backend
Terminal 2 (Frontend):
bun run dev:frontend
4. Access the application
- Web UI: http://localhost:5000
- API: http://localhost:5000/api/*
- MCP: http://localhost:5000/mcp
To test the MCP Server you can use the MCP inspector
npx @modelcontextprotocol/inspector
Production Build
# Build frontend
bun run build
# Start production server
bun run start
Docker Deployment
Using Docker Compose (Recommended)
1. Configure environment
cp .env.example .env
# Edit .env and set AUTH_TOKEN
2. Start the container
docker-compose up -d
3. View logs
docker-compose logs -f
4. Stop the container
docker-compose down
Using Docker directly
# Build image
docker build -t article-manager .
# Run container
docker run -d \
-p 5000:5000 \
-e AUTH_TOKEN=your-secret-token \
-v $(pwd)/data:/data \
--name article-manager \
article-manager
GitHub Container Registry
To push to GitHub Container Registry:
# Build and tag
docker build -t ghcr.io/YOUR_USERNAME/article-manager:latest .
# Login to GHCR
echo $GITHUB_TOKEN | docker login ghcr.io -u YOUR_USERNAME --password-stdin
# Push
docker push ghcr.io/YOUR_USERNAME/article-manager:latest
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
AUTH_TOKEN |
Yes | - | Authentication token for all interfaces |
DATA_DIR |
No | /data |
Directory where markdown articles are stored |
PORT |
No | 5000 |
Server port |
NODE_ENV |
No | development |
Environment mode |
REST API Documentation
All API endpoints require Bearer token authentication via the Authorization header:
Authorization: Bearer YOUR_AUTH_TOKEN
Endpoints
Health Check
GET /health
Returns server health status (no auth required).
Response:
{
"status": "ok"
}
List Articles
GET /api/articles
Returns all articles with metadata, sorted by creation date (newest first).
Response:
[
{
"filename": "my-article.md",
"title": "My Article",
"created": "2025-01-15T10:30:00Z"
}
]
Search Articles
GET /api/articles?q=search+term
Search articles by title (partial match, case-insensitive).
Query Parameters:
q- Search query string
Response:
[
{
"filename": "matching-article.md",
"title": "Matching Article",
"created": "2025-01-15T10:30:00Z"
}
]
Read Article
GET /api/articles/:filename
Read a single article by filename.
Response:
{
"filename": "my-article.md",
"title": "My Article",
"content": "Article content in markdown...",
"created": "2025-01-15T10:30:00Z"
}
Error Response (404):
{
"error": "Article not found"
}
Create Article
POST /api/articles
Content-Type: application/json
{
"title": "My New Article",
"content": "Article content in markdown..."
}
Creates a new article. Filename is auto-generated from title (e.g., "My New Article" ā "my-new-article.md").
Response (201):
{
"filename": "my-new-article.md",
"title": "My New Article",
"content": "Article content in markdown...",
"created": "2025-01-15T10:30:00Z"
}
Error Response (400):
{
"error": "Title and content are required"
}
Update Article
PUT /api/articles/:filename
Content-Type: application/json
{
"title": "Updated Title",
"content": "Updated content..."
}
Updates an existing article. Preserves original creation date.
Response:
{
"filename": "my-article.md",
"title": "Updated Title",
"content": "Updated content...",
"created": "2025-01-15T10:30:00Z"
}
Delete Article
DELETE /api/articles/:filename
Deletes an article.
Response:
{
"success": true
}
Authentication Errors
All authenticated endpoints return 401 for invalid/missing tokens:
{
"error": "Unauthorized"
}
MCP Server Documentation
The MCP (Model Context Protocol) server provides AI agents with tools to manage articles.
Endpoint
POST /mcp
Authorization: Bearer YOUR_AUTH_TOKEN
Content-Type: application/json
Available Tools
listArticles
List all articles with metadata.
Input Schema:
{
"method": "tools/call",
"params": {
"name": "listArticles",
"arguments": {}
}
}
Response:
{
"content": [
{
"type": "text",
"text": "[{\"filename\":\"article.md\",\"title\":\"Article\",\"created\":\"2025-01-15T10:30:00Z\"}]"
}
]
}
searchArticles
Search articles by title.
Input Schema:
{
"method": "tools/call",
"params": {
"name": "searchArticles",
"arguments": {
"query": "search term"
}
}
}
readArticle
Read a single article.
Input Schema:
{
"method": "tools/call",
"params": {
"name": "readArticle",
"arguments": {
"filename": "my-article.md"
}
}
}
createArticle
Create a new article.
Input Schema:
{
"method": "tools/call",
"params": {
"name": "createArticle",
"arguments": {
"title": "New Article",
"content": "Article content..."
}
}
}
updateArticle
Update an existing article.
Input Schema:
{
"method": "tools/call",
"params": {
"name": "updateArticle",
"arguments": {
"filename": "my-article.md",
"title": "Updated Title",
"content": "Updated content..."
}
}
}
deleteArticle
Delete an article.
Input Schema:
{
"method": "tools/call",
"params": {
"name": "deleteArticle",
"arguments": {
"filename": "my-article.md"
}
}
}
List Available Tools
{
"method": "tools/list"
}
Using with Agent Zero
Agent Zero is an AI agent framework that supports MCP servers via the Streamable HTTP transport. To connect this MCP server to Agent Zero:
-
Start the MCP Markdown Manager with a configured
AUTH_TOKEN:docker run -d -p 8097:5000 \ -e AUTH_TOKEN="your-secret-token-here" \ -e MCP_SERVER_ENABLED="true" \ -v $(pwd)/data:/data \ ghcr.io/joelmnz/mcp-markdown-manager:latest -
Configure Agent Zero by adding the following to your
tmp/settings.jsonunder themcp_serverskey:{ "name": "mcp-markdown-manager", "description": "Markdown article manager for research and notes", "type": "streaming-http", "url": "http://localhost:8097/mcp", "headers": { "Authorization": "Bearer your-secret-token-here" }, "disabled": false }Important Notes:
- Replace
your-secret-token-herewith your actualAUTH_TOKEN - If running both Agent Zero and MCP server in Docker, use the appropriate network hostname instead of
localhost - The
type: "streaming-http"is required for proper MCP protocol support - The server uses the MCP Streamable HTTP transport specification with session management
- Replace
-
Verify the connection by checking Agent Zero logs for successful tool discovery. You should see 6 tools registered:
mcp_markdown_manager.listArticlesmcp_markdown_manager.searchArticlesmcp_markdown_manager.readArticlemcp_markdown_manager.createArticlemcp_markdown_manager.updateArticlemcp_markdown_manager.deleteArticle
-
Use the tools by instructing Agent Zero, for example:
- "Create a new article about Python decorators"
- "List all my articles"
- "Search for articles about machine learning"
Transport Details:
- The server implements the MCP Streamable HTTP transport protocol
- Session management is handled automatically with
mcp-session-idheaders - POST requests are used for initialization and method calls
- GET requests establish Server-Sent Event (SSE) streams for real-time updates
- DELETE requests terminate sessions
Article Format
Articles are stored as markdown files with YAML frontmatter:
---
title: Article Title
created: 2025-01-15T10:30:00Z
---
# Article Title
Article content goes here...
## Section
More content...
Filename Generation
- User provides title when creating articles
- Filename is auto-generated: "My Article Name" ā "my-article-name.md"
- Title is extracted from first
#heading in markdown for display - Filename may differ from displayed title
Frontmatter Fields
title: Article title (string)created: ISO 8601 timestamp (string)
If frontmatter is missing, the system falls back to file system timestamps.
Web UI Usage
Login
- Navigate to http://localhost:5000
- Enter your AUTH_TOKEN
- Click "Login"
Home Page
- View last 10 articles (newest first)
- Search articles by title
- Click "New Article" to create
- Click any article to view
Article View
- Read rendered markdown
- See creation date
- Click "Edit" to modify
- Click "Delete" to remove
Article Edit
- Edit title and content
- Live preview pane (desktop)
- Save or cancel changes
Theme Toggle
- Click sun/moon icon in header
- Switches between dark and light themes
- Preference saved in browser
Development
Project Scripts
# Install dependencies
bun install
# Development (backend)
bun run dev:backend
# Development (frontend)
bun run dev:frontend
# Build frontend
bun run build
# Production server
bun run start
# Type checking
bun run typecheck
File Structure
article_manager/
āāā src/
ā āāā backend/
ā ā āāā middleware/
ā ā ā āāā auth.ts # Authentication middleware
ā ā āāā mcp/
ā ā ā āāā server.ts # MCP server implementation
ā ā āāā routes/
ā ā ā āāā api.ts # REST API routes
ā ā āāā services/
ā ā ā āāā articles.ts # Article CRUD logic
ā ā āāā server.ts # Main server
ā āāā frontend/
ā āāā components/
ā ā āāā ArticleList.tsx # Article list component
ā ā āāā Header.tsx # Header with theme toggle
ā ā āāā Login.tsx # Login page
ā āāā pages/
ā ā āāā ArticleEdit.tsx # Edit/create page
ā ā āāā ArticleView.tsx # Article view page
ā ā āāā Home.tsx # Home page
ā āāā styles/
ā ā āāā main.css # All styles
ā āāā App.tsx # Main app component
āāā public/ # Built frontend (generated)
āāā data/ # Article storage (gitignored)
āāā Dockerfile # Multi-stage Docker build
āāā docker-compose.yml # Docker Compose config
āāā package.json # Dependencies and scripts
āāā tsconfig.json # TypeScript config
āāā .env.example # Environment template
āāā .gitignore # Git ignore rules
āāā README.md # This file
Troubleshooting
Port already in use
# Find process using port 5000
lsof -i :5000
# Kill the process
kill -9 <PID>
Permission denied on data directory
# Fix permissions
chmod -R 755 ./data
Docker build fails
# Clean build cache
docker builder prune -a
# Rebuild without cache
docker-compose build --no-cache
Frontend not loading
# Rebuild frontend
bun run build
# Check if public/index.html exists
ls -la public/
Limitations
- Single user only (no multi-tenancy)
- Optimized for hundreds of articles (not thousands)
- Simple partial text search (no full-text indexing)
- Manual article creation (paste markdown)
- No image uploads or media management
- No tags, categories, or advanced metadata
- File-based storage only (no database)
- Bearer token auth only (no OAuth, sessions)
- Single Docker container (not microservices)
Security Considerations
- Store AUTH_TOKEN securely (use environment variables)
- Use HTTPS in production (reverse proxy recommended)
- Regularly backup the data directory
- Keep dependencies updated
- Docker container runs as non-root user (UID 1001) for security
- Request logging enabled for monitoring and audit trails
License
MIT License - feel free to use and modify as needed.
Contributing
This is a POC project. For production use, consider:
- Adding database support for better scalability
- Implementing full-text search (e.g., Elasticsearch)
- Adding user management and roles
- Implementing rate limiting
- Adding comprehensive test coverage
- Setting up CI/CD pipelines
Support
For issues and questions, please open an issue on the GitHub repository.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.