txt-to-md-mcp

txt-to-md-mcp

Enables writing text content to Markdown files with folder organization and overwrite control, and listing recent Markdown files.

Category
Visit Server

README

TXT to MD MCP 服务器

这是一个基于 FastMCP 的简单工具,用于将文本内容写入到 Markdown 文档。

PS:起因是vscode只能保存一定的量的历史,而且各项目之间历史也不互通,有些历史记录感觉有必要保存以下。看一些其他的memory mcp,感觉工具太多了没什么必要,所以弄个简单的就是为了存个对话历史。

功能特性

  • 📝 将文本内容转换为 Markdown 格式并保存
  • 📂 支持子文件夹组织
  • 🔒 支持文件覆盖控制
  • 📋 列出最近修改的 Markdown 文件
  • 🚀 支持通过 stdio 方式启动
  • ⚙️ 启动时指定存储路径

安装依赖

pip install fastmcp

使用方法

1. 直接运行服务器

# 使用默认路径
python server.py

# 指定存储路径
python server.py "d:\my-notes"

2. 在 VS Code 中配置

Claude Desktop 配置

在 Claude Desktop 的配置文件中添加:

{
  "mcpServers": {
    "txt-to-md-converter": {
      "command": "python",
      "args": [
        "d:\\obsidian_storage\\default\\mcp\\txt-to-md-mcp\\server.py",
        "d:\\obsidian_storage\\default"
      ],
      "env": {}
    }
  }
}

VS Code 扩展配置

在 VS Code 的 settings.json 中添加:

{
  "mcp.servers": [
    {
      "name": "txt-to-md-converter",
      "command": "python",
      "args": [
        "d:\\obsidian_storage\\default\\mcp\\txt-to-md-mcp\\server.py",
        "d:\\obsidian_storage\\default"
      ],
      "cwd": "d:\\obsidian_storage\\default\\mcp\\txt-to-md-mcp"
    }
  ]
}

3. 使用工具

write_txt_to_markdown

将文本内容写入 Markdown 文件:

# 基本使用
{
    "content": "这是文本内容\\n\\n支持多行文本",
    "filename": "my-note"  # 会自动添加 .md 扩展名
}

# 高级使用
{
    "content": "## 会议记录\\n\\n- 讨论项目进度",
    "filename": "meeting_notes",
    "title": "每周会议记录",
    "subfolder": "work",  # 存储到 work 子文件夹
    "overwrite": true     # 覆盖已存在文件
}

list_recent_md_files

列出最近修改的 Markdown 文件:

{
    "limit": 10,          # 返回文件数量限制
    "subfolder": "work"   # 可选:指定子文件夹
}

stdio 启动方式说明

MCP 通过 stdio (标准输入/输出) 方式启动,实现与客户端的通信:

工作原理

  1. 进程启动: 客户端启动 MCP 服务器进程,传递存储路径参数
  2. 通信管道: 通过 stdin/stdout 进行 JSON-RPC 通信
  3. 协议交互: 初始化 → 工具注册 → 工具调用

启动参数

服务器接受一个可选的命令行参数作为存储路径:

python server.py [存储路径]
  • 如果不提供参数,默认使用 d:/obsidian_storage/default
  • 如果目录不存在,会自动创建

在不同客户端中的配置

  1. Claude Desktop: 在 args 数组中添加存储路径
  2. VS Code 扩展: 在配置的 args 中指定路径
  3. 自定义客户端: 启动进程时传递路径参数

测试

运行测试脚本验证功能:

python test_server.py

测试脚本会:

  • 启动服务器(传递测试路径)
  • 发送初始化请求
  • 调用文件写入工具
  • 验证结果

示例

快速笔记

{
    "content": "今天学习了 MCP 协议\\n\\n- 支持 stdio 通信\\n- 使用 JSON-RPC",
    "filename": "mcp-learning"
}

项目文档

{
    "content": "# 项目计划\\n\\n## 第一阶段\\n- 需求分析\\n- 架构设计",
    "filename": "project-plan",
    "title": "项目开发计划",
    "subfolder": "projects"
}

许可证

MIT License

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured