Sponsored by Deepsite.site

go-mcp-server-mds

Created By
Warashi8 months ago
A Go implementation of a Model Context Protocol (MCP) server that serves markdown files with frontmatter support from a filesystem.
Content

go-mcp-server-mds

A Go implementation of a Model Context Protocol (MCP) server that serves markdown files from a filesystem.

Overview

This server provides a way to expose markdown files through the Model Context Protocol, making them accessible as resources and providing tools to list and read markdown files. It supports markdown files with YAML or TOML frontmatter.

Features

  • Serve markdown files via MCP
  • List all available markdown files with metadata
  • Read individual markdown file contents
  • Support for YAML and TOML frontmatter
  • File system abstraction using fs.FS
  • Resource management with URI-based access

Frontmatter Support

The server supports markdown files with YAML or TOML frontmatter. Frontmatter is metadata placed at the beginning of a markdown file, enclosed by delimiters.

YAML Frontmatter

YAML frontmatter uses --- as delimiters:

---
title: My Document
date: 2024-03-21
tags: [documentation, markdown]
---

# Document Content

TOML Frontmatter

TOML frontmatter uses +++ as delimiters:

+++
title = "My Document"
date = 2024-03-21
tags = ["documentation", "markdown"]
+++

# Document Content

The frontmatter metadata is parsed and made available through the server's tools and resource descriptions. This metadata can include any valid YAML or TOML data and is useful for organizing and describing your markdown documents.

Installation

go get github.com/Warashi/go-mcp-server-mds

Usage

Here's a basic example of how to create and use the MCP markdown server:

package main

import (
    "context"
    "os"

    mcpmds "github.com/Warashi/go-mcp-server-mds"
)

func main() {
    // Create a new server using the current directory
    server, err := mcpmds.New(
        "markdown-server",
        "A server that provides access to markdown files",
        os.DirFS("."),
    )
    if err != nil {
        panic(err)
    }

    // Start the server
    if err := server.ServeStdio(context.Background()); err != nil {
        panic(err)
    }
}

Command-Line Tool (mcp-server-mds)

This repository includes a command-line tool mcp-server-mds that runs the server directly.

Installing

To build the command-line tool:

go install github.com/Warashi/go-mcp-server-mds/cmd/mcp-server-mds@latest

Running

To run the server, execute the built binary. It serves markdown files from a specified directory over standard input/output.

$HOME/go/bin/mcp-server-mds -path /path/to/your/markdown/files

Flags:

  • -path: Specifies the directory containing the markdown files to serve. Defaults to the current directory (.).
  • -name: Sets the server name. Defaults to mcp-server-mds.
  • -description: Sets the server description. Defaults to Markdown Documents Server.

Available Tools

list_{server-name}_markdown_files

Lists all markdown files managed by the server. Returns metadata including:

  • File path
  • File size
  • Parsed frontmatter (if available)

read_{server-name}_markdown_file

Reads a specific markdown file. Requires:

  • path: The path to the markdown file

Returns:

  • File path
  • File size
  • Parsed frontmatter
  • Full file content

Resource Access

Resources are accessible via file:// URIs. Each markdown file is registered as a resource with:

  • URI: file://{path}
  • Name: Base filename
  • Description: JSON-encoded frontmatter
  • MimeType: text/markdown
  • Size: File size in bytes

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Tavily Mcp
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
ChatWiseThe second fastest AI chatbot™
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
DeepChatYour AI Partner on Desktop
Serper MCP ServerA Serper MCP Server
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Amap Maps高德地图官方 MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.