Skip to main content
Glama

FlashCardMCP / 闪卡生成MCP服务

Version: 10.1


项目介绍

FlashCardMCP 是一个基于 FastMCP 的 MCP 服务,用于将 JSON/CSV 格式的 Markdown 内容转换为交互式闪卡页面。这个服务适用于学习、教学和知识管理以及任何你想要的场景,可以帮助用户创建自己的数字闪卡集。

  • 专注内容:使用Markdown格式,符合LLM的输出,让用户专注于内容的输出,而不是格式等其他无关紧要的内容;

  • 稳定输出:采用函数稳定生成闪卡,支持CSS格式Style输入,满足个性化需求;

  • 场景化模板: 预制模板用于预设的不同场景,后续会进一步拓展;

  • PDF输出:闪卡可打印成PDF(8连卡),进一步满足不同场景下,以及现实多种场景下的使用和记忆。

Related MCP server: Little Red Book Card MCP

功能特性

  1. Markdown 支持: 闪卡内容支持完整的 Markdown 语法,包括标题、列表、代码块、表格等

  2. 交互式闪卡: 点击卡片可以翻转查看背面内容

  3. 多种模板: 提供 Default、Minimal、Listen 三种不同的闪卡模板

  4. 语音功能: Listen 模板支持语音播放和听写模式(考虑到兼容性,目前仅是Web Speech API,效果一般)

  5. 响应式设计: 适配不同屏幕尺寸

  6. 打印支持: 支持导出 PDF 和打印功能

  7. 数据验证: 内置数据格式验证功能

  8. CSV 转换: 支持从 CSV 数据快速创建闪卡

FastMCP 配置

本项目使用 FastMCP 框架构建 MCP 服务,提供以下功能:

  • Resources(资源): 通过 GET 端点暴露只读数据

  • Tools(工具): 通过 POST 端点提供可执行功能

  • 多种返回类型: 支持文本、JSON、图像、音频等格式

可用的MCP工具和资源

服务器通过MCP协议暴露以下工具和资源:

资源

  1. flashcard-templates

    • URIresource://flashcard-templates

    • 描述:获取所有可用闪卡模板的信息和配置

    • 返回格式:JSON格式的模板配置信息

工具

  1. create_flashcards_from_json

    • 描述:从JSON数据创建交互式HTML闪卡

    • 参数

      • cards:闪卡数据列表,包含'front'、'back'和可选的'tags'

      • title:闪卡集标题

      • description:闪卡集描述

      • template:模板类型('minimal'、'default'、'listen')

      • theme:主题('light'、'dark'、'basic'、'advance'、'detail')

    • 返回:生成的HTML内容字符串

  2. generate_flashcards_pdf

    • 描述:从JSON数据生成PDF格式闪卡

    • 参数

      • cards:闪卡数据列表,包含'front'、'back'和可选的'tags'

      • title:闪卡集标题

      • description:闪卡集描述

      • layout:布局类型('single'或'a4_8')

      • output_path:保存PDF文件的目录路径

    • 返回:成功消息,包含文件路径和大小信息

  3. convert_csv_to_json

    • 描述:将CSV内容转换为闪卡JSON格式

    • 参数

      • csv_content:原始CSV内容字符串

      • front_columns:卡片正面的列索引(如"0,1")

      • back_columns:卡片背面的列索引(如"2,3")

      • tags_column:标签列索引(可选)

      • has_header:CSV是否有标题行

      • title:闪卡集标题

      • description:闪卡集描述

      • column_separator:多列内容分隔符

      • template:样式模板类型

      • theme:样式主题

    • 返回:完整闪卡数据的JSON字符串

  4. validate_flashcard_data

    • 描述:验证闪卡JSON数据结构

    • 参数

      • flashcard_json:JSON格式的闪卡数据

    • 返回:验证结果消息

闪卡模板

1. Default 模板

  • 流式网格布局,每行显示2张卡片

  • 适合桌面浏览和批量查看闪卡

2. Minimal 模板

  • 单卡片居中显示

  • 适合专注学习和逐张复习

3. Listen 模板

  • 单卡片 + 底部控制面板

  • 支持语音播放和听写模式

  • 适合语言学习和语音复习

输出效果展示

项目在 sample/ 目录中提供了多种输出效果的示例:

HTML 闪卡示例

  • card_template_sample.html: Default 模板的完整示例,展示流式网格布局和翻转动画效果

  • minimal_template_sample.html: Minimal 模板示例,单卡片居中显示,适合专注学习

  • listen_template_sample.html: Listen 模板示例,支持语音播放和听写模式

PDF 输出示例

sample/pdf_generate/ 目录包含多种场景的PDF闪卡示例:

  • 康奈尔笔记法闪卡_8卡片布局.pdf: 学习方法类闪卡

  • 基础测试_8卡片布局.pdf: 基础知识测试闪卡

  • Markdown测试_8卡片布局.pdf: Markdown语法支持演示

  • 词语表闪卡练习_8卡片布局.pdf: 词汇学习闪卡

  • 日文注音测试_8卡片布局.pdf: 多语言支持示例

所有PDF采用A4纸8卡片布局,适合打印和实体使用。

Demo 页面

注意: Demo 页面功能正在开发中,将在后续版本中提供在线演示。

快速开始

安装依赖

使用 UV 安装项目依赖:

uv sync

或者使用标准的 pip 命令:

pip install -e .

运行 MCP 服务

MCP 服务器默认使用 STDIO 传输协议,与 Claude Desktop 等 MCP 客户端兼容:

python server.py

版本记录

Version 10.1 (当前版本)

  • 更新了所有README文件中的版本信息

  • 修正了MCP工具和资源的描述,确保与实际功能一致

  • 更新了MCP客户端配置,使用正确的uv run命令

  • 完善了文档结构和内容

未来版本计划

  • 增加更多闪卡模板

  • 优化语音功能

  • 添加在线Demo页面

  • 支持更多导出格式

许可证

本项目采用 GPL 协议。

Available Tools

4 tools
convert_csv_to_jsonA

Convert CSV content to flashcard JSON format.

Args: csv_content: Raw CSV content as string front_columns: Comma-separated column indices for card front (e.g., "0,1") back_columns: Comma-separated column indices for card back (e.g., "2,3") tags_column: Column index for tags (optional) has_header: Whether CSV has header row title: Title for the flashcard set description: Description of the flashcard set column_separator: Separator for multi-column content template: Template type for styling theme: Theme for styling

Returns: JSON string of complete flashcard data

ParametersJSON Schema
NameRequiredDescriptionDefault
themeNolight
titleNoCSV Imported Flashcards
templateNominimal
has_headerNo
csv_contentYes
descriptionNoFlashcards converted from CSV data
tags_columnNo
back_columnsNo1
front_columnsNo0
column_separatorNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses that the tool converts CSV to JSON and returns a JSON string, but it does not address error handling, column indexing base, or any side effects. The parameter explanations add some behavioral context, but important details like whether the operation is read-only or modifies data are absent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with Args and Returns sections. It front-loads the primary purpose in one sentence, and every line provides useful parameter or return information without redundancy. This is concise yet comprehensive.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 10 parameters, 1 required, and zero schema descriptions, the description covers all parameters and the return value, making it largely sufficient. Minor ambiguities remain (e.g., the exact semantics of column_separator and template), but overall it provides a complete overview of the tool's behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description compensates by explaining each parameter, e.g., 'Comma-separated column indices for card front (e.g., "0,1")' and 'Column index for tags (optional)'. This adds meaning beyond the bare schema titles, though some parameters like column_separator remain vague.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Convert CSV content to flashcard JSON format', a specific verb+resource, which distinguishes it from sibling tools like create_flashcards_from_json and generate_flashcards_pdf. The purpose is unambiguous and directly tied to the tool name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description makes it clear the tool is for converting CSV into flashcard JSON, which implicitly differentiates it from sibling tools. However, it does not explicitly state when to use it over alternatives or mention any exclusions. The context is clear but not fully explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

create_flashcards_from_jsonA

Create interactive HTML flashcards from JSON card data.

Args: cards: List of flashcard data with 'front', 'back', and optional 'tags' title: Title for the flashcard set description: Description of the flashcard set template: Template type ('minimal', 'default', 'elegant') theme: Theme ('light' or 'dark')

Returns: HTML content as string

ParametersJSON Schema
NameRequiredDescriptionDefault
cardsYes
themeNolight
titleNoMy Flashcard Set
templateNominimal
descriptionNoFlashcards generated using MCP tools

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the inputs, return type (HTML string), and the interactive nature of the output. However, it does not mention edge-case behavior, error handling, or validation of card data, leaving some behavioral aspects opaque.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a well-structured docstring: a one-line summary followed by Args and Returns sections. Every sentence adds value, with no fluff or repetition. It is appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter tool with one required parameter and no annotations, the description covers inputs, output format, and the tool's purpose. It also hints at the expected structure of the flashcards. Minor gaps include not stating how invalid cards are handled or whether the tool performs validation, but overall it is sufficiently complete for a simple generation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description fully compensates by defining each parameter: cards with 'front', 'back', and optional 'tags', title and description as strings, template with allowed values ('minimal', 'default', 'elegant'), and theme ('light' or 'dark'). This adds meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb and resource: "Create interactive HTML flashcards from JSON card data." This clearly identifies the tool's function and distinguishes it from siblings like generate_flashcards_pdf (PDF output) and convert_csv_to_json (data conversion).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for HTML generation from JSON data, and mentions interactive HTML output, which differentiates it from PDF generation. However, it does not explicitly state when to use this tool vs alternatives (e.g., when to validate first) or provide exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_flashcards_pdfA

Generate PDF flashcards from JSON card data.

Args: cards: List of flashcard data with 'front', 'back', and optional 'tags' title: Title for the flashcard set description: Description of the flashcard set layout: Layout type ('single' or 'a4_8') output_path: Directory path to save the PDF file show_deck_name: Whether to show the title on the PDF show_card_index: Whether to show the card index on the PDF

Returns: Success message with file path and size information

ParametersJSON Schema
NameRequiredDescriptionDefault
cardsYes
titleNoMy Flashcard Set
layoutNoa4_8
descriptionNoPDF format flashcards
output_pathNo
show_deck_nameNo
show_card_indexNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the behavioral burden. It explains the return value (success message with path/size) and layout options, but does not disclose potential side effects like overwriting existing files, how the output filename is derived from output_path (described only as 'directory path'), or failure behavior on invalid data. This leaves moderate ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description uses a clear Args/Returns structure and a one-sentence purpose. It is appropriately sized for a 7-parameter tool, though it repeats some default values already present in the schema. Still, each sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having no annotations and a modest output schema, the description covers core inputs and returns but misses critical operational details: whether output_path is a directory or full file path, overwrite behavior, and error handling for invalid cards. For an AI agent to invoke this tool correctly, those details would be valuable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description fully compensates by defining every parameter, including the structure of 'cards' (front, back, optional tags), layout allowed values, and the meaning of show_deck_name and show_card_index. This is far beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Generate PDF flashcards from JSON card data.' This clearly distinguishes it from sibling tools like validate_flashcard_data and convert_csv_to_json, which serve different pipeline stages.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when JSON card data exists and a PDF output is needed. It doesn't explicitly mention when not to use it or name alternatives, but the context is clear enough for an agent to select it appropriately among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

validate_flashcard_dataC

Validate flashcard JSON data structure.

Args: flashcard_json: Flashcard data in JSON format

Returns: Validation result message

ParametersJSON Schema
NameRequiredDescriptionDefault
flashcard_jsonYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description must disclose side effects, permissions, or error behavior. It only says 'Returns: Validation result message' without explaining what happens on invalid data or whether it modifies anything.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded, with a clear Args/Returns structure. It is appropriately sized, though additional details could enrich it without bloat.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's validation purpose and no annotations, the description lacks details about validation rules, error handling, and the shape of the expected data. The output schema existence partly covers return values, but the input side remains under-specified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage; the description's 'flashcard_json: Flashcard data in JSON format' adds minimal meaning but fails to specify the expected structure, required fields, or constraints, leaving the agent without guidance for constructing a valid input.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Validate') and resource ('flashcard JSON data structure'), clearly distinguishing it from siblings like convert_csv_to_json or generate_flashcards_pdf.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage context or alternative references are provided; it does not tell the agent when to choose this tool over others or any prerequisites for calling it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.0
    • First observedconvert_csv_to_json
    • First observedcreate_flashcards_from_json
    • First observedgenerate_flashcards_pdf
    • First observedvalidate_flashcard_data

TDQS

A3.9/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: creating HTML flashcards, generating PDFs, converting CSV to JSON, and validating data. No two tools overlap in function.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (create_flashcards_from_json, generate_flashcards_pdf, convert_csv_to_json, validate_flashcard_data). The verbs vary but are all descriptive and the pattern is uniform.

Tool Count5/5

Four tools form a well-scoped set for a flashcard generation server. Each tool serves a necessary step in the workflow without redundancy.

Completeness5/5

The toolset covers the full pipeline: importing data (convert_csv_to_json), validating it (validate_flashcard_data), and producing outputs (HTML and PDF). No obvious gaps such as missing export options or data handling steps.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Moonzhang/FlashcardMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server