提示加载器MCP服务器

Shinkuro是一个通用的提示加载器MCP服务器,用于从本地文件夹或Git仓库加载Markdown文件并将其作为MCP提示提供服务,适用于将各种来源和格式的提示加载到支持MCP的应用程序中。

  • by DiscreteTom
  • Rust
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 DiscreteTom/shinkuro-rs

使用说明

Shinkuro-通用提示加载器MCP服务器

从本地文件夹或git存储库加载markdown文件,并将其用作 MCP提示.

有助于将各种来源和格式的提示加载到启用MCP的应用程序中,并在组织之间共享提示。

用法

重要:确保您的MCP客户端支持MCP Prompts功能。请参阅 特征支持矩阵.

完整CLI使用情况

shinkuro --help
Universal prompt loader MCP server

Usage: shinkuro [OPTIONS]

Options:
      --folder <FOLDER>                    [env: FOLDER=]
      --git-url <GIT_URL>                  [env: GIT_URL=]
      --cache-dir <CACHE_DIR>              [env: CACHE_DIR=] [default: ~/.shinkuro/remote]
      --auto-pull                          [env: AUTO_PULL=]
      --variable-format <VARIABLE_FORMAT>  [env: VARIABLE_FORMAT=] [default: brace]
      --auto-discover-args                 [env: AUTO_DISCOVER_ARGS=]
      --skip-frontmatter                   [env: SKIP_FRONTMATTER=]
  -h, --help                               Print help
  -V, --version                            Print version

本地文件

添加到MCP客户端配置中:

{
  "mcpServers": {
    "shinkuro": {
      "command": "npx",
      "args": ["-y", "shinkuro"],
      "env": {
        "FOLDER": "/path/to/prompts"
      }
    }
  }
}

远程Git仓库

添加到MCP客户端配置中:

{
  "mcpServers": {
    "shinkuro": {
      "command": "npx",
      "args": ["-y", "shinkuro"],
      "env": {
        "GIT_URL": "https://github.com/owner/repo.git",
        "FOLDER": "prompts" // optional, subfolder within git repo
      }
    }
  }
}

这将把存储库克隆到本地缓存目录中。请确保您拥有正确的权限。

支持私有存储库,例如。 "GIT_URL": "git@github.com:DiscreteTom/shinkuro.git" (使用SSH密钥), "GIT_URL": "https://<username>:<PAT>@github.com/owner/repo.git" (带个人访问令牌)

与...一起使用 规格套件

Expand

首先,将规范工具包提示移到 ./.shinkuro/prompts 文件夹。

然后添加到MCP客户端配置中:

{
  "mcpServers": {
    "shinkuro": {
      "command": "npx",
      "args": ["-y", "shinkuro"],
      "env": {
        "FOLDER": "./.shinkuro/prompts",
        "VARIABLE_FORMAT": "dollar",
        "AUTO_DISCOVER_ARGS": "true",
        "SKIP_FRONTMATTER": "true"
      }
    }
  }
}

这将以MCP提示的形式显示规格套件说明。

提示加载

指定文件夹(包括嵌套文件夹)中的每个markdown文件都会作为提示加载。

文件夹结构示例:

my-prompts/
├── think.md
└── dev/
     ├── code-review.md
     └── commit.md

上面的示例将加载到3个提示: think, code-review 和 commit.

提示文件示例

最简单的

Commit to git using conventional commit.

提示元数据

---
name: "code-review" # optional, defaults to filename
title: "Code Review Assistant" # optional, defaults to filename
description: "" # optional, defaults to file path
---

# Code Review

Please review this code for best practices and potential issues.

提出论点

---
name: "greeting"
description: "Generate a personalized greeting message"
arguments:
  - name: "user"
    description: "Name of the user"
    # no default = required parameter
  - name: "project"
    description: "Project name"
    default: "MyApp"
---

Say: Hello {user}! Welcome to {project}. Hope you enjoy your stay!

变量如 {user} 和 {project} 当检索到提示时,将替换为实际值。

使用 {{var}} (双括号)用于在使用大括号格式化程序时转义和显示文字括号。

不同的变量格式:

  • brace (默认): {user}, {project}
  • dollar: $user, $project

安装独立二进制文件

Shell (macOS/Linux)
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/DiscreteTom/shinkuro-rs/releases/latest/download/shinkuro-installer.sh | sh
PowerShell (Windows)
irm https://github.com/DiscreteTom/shinkuro-rs/releases/latest/download/shinkuro-installer.ps1 | iex
npm
npm install -g shinkuro

示例提示存储库

更新日志