Cover image
Try Now
2025-04-14

MCP服务器,用于在生成的Markdown内容上执行Markdownlint规则

3 years

Works with Finder

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

相关推荐

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • sigoden
  • 使用普通的bash/javascript/python函数轻松创建LLM工具和代理。

  • hkr04
  • 轻巧的C ++ MCP(模型上下文协议)SDK

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • RockChinQ
  • 😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack

  • dmayboroda
  • 带有可配置容器的本地对话抹布

  • paulwing
  • 使用MCP服务创建的测试存储库

  • modelscope
  • 开始以更轻松的方式开始构建具有LLM授权的多代理应用程序。

    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!