MCP cover image
See in Github
2025-04-14

MCP server for enforcing markdownlint rules on generated markdown content

0

Github Watches

0

Github Forks

0

Github Stars

markdownlint-mcp-server

A Model Context Protocol (MCP) server implementation for markdownlint that validates markdown content against markdownlint rules.

Features

  • Validates markdown content using markdownlint
  • Provides access to markdownlint rules
  • Supports custom configuration
  • Implements the MCP protocol for AI/LLM integration
  • Can be used by Cursor to validate generated markdown

Installation

npm install markdownlint-mcp-server

Usage

As a CLI

markdownlint-mcp-server

The server will start and listen for MCP protocol messages on stdio.

As a Library

import { markdownlintMcpServer } from 'markdownlint-mcp-server';

const server = markdownlintMcpServer();
// Use the server with your preferred MCP transport

Integration with Cursor

Cursor can use this MCP server to validate its markdown generation:

  1. Start the MCP server
  2. Cursor will connect to the server
  3. When generating markdown content, Cursor will:
    • Send the content to the validate tool
    • Check for any linting errors
    • Use the validation results to improve its markdown generation
    • Ensure the final output follows markdownlint rules

Example workflow:

// Cursor's markdown generation process
const markdown = generateMarkdown();
const validation = await validateMarkdown(markdown);
if (!validation.isValid) {
  // Use the validation errors to improve markdown generation
  // The errors provide detailed information about what needs to be fixed
  console.log('Markdown validation errors:', validation.errors);
  // Cursor can use this information to adjust its generation
}
return markdown;

The validation results include detailed information about any issues found:

  • Line numbers where issues occur
  • Rule descriptions and information
  • Error details and context
  • Range of text affected

API

The server provides two tools:

  1. validate - Validates markdown content

    {
      content: string;      // The markdown content to validate
      config?: object;      // Optional markdownlint configuration
    }
    
  2. rules - Returns the available markdownlint rules

    {}  // No parameters needed
    

Configuration

The server uses a default configuration based on markdownlint's recommended rules. You can override these rules by providing a custom configuration when using the validate tool.

Development

Building

npm run build

Project Structure

  • src/
    • index.ts - Main server implementation
    • config.ts - Default markdownlint configuration
    • types.ts - Shared types and schemas
    • validation.ts - Markdown validation logic
    • bin.ts - CLI entry point

CI/CD

The project uses GitHub Actions for continuous integration and deployment:

  • CI Pipeline: Runs on every push and pull request

    • Tests on Node.js 18.x and 20.x
    • Builds the project
    • Runs type checking
  • Release Pipeline: Runs when a new release is published

    • Builds the project
    • Publishes to npm

To create a new release:

  1. Update the version in package.json
  2. Create a new release on GitHub
  3. The release workflow will automatically publish to npm

License

MIT

相关推荐

  • WangRongsheng
  • 🧑‍🚀 全世界最好的LLM资料总结(Agent框架、辅助编程、数据处理、模型训练、模型推理、o1 模型、MCP、小语言模型、视觉语言模型) | Summary of the world's best LLM resources.

  • langgenius
  • Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.

  • av
  • Effortlessly run LLM backends, APIs, frontends, and services with one command.

  • alibaba
  • an easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.

  • 1Panel-dev
  • 🔥 1Panel provides an intuitive web interface and MCP Server to manage websites, files, containers, databases, and LLMs on a Linux server.

  • microsoft
  • Python tool for converting files and office documents to Markdown.

  • rulego
  • ⛓️RuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.

  • mindsdb
  • AI's query engine - Platform for building AI that can answer questions over large scale federated data. - The only MCP Server you'll ever need

  • hkr04
  • Lightweight C++ MCP (Model Context Protocol) SDK

  • nbonamy
  • Witsy: desktop AI assistant / universal MCP client

  • WangRongsheng
  • 🧑‍🚀 全世界最好的LLM资料总结(视频生成、Agent、辅助编程、数据处理、模型训练、模型推理、o1 模型、MCP、小语言模型、视觉语言模型) | Summary of the world's best LLM resources.

  • labring
  • FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, and visual AI workflow orchestration, letting you easily develop and deploy complex question-answering systems without the need for extensive setup or configuration.

    Reviews

    3.6 (11)
    Avatar
    user_UbiO0DMN
    2025-04-23

    As a dedicated user of MCP applications, I find the markdownlint-mcp-server by barnett617 to be an indispensable tool for ensuring clean and consistent Markdown code. It's robust, reliable, and integrates seamlessly with my workflow. Highly recommend for anyone looking to maintain high standards in their documentation projects!

    Avatar
    user_YvHQ5K4s
    2025-04-23

    markdownlint-mcp-server is an excellent tool for maintaining consistent markdown style. Developed by barnett617, it integrates seamlessly with MCP applications, making it easy to enforce coding standards. Its user-friendly interface and robust features ensure high-quality documentation. Highly recommended for any professional looking to streamline their markdown workflow!

    Avatar
    user_O4AklIY6
    2025-04-23

    markdownlint-mcp-server by barnett617 is an outstanding tool for developers who work extensively with Markdown. It provides seamless integration and helps maintain consistent Markdown formatting effortlessly. The user-friendly interface and robust features make it an essential part of my workflow. Highly recommend it to anyone dealing with Markdown documents regularly!

    Avatar
    user_TEMohypk
    2025-04-23

    I've been using the markdownlint-mcp-server by barnett617, and it has significantly improved my productivity. The tool effectively enforces markdown standards, ensuring all my documentation is consistently formatted. The seamless integration and comprehensive error reporting are standout features. It's a must-have for anyone working extensively with markdown.

    Avatar
    user_CI7lYeQI
    2025-04-23

    As a dedicated user of the markdownlint-mcp-server, I've found it incredibly effective for ensuring my Markdown files adhere to best practices. The integration with MCP is seamless, and the server setup is straightforward. Kudos to barnett617 for this fantastic tool that enhances my writing workflow. Highly recommended for anyone serious about Markdown!

    Avatar
    user_1R5PYXKG
    2025-04-23

    As a dedicated user of the markdownlint-mcp-server by barnett617, I can affirm that this tool significantly enhances the quality of Markdown documents. It integrates seamlessly with my workflow, providing real-time linting and ensuring adherence to best practices. Highly recommended for anyone looking to improve their Markdown documentation!

    Avatar
    user_KOQJ73TX
    2025-04-23

    As a dedicated user of the markdownlint-mcp-server, I must say it's an essential tool for maintaining clean and consistent Markdown files. The seamless integration and user-friendly interface provided by barnett617 make it a standout choice for any developer looking to enhance their Markdown documentation with ease. Highly recommended!

    Avatar
    user_NkZOLIhE
    2025-04-23

    I've been using the markdownlint-mcp-server by barnett617 for a while now, and it's an excellent tool for keeping my markdown files error-free and well-formatted. The setup process is straightforward, and the server runs smoothly, providing instant feedback as I edit. This has significantly improved my workflow, saving me time and ensuring my documents maintain a high standard. Highly recommended for anyone serious about markdown!

    Avatar
    user_yrNnqljo
    2025-04-23

    As a dedicated user of the MCP application, I am thoroughly impressed with the markdownlint-mcp-server by barnett617. This server has significantly enhanced my markdown editing workflow, ensuring high-quality and consistent documentation. Its seamless integration and user-friendly features make it an indispensable tool for any developer. Highly recommended!

    Avatar
    user_CCOI7Eec
    2025-04-23

    markdownlint-mcp-server from barnett617 is an exceptional tool for anyone serious about maintaining clean and consistent Markdown files. It seamlessly integrates into your workflow, ensuring all your documents adhere to best practices. The intuitive interface combined with powerful linting capabilities has significantly improved the quality of my Markdown documents. Highly recommended!

    Avatar
    user_bsksEFsb
    2025-04-23

    I recently started using markdownlint-mcp-server and it has been a game changer for my markdown files! The tool, created by barnett617, does an incredible job at ensuring my markdown is clean and error-free. It's simple to set up, and the minimalistic welcome information makes onboarding a breeze. Highly recommend this server for anyone looking to improve their markdown documentation!